/* ================================================================
   BODEKULL — stylesheet.css
   ----------------------------------------------------------------
   VINTAGE PAPER THEME — complete shadcn/ui CSS variable set
   Colors  : tweakcn.com Vintage Paper preset (BookShelf globals.css)
   Fonts   : tweakcn.com Custom Typography schema
     --font-sans : Libre Baskerville  (body / UI)
     --font-serif: Lora               (display / headings)
     --font-mono : IBM Plex Mono      (code / technical)
   ================================================================ */

/* ────────────────────────────────────────────────────────────────
   DESIGN TOKENS — LIGHT MODE
   ──────────────────────────────────────────────────────────────── */
:root {
  /* Colour tokens */
  --background:              oklch(0.9700 0.0220 80);
  --foreground:              oklch(0.2800 0.0400 60);
  --card:                    oklch(0.9500 0.0250 78);
  --card-foreground:         oklch(0.2800 0.0400 60);
  --popover:                 oklch(0.9500 0.0250 78);
  --popover-foreground:      oklch(0.2800 0.0400 60);
  --primary:                 oklch(0.4800 0.0900 60);
  --primary-foreground:      oklch(0.9700 0.0220 80);
  --secondary:               oklch(0.9200 0.0320 76);
  --secondary-foreground:    oklch(0.2800 0.0400 60);
  --muted:                   oklch(0.9300 0.0270 78);
  --muted-foreground:        oklch(0.5200 0.0500 65);
  --accent:                  oklch(0.9000 0.0420 74);
  --accent-foreground:       oklch(0.2800 0.0400 60);
  --destructive:             oklch(0.5700 0.2100 25);
  --destructive-foreground:  oklch(0.9700 0.0220 80);
  --border:                  oklch(0.8600 0.0400 72);
  --input:                   oklch(0.8600 0.0400 72);
  --ring:                    oklch(0.4800 0.0900 60);
  --radius:                  0.5rem;

  /* Chart tokens */
  --chart-1: oklch(0.5400 0.1200 60);
  --chart-2: oklch(0.6200 0.1000 72);
  --chart-3: oklch(0.7200 0.0800 82);
  --chart-4: oklch(0.4200 0.0900 50);
  --chart-5: oklch(0.6800 0.0900 90);

  /* Sidebar tokens */
  --sidebar:                    oklch(0.9500 0.0250 78);
  --sidebar-foreground:         oklch(0.2800 0.0400 60);
  --sidebar-primary:            oklch(0.4800 0.0900 60);
  --sidebar-primary-foreground: oklch(0.9700 0.0220 80);
  --sidebar-accent:             oklch(0.9000 0.0420 74);
  --sidebar-accent-foreground:  oklch(0.2800 0.0400 60);
  --sidebar-border:             oklch(0.8600 0.0400 72);
  --sidebar-ring:               oklch(0.4800 0.0900 60);

  /* Typography tokens */
  --font-sans:  'Libre Baskerville', Georgia, serif;
  --font-serif: 'Lora', Georgia, serif;
  --font-mono:  'IBM Plex Mono', 'Courier New', monospace;

  /* Local extras */
  --gold:        oklch(0.72 0.120 75);
  --accent-warm: oklch(0.62 0.110 68);

  color-scheme: light;
}

/* ────────────────────────────────────────────────────────────────
   DESIGN TOKENS — DARK MODE
   ──────────────────────────────────────────────────────────────── */
.dark {
  --background:              oklch(0.2200 0.0200 60);
  --foreground:              oklch(0.9000 0.0300 80);
  --card:                    oklch(0.2700 0.0220 62);
  --card-foreground:         oklch(0.9000 0.0300 80);
  --popover:                 oklch(0.2700 0.0220 62);
  --popover-foreground:      oklch(0.9000 0.0300 80);
  --primary:                 oklch(0.7500 0.1000 70);
  --primary-foreground:      oklch(0.2200 0.0200 60);
  --secondary:               oklch(0.3200 0.0260 64);
  --secondary-foreground:    oklch(0.9000 0.0300 80);
  --muted:                   oklch(0.3200 0.0260 64);
  --muted-foreground:        oklch(0.6500 0.0400 72);
  --accent:                  oklch(0.3500 0.0300 68);
  --accent-foreground:       oklch(0.9000 0.0300 80);
  --destructive:             oklch(0.6200 0.2100 25);
  --destructive-foreground:  oklch(0.9700 0 0);
  --border:                  oklch(0.3600 0.0300 62);
  --input:                   oklch(0.3600 0.0300 62);
  --ring:                    oklch(0.7500 0.1000 70);

  --chart-1: oklch(0.7400 0.1200 70);
  --chart-2: oklch(0.6800 0.1000 80);
  --chart-3: oklch(0.6200 0.0800 90);
  --chart-4: oklch(0.5800 0.1000 58);
  --chart-5: oklch(0.8000 0.0900 88);

  --sidebar:                    oklch(0.2700 0.0220 62);
  --sidebar-foreground:         oklch(0.9000 0.0300 80);
  --sidebar-primary:            oklch(0.7500 0.1000 70);
  --sidebar-primary-foreground: oklch(0.2200 0.0200 60);
  --sidebar-accent:             oklch(0.3500 0.0300 68);
  --sidebar-accent-foreground:  oklch(0.9000 0.0300 80);
  --sidebar-border:             oklch(0.3600 0.0300 62);
  --sidebar-ring:               oklch(0.7500 0.1000 70);

  --gold:        oklch(0.78 0.120 78);
  --accent-warm: oklch(0.72 0.110 70);

  color-scheme: dark;
}

/* ────────────────────────────────────────────────────────────────
   RESET & BASE
   ──────────────────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.80;
  background-color: var(--background);
  color: var(--foreground);
  transition: background-color 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
}

/* Subtle paper grain overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.018;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)'/%3E%3C/svg%3E");
}

code, pre, .mono {
  font-family: var(--font-mono);
}

/* ────────────────────────────────────────────────────────────────
   HEADER
   ──────────────────────────────────────────────────────────────── */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--background);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
  transition: background-color 0.3s ease;
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-family: var(--font-serif);
  font-size: 1.65rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  color: var(--foreground);
  text-decoration: none;
  display: flex;
  align-items: baseline;
  gap: 0.25rem;
}

.logo-dot {
  color: var(--gold);
}

nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}

nav a {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--muted-foreground);
  text-decoration: none;
  transition: color 0.2s;
}

nav a:hover {
  color: var(--primary);
}

/* ────────────────────────────────────────────────────────────────
   THEME SWITCH
   Pill toggle with sunrise / sunset icon animation.
   Mirrors the shadcn Switch + theme-toggle.tsx visual and logic.
   ──────────────────────────────────────────────────────────────── */
.theme-switch-wrap {
  display: flex;
  align-items: center;
  gap: 9px;
}

.theme-switch-label {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  color: var(--muted-foreground);
  letter-spacing: 0.06em;
  user-select: none;
  min-width: 38px;
  text-align: right;
  transition: color 0.3s;
}

/* Switch track */
.theme-switch-btn {
  position: relative;
  width: 48px;
  height: 26px;
  border-radius: 9999px;
  border: 1px solid var(--border);
  background: var(--input);
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: background 0.3s ease, border-color 0.3s ease;
  overflow: hidden;
}

.theme-switch-btn[aria-checked="true"] {
  background: var(--primary);
  border-color: var(--primary);
}

.theme-switch-btn:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

/* Horizon glow layer */
.switch-horizon {
  position: absolute;
  inset: 0;
  border-radius: 9999px;
  background: radial-gradient(ellipse at 50% 100%,
    oklch(0.82 0.18 55 / 0.0) 0%,
    oklch(0.82 0.18 55 / 0.0) 100%);
  transition: none;
  pointer-events: none;
}

/* Sliding thumb */
.switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--background);
  transition: transform 0.28s cubic-bezier(0.34, 1.20, 0.64, 1),
              background 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  z-index: 2;
}

.theme-switch-btn[aria-checked="true"] .switch-thumb {
  transform: translateX(22px);
}

/* Icon slot */
.icon-slot {
  position: relative;
  width: 11px;
  height: 11px;
  overflow: visible;
}

/* Sun and moon icons */
.icon-sun,
.icon-moon {
  position: absolute;
  inset: 0;
  width: 11px;
  height: 11px;
  color: var(--primary);
  will-change: transform, opacity;
}

.icon-sun  { opacity: 1; transform: translateY(0); }
.icon-moon { opacity: 0; transform: translateY(10px); }

.theme-switch-btn[aria-checked="true"] .icon-sun  {
  opacity: 0;
  transform: translateY(-10px);
}
.theme-switch-btn[aria-checked="true"] .icon-moon {
  opacity: 1;
  transform: translateY(0);
  color: var(--primary-foreground);
}

/* ── Sunrise / sunset keyframes ── */
@keyframes sunSet {
  0%   { transform: translateY(0);    opacity: 1;   }
  60%  { transform: translateY(5px);  opacity: 0.5; }
  100% { transform: translateY(10px); opacity: 0;   }
}

@keyframes moonRise {
  0%   { transform: translateY(10px); opacity: 0;   }
  40%  { transform: translateY(5px);  opacity: 0.5; }
  100% { transform: translateY(0);    opacity: 1;   }
}

@keyframes moonSet {
  0%   { transform: translateY(0);     opacity: 1;   }
  60%  { transform: translateY(-5px);  opacity: 0.5; }
  100% { transform: translateY(-10px); opacity: 0;   }
}

@keyframes sunRise {
  0%   { transform: translateY(-10px); opacity: 0;   }
  40%  { transform: translateY(-5px);  opacity: 0.5; }
  100% { transform: translateY(0);     opacity: 1;   }
}

@keyframes horizonFlash {
  0%   { background: radial-gradient(ellipse at 50% 100%, oklch(0.82 0.20 52 / 0.00) 0%, oklch(0.82 0.20 52 / 0.00) 100%); }
  30%  { background: radial-gradient(ellipse at 50% 100%, oklch(0.82 0.20 52 / 0.55) 0%, oklch(0.75 0.15 60 / 0.20) 60%, oklch(0.70 0.10 65 / 0.00) 100%); }
  65%  { background: radial-gradient(ellipse at 50% 100%, oklch(0.85 0.18 58 / 0.40) 0%, oklch(0.80 0.12 65 / 0.15) 60%, oklch(0.70 0.08 70 / 0.00) 100%); }
  100% { background: radial-gradient(ellipse at 50% 100%, oklch(0.82 0.20 52 / 0.00) 0%, oklch(0.82 0.20 52 / 0.00) 100%); }
}

@keyframes thumbGlow {
  0%   { box-shadow: 0 0 0 0px oklch(0.78 0.18 55 / 0.00); }
  35%  { box-shadow: 0 0 0 4px oklch(0.78 0.18 55 / 0.45); }
  70%  { box-shadow: 0 0 0 3px oklch(0.80 0.14 62 / 0.28); }
  100% { box-shadow: 0 0 0 0px oklch(0.78 0.18 55 / 0.00); }
}

/* Animation trigger classes (added / removed via JS) */
.anim-sun-set    { animation: sunSet        0.35s ease forwards !important; }
.anim-sun-rise   { animation: sunRise       0.35s ease forwards !important; }
.anim-moon-set   { animation: moonSet       0.35s ease forwards !important; }
.anim-moon-rise  { animation: moonRise      0.35s ease forwards !important; }
.anim-horizon    { animation: horizonFlash  0.55s ease forwards !important; }
.anim-thumb-glow { animation: thumbGlow     0.55s ease forwards !important; }

/* View transition — Safari fix (BookShelf known-issues) */
@supports (view-transition-name: none) {
  ::view-transition-old(root),
  ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
  ::view-transition-old(root)      { z-index: 1; }
  ::view-transition-new(root)      { z-index: 9999; }
  .dark::view-transition-old(root) { z-index: 9999; }
  .dark::view-transition-new(root) { z-index: 1; }
}

/* ────────────────────────────────────────────────────────────────
   HERO
   ──────────────────────────────────────────────────────────────── */
.hero {
  max-width: 922px;
  margin: 0 auto;
  padding: 5rem 2rem 4rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

/* Alternativ 1 — ge logo-kolumnen mer utrymme */
/*.hero {*/
/*  grid-template-columns: 1fr 1.4fr;  !* logo-sidan får 58% av bredden *!*/
/*}*/

/* Alternativ 2 — återställ hero-bredden*/
/*.hero {*/
/*  max-width: 1100px;  !* som originalet — mer luft åt båda kolumnerna *!*/
/*}*/

/* Alternativ 3 — kombinera: bredare hero + fetare logo-kolumn */
/*.hero {*/
/*  max-width: 1100px;*/
/*  grid-template-columns: 1fr 1.3fr;*/
/*}*/

@media (max-width: 760px) {
  .hero {
    grid-template-columns: 1fr;
    padding: 3rem 1.5rem;
    gap: 2.5rem;
  }
  .hero-visual {
    order: -1;
    width: 100%;
    max-width: 340px;
    margin: 0 auto;
  }
  .hero-logo {
    width: 100%;
    max-width: 340px;
  }
  .nav-hide {
    display: none;
  }
}

.hero-text h1 {
  font-family: var(--font-serif);
  font-size: clamp(2.5rem, 5vw, 3.9rem);
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: 0.01em;
  margin-bottom: 1.2rem;
  color: var(--foreground);
}

.hero-text h1 em {
  font-style: italic;
  color: var(--accent-warm);
}

.hero-text p {
  font-size: 1rem;
  color: var(--muted-foreground);
  line-height: 1.82;
  max-width: 44ch;
  margin-bottom: 2rem;
}

.hero-cta {
  display: inline-block;
  padding: 0.6rem 2rem;
  border: 1px solid var(--primary);
  color: var(--primary);
  font-family: var(--font-sans);
  font-size: 0.78rem;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: calc(var(--radius) * 0.4);
  transition: background 0.22s, color 0.22s;
}

.hero-cta:hover {
  background: var(--primary);
  color: var(--primary-foreground);
}

/* ────────────────────────────────────────────────────────────────
   SHARED SECTION UTILITIES
   ──────────────────────────────────────────────────────────────── */
section {
  padding: 5rem 2rem;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
}

.section-label {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.6rem;
}

.section-title {
  font-family: var(--font-serif);
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  font-weight: 400;
  line-height: 1.18;
  color: var(--foreground);
  margin-bottom: 1rem;
}

.section-intro {
  font-size: 0.97rem;
  color: var(--muted-foreground);
  max-width: 60ch;
  line-height: 1.82;
  margin-bottom: 3rem;
}

.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0;
}

.ornament {
  text-align: center;
  color: var(--gold);
  font-size: 1.05rem;
  letter-spacing: 0.4em;
  margin: 1.5rem 0;
  opacity: 0.7;
}

/* ────────────────────────────────────────────────────────────────
   SERVICES
   ──────────────────────────────────────────────────────────────── */
.services-bg {
  background: var(--card);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  transition: background-color 0.3s ease;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
}

@media (max-width: 900px) {
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }
}

@media (max-width: 520px) {
  .services-grid {
    grid-template-columns: 1fr;
    gap: 1.8rem;
  }
}

.service-card {
  padding: 2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--background);
  position: relative;
  transition: border-color 0.2s, background 0.3s;
}

.service-card:hover {
  border-color: var(--ring);
}

.service-icon {
  width: 36px;
  height: 36px;
  margin-bottom: 1rem;
  color: var(--gold);
}

.service-card h3 {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 400;
  margin-bottom: 0.6rem;
  color: var(--foreground);
}

.service-card p {
  font-size: 0.88rem;
  color: var(--muted-foreground);
  line-height: 1.75;
}

.service-number {
  position: absolute;
  top: 1.2rem;
  right: 1.5rem;
  font-family: var(--font-serif);
  font-size: 2.4rem;
  font-weight: 400;
  color: var(--border);
  line-height: 1;
  user-select: none;
}

/* ────────────────────────────────────────────────────────────────
   ABOUT
   ──────────────────────────────────────────────────────────────── */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5rem;
  align-items: start;
}

@media (max-width: 760px) {
  .about-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
}

.about-text p {
  font-size: 0.97rem;
  color: var(--muted-foreground);
  margin-bottom: 1.2rem;
  line-height: 1.82;
}

.about-text p:last-child {
  margin-bottom: 0;
}

.about-text strong {
  color: var(--foreground);
  font-weight: 700;
}

.pull-quote {
  border-left: 2px solid var(--gold);
  padding-left: 1.5rem;
  margin: 2.5rem 0;
  font-family: var(--font-serif);
  font-size: 1.28rem;
  font-style: italic;
  color: var(--accent-warm);
  line-height: 1.52;
}

.about-details {
  border-top: 1px solid var(--border);
  padding-top: 2rem;
}

.about-details h3 {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: var(--muted-foreground);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
}

.detail-row .key {
  color: var(--muted-foreground);
  letter-spacing: 0.04em;
}

.detail-row .val {
  color: var(--foreground);
  font-family: var(--font-serif);
  font-size: 0.97rem;
}

/* ────────────────────────────────────────────────────────────────
   CONTACT
   ──────────────────────────────────────────────────────────────── */
.contact-bg {
  background: var(--card);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  transition: background-color 0.3s ease;
}

.contact-inner {
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
}

.contact-inner .section-intro {
  margin: 0 auto 2rem;
}

.contact-link {
  display: inline-block;
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 400;
  color: var(--primary);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  transition: color 0.2s, border-color 0.2s;
}

.contact-link:hover {
  color: var(--ring);
  border-color: var(--primary);
}

/* ────────────────────────────────────────────────────────────────
   FOOTER
   ──────────────────────────────────────────────────────────────── */
footer {
  padding: 3rem 2rem;
  text-align: center;
}

.footer-logo {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: var(--muted-foreground);
  margin-bottom: 0.8rem;
}

.footer-sub {
  font-size: 0.78rem;
  color: var(--muted-foreground);
  opacity: 0.7;
  letter-spacing: 0.04em;
}

/* ────────────────────────────────────────────────────────────────
   COOKIE NOTICE
   Auto-matches theme via CSS variables.
   ──────────────────────────────────────────────────────────────── */
.cookie-notice {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 1000;
  max-width: 340px;
  background: var(--popover);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem 1.4rem;
  transition: opacity 0.4s ease, transform 0.4s ease, background 0.3s;
}

.cookie-notice.hidden {
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
}

.cookie-notice p {
  font-size: 0.84rem;
  color: var(--muted-foreground);
  line-height: 1.62;
  margin-bottom: 0.9rem;
}

.cookie-notice p em {
  font-style: italic;
  color: var(--accent-warm);
}

.cookie-dismiss {
  background: var(--primary);
  color: var(--primary-foreground);
  border: none;
  padding: 0.42rem 1.2rem;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  border-radius: calc(var(--radius) * 0.6);
  cursor: pointer;
  transition: opacity 0.2s;
}

.cookie-dismiss:hover {
  opacity: 0.86;
}

/* ────────────────────────────────────────────────────────────────
   ANIMATIONS
   ──────────────────────────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0); }
}

.anim    { animation: fadeUp 0.7s ease both; }
.anim-d1 { animation-delay: 0.10s; }
.anim-d2 { animation-delay: 0.25s; }
.anim-d3 { animation-delay: 0.42s; }

@media (max-width: 480px) {
  section { padding: 3.5rem 1.5rem; }
  .cookie-notice { right: 1rem; left: 1rem; max-width: none; }
}
