/* ============================================================================
   Chalet Badacsony — design system stylesheet
   Implements build-specs/02-design-system.md verbatim where measurable.
   ----------------------------------------------------------------------------
   Sections
     1. Tokens (colors, type, spacing, motion)
     2. Reset + base
     3. Containers + utility
     4. Header + language pills
     5. Hero mosaic
     6. Welcome block + buttons
     7. Pull quote band
     8. Footer
     9. Guide hero + layout + ToC + content
    10. Login card
    11. Callouts
    12. Motion + reduced-motion + dark mode
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */
:root {
  /* Primary — terracotta */
  --c-terracotta-600: #B8552E;
  --c-terracotta-700: #8E3E1F;
  --c-terracotta-50:  #FBEFE8;

  /* Secondary — lake */
  --c-lake-600: #3F7A86;
  --c-lake-50:  #E8F0F2;

  /* Accent — reed */
  --c-reed-500: #C9A961;

  /* Ink */
  --c-ink-900: #1F1A17;
  --c-ink-700: #34302C;
  --c-ink-600: #5C544E;
  --c-ink-400: #9A938C;

  /* Light surfaces */
  --c-stone-50:  #F7F4EF;
  --c-stone-100: #EFEAE2;
  --c-stone-200: #E2DCD2;

  /* Dark surfaces */
  --c-basalt-900: #161310;
  --c-basalt-800: #221E1A;
  --c-basalt-700: #2C2823;

  /* Semantic */
  --c-success: #4F7A4A;
  --c-warning: #C68A2A;
  --c-error:   #A8362B;

  /* Active surface assignments (light) */
  --bg:        var(--c-stone-50);
  --bg-elev:   var(--c-stone-100);
  --bg-card:   #fff;
  --fg:        var(--c-ink-900);
  --fg-muted:  var(--c-ink-600);
  --fg-faint:  var(--c-ink-400);
  --hairline:  var(--c-stone-200);

  /* Type */
  --ff-display: "Fraunces", "Iowan Old Style", "Apple Garamond", Georgia, serif;
  --ff-body:    "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --fs-display: 3.0rem;
  --fs-h1:      2.25rem;
  --fs-h2:      1.75rem;
  --fs-h3:      1.375rem;
  --fs-h4:      1.125rem;
  --fs-body-lg: 1.125rem;
  --fs-body:    1rem;
  --fs-small:   0.875rem;
  --fs-xs:      0.75rem;

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;
  --space-9: 6rem;
  --space-10: 8rem;

  --container-prose: 38rem;
  --container-wide:  72rem;
  --gutter: var(--space-4);

  /* Radius */
  --radius-xs: 2px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-pill: 999px;

  /* Shadow */
  --shadow-xs: 0 1px 2px rgba(31,26,23,.06);
  --shadow-sm: 0 2px 6px rgba(31,26,23,.08);
  --shadow-md: 0 8px 20px -6px rgba(31,26,23,.14);
  --shadow-lg: 0 20px 40px -12px rgba(31,26,23,.22);

  /* Borders */
  --border-hairline: 1px solid var(--hairline);

  /* Motion */
  --ease-out:    cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0,    0.35, 1);
  --dur-fast: 160ms;
  --dur-base: 280ms;
  --dur-slow: 520ms;
  --dur-ken-burns: 14s;

  --z-header:   50;
  --z-language: 60;
  --z-overlay:  100;

  --scroll: 0; /* parallax driver */
}

@media (min-width: 1024px) {
  :root {
    --gutter: var(--space-6);
    --fs-display: 3.75rem;
    --fs-h1:      2.7rem;
    --fs-h2:      2.1rem;
  }
}

/* --------------------------------------------------------------------------
   2. Reset + base
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--ff-body);
  font-size: var(--fs-body);
  line-height: 1.65;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-wrap: break-word;
}

img, picture, svg { display: block; max-width: 100%; }

h1, h2, h3, h4 {
  font-family: var(--ff-display);
  font-weight: 500;
  letter-spacing: -0.01em;
  margin: 0;
  text-wrap: balance;
  hyphens: auto;
}

p { margin: 0 0 var(--space-4) 0; }

a {
  color: var(--c-terracotta-700);
  text-decoration: underline;
  text-decoration-color: color-mix(in oklab, var(--c-terracotta-700) 45%, transparent);
  text-underline-offset: 3px;
  transition: color var(--dur-fast) var(--ease-out),
              text-decoration-color var(--dur-fast) var(--ease-out);
}
a:hover { color: var(--c-terracotta-600); text-decoration-color: currentColor; }

button { font: inherit; cursor: pointer; }

:focus-visible {
  outline: 2px solid var(--c-terracotta-600);
  outline-offset: 2px;
  border-radius: 2px;
}

::selection {
  background: color-mix(in oklab, var(--c-reed-500) 70%, transparent);
  color: var(--c-ink-900);
}

.skip-link {
  position: absolute;
  left: var(--space-3);
  top: var(--space-3);
  z-index: 200;
  padding: var(--space-2) var(--space-4);
  background: var(--c-ink-900);
  color: var(--c-stone-50);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transform: translateY(-150%);
  transition: transform var(--dur-fast) var(--ease-out);
}
.skip-link:focus { transform: translateY(0); }

/* --------------------------------------------------------------------------
   3. Container + utility
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container-wide);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.eyebrow {
  display: inline-block;
  font-family: var(--ff-body);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--c-terracotta-700);
}
.eyebrow--on-photo { color: var(--c-stone-50); }

/* --------------------------------------------------------------------------
   4. Header + language switcher
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  background: transparent;
  transition: background-color var(--dur-base) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out),
              color var(--dur-base) var(--ease-out);
  color: var(--c-stone-50);
}
.site-header[data-elevate="true"],
.site-header[data-solid="true"] {
  background: color-mix(in oklab, var(--bg) 92%, transparent);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  backdrop-filter: saturate(140%) blur(10px);
  box-shadow: var(--shadow-xs);
  color: var(--fg);
}
.page-guide .site-header,
.page-login .site-header {
  background: var(--bg);
  color: var(--fg);
  box-shadow: var(--shadow-xs);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: inherit;
  text-decoration: none;
  font-family: var(--ff-display);
  font-weight: 500;
  font-size: 1.125rem;
  letter-spacing: -0.005em;
}
.brand__mark { display: inline-flex; color: inherit; }
.brand__text { white-space: nowrap; }
/* Free up header room on phones — the home icon is enough to indicate brand. */
@media (max-width: 540px) {
  .brand__text { display: none; }
}

/* ----- primary nav (Útmutató, WIFI) ----- */
.site-nav {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  margin-right: auto;
  margin-left: var(--space-3);
}
.nav-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 32px;
  padding: 0 var(--space-3);
  border-radius: var(--radius-pill);
  font-family: var(--ff-body);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  color: color-mix(in oklab, currentColor 78%, transparent);
  transition: background-color var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out);
  white-space: nowrap;
}
.nav-pill:hover {
  background: color-mix(in oklab, currentColor 10%, transparent);
  color: currentColor;
}
.nav-pill--active {
  background: var(--c-terracotta-600);
  color: #fff;
}
.nav-pill__icon { flex-shrink: 0; }
@media (max-width: 380px) {
  .nav-pill { padding: 0 10px; }
  .site-nav { gap: 2px; margin-left: var(--space-2); }
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: transparent;
  border-radius: var(--radius-pill);
  padding: 2px;
}
.lang-switch--center { justify-content: center; }

.lang-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 32px;
  padding: 0 var(--space-3);
  border-radius: var(--radius-pill);
  font-family: var(--ff-body);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  color: color-mix(in oklab, currentColor 80%, transparent);
  transition: background-color var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out);
}
.lang-pill::before {
  content: "";
  position: absolute;
  inset: -8px;
}
.lang-pill:hover {
  background: color-mix(in oklab, currentColor 12%, transparent);
  color: currentColor;
}
.lang-pill--active {
  background: var(--c-stone-50);
  color: var(--c-ink-900);
}
.site-header[data-elevate="true"] .lang-pill--active,
.site-header[data-solid="true"] .lang-pill--active,
.page-guide .lang-pill--active,
.page-login .lang-pill--active {
  background: var(--c-ink-900);
  color: var(--c-stone-50);
}
.lang-pill--on-light {
  color: var(--c-ink-600);
}
.lang-pill--on-light.lang-pill--active {
  background: var(--c-ink-900);
  color: var(--c-stone-50);
}

/* --------------------------------------------------------------------------
   5. Hero mosaic
   -------------------------------------------------------------------------- */
.home { display: block; }

.mosaic {
  display: grid;
  gap: 4px;
  grid-template-columns: 1fr 1fr;
  margin: 0;
  padding: 0;
}

/* Pull header off the top of the hero on mobile so it floats */
.site-header { margin-bottom: -64px; }

.tile {
  position: relative;
  margin: 0;
  overflow: hidden;
  background-color: var(--c-stone-200);
}
.tile picture, .tile__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.tile__img {
  transition: transform 520ms var(--ease-out);
}
@media (hover: hover) {
  .tile:hover .tile__img:not(.tile__img--ken-burns) {
    transform: scale(1.03);
  }
}

/* Aspect-ratio for mobile */
.tile--a { grid-column: 1 / -1; aspect-ratio: 16 / 11; }
.tile--b { aspect-ratio: 4 / 5; }
.tile--c { aspect-ratio: 4 / 5; }
.tile--d { grid-column: 1 / -1; aspect-ratio: 16 / 9; }
.tile--e { aspect-ratio: 3 / 4; }
.tile--f { aspect-ratio: 3 / 4; }
.tile--g { grid-column: 1 / -1; aspect-ratio: 16 / 9; }
.tile--h { grid-column: 1 / -1; aspect-ratio: 16 / 9; }
.tile--i { grid-column: 1 / -1; aspect-ratio: 16 / 9; }
.tile--j { grid-column: 1 / -1; aspect-ratio: 4 / 5; }

/* Hero overlay */
.tile--a .tile__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  padding: var(--space-5);
  margin: 0;
  background: linear-gradient(to top,
    rgba(22,19,16,0.55) 0%,
    rgba(22,19,16,0.25) 35%,
    rgba(22,19,16,0) 70%);
  color: var(--c-stone-50);
}
.tile--a .tile__overlay-inner {
  max-width: 36ch;
}
.display {
  font-family: var(--ff-display);
  font-size: var(--fs-display);
  line-height: 1.05;
  font-weight: 400;
  font-variation-settings: "opsz" 96;
  letter-spacing: -0.015em;
  margin: 0 0 var(--space-3);
  color: inherit;
}
.display__rule {
  display: block;
  width: 48px;
  height: 2px;
  background: var(--c-reed-500);
  margin-bottom: var(--space-3);
  border-radius: 2px;
}
.display__tagline {
  font-family: var(--ff-display);
  font-style: italic;
  font-size: 1.25rem;
  line-height: 1.4;
  color: inherit;
  opacity: 0.95;
  margin: 0;
}

/* Welcome inline block (mobile) */
.welcome {
  grid-column: 1 / -1;
  background: var(--bg);
  padding: var(--space-7) var(--gutter);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.welcome__title {
  font-size: var(--fs-h1);
  line-height: 1.1;
  margin: var(--space-1) 0 var(--space-2);
}
.welcome__lead {
  font-size: var(--fs-body-lg);
  line-height: 1.6;
  color: var(--fg-muted);
  max-width: 38ch;
  margin: 0 0 var(--space-3);
}
.welcome__cta { margin: var(--space-2) 0 0; }

/* Pull quote band (mobile) */
.pull-quote {
  grid-column: 1 / -1;
  background: var(--bg);
  padding: var(--space-8) var(--gutter);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  position: relative;
}
.pull-quote::before, .pull-quote::after {
  content: "";
  width: 56px;
  height: 1px;
  background: var(--c-reed-500);
  margin: var(--space-3) 0;
}
.pull-quote p {
  font-family: var(--ff-display);
  font-style: italic;
  font-size: 1.5rem;
  line-height: 1.4;
  color: var(--c-ink-900);
  max-width: 28ch;
  margin: 0;
}
.pull-quote cite {
  font-family: var(--ff-body);
  font-style: normal;
  font-size: var(--fs-xs);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

/* Desktop: CSS Grid mosaic */
@media (min-width: 1024px) {
  .site-header { margin-bottom: 0; }

  .mosaic {
    max-width: var(--container-wide);
    margin: 0 auto;
    padding: var(--space-5) var(--gutter) 0;
    grid-template-columns: repeat(12, 1fr);
    grid-template-rows: auto auto auto auto auto;
    gap: var(--space-3);
  }
  .tile--a {
    grid-column: 1 / 9;
    grid-row: 1;
    aspect-ratio: 16 / 10;
  }
  .tile--b {
    grid-column: 9 / 13;
    grid-row: 1;
    aspect-ratio: auto;
  }
  /* Stack b above c in the right column of row 1 */
  .tile--b { grid-row: 1; }
  .tile--c { grid-column: 9 / 13; grid-row: 1; align-self: end; aspect-ratio: auto; display: none; }
  /* Simpler: split into two rows */
  .tile--a { grid-row: 1 / 3; aspect-ratio: 16 / 10; }
  .tile--b { grid-row: 1; aspect-ratio: 4 / 3; }
  .tile--c { grid-row: 2; display: block; aspect-ratio: 4 / 3; }

  .tile--d { grid-column: 1 / 6; grid-row: 3; aspect-ratio: 4 / 3; }
  .welcome {
    grid-column: 6 / 13;
    grid-row: 3;
    padding: var(--space-6) var(--space-6);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xs);
    justify-content: center;
  }

  .tile--e { grid-column: 1 / 4; grid-row: 4; aspect-ratio: auto; height: 280px; }
  .tile--f { grid-column: 4 / 7; grid-row: 4; aspect-ratio: auto; height: 280px; }
  .tile--g { grid-column: 7 / 10; grid-row: 4; aspect-ratio: auto; height: 280px; }
  .tile--h { grid-column: 10 / 13; grid-row: 4; aspect-ratio: auto; height: 280px; }

  .pull-quote {
    grid-column: 1 / 13;
    grid-row: 5;
    padding: var(--space-7) var(--space-8);
    background: transparent;
  }
  .pull-quote p { font-size: 2rem; max-width: 36ch; }

  .tile--i { grid-column: 1 / 9; grid-row: 6; aspect-ratio: 16 / 9; }
  .tile--j { grid-column: 9 / 13; grid-row: 6; aspect-ratio: 4 / 5; }

  .mosaic { padding-bottom: var(--space-9); }

  .tile { border-radius: var(--radius-md); }
}

/* Parallax (desktop only). The driver var --scroll is updated by JS. */
@media (min-width: 1024px) and (prefers-reduced-motion: no-preference) {
  .tile[data-parallax] .tile__img {
    transform: translate3d(0, calc(var(--scroll) * 1px * (var(--p, -8) / 100)), 0);
    transition: transform 0s linear;
  }
  .tile--e .tile__img { --p: -4; }
  .tile--f .tile__img { --p: -8; }
  .tile--g .tile__img { --p: -12; }
  .tile--h .tile__img { --p: -8; }
}

/* --------------------------------------------------------------------------
   6. Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: var(--ff-body);
  font-size: var(--fs-body);
  font-weight: 600;
  line-height: 1;
  padding: 14px var(--space-5);
  min-height: 48px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  text-decoration: none;
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out),
              background-color var(--dur-fast) var(--ease-out);
}
.btn--block { width: 100%; }

.btn--primary {
  background: var(--c-terracotta-600);
  color: #fff;
  box-shadow: var(--shadow-xs);
}
.btn--primary:hover {
  background: var(--c-terracotta-700);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  color: #fff;
  text-decoration: none;
}
.btn--primary:active { transform: translateY(0); }

/* --------------------------------------------------------------------------
   8. Footer
   -------------------------------------------------------------------------- */
.site-footer {
  border-top: var(--border-hairline);
  padding: var(--space-7) 0 var(--space-8);
  margin-top: var(--space-7);
  background: var(--bg);
}
.site-footer__inner {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  align-items: center;
  text-align: center;
}
.site-footer__row {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--fs-small);
  margin: 0;
  color: var(--fg);
}
.site-footer__sep { color: var(--fg-faint); }
.site-footer__copy {
  font-size: var(--fs-xs);
  color: var(--fg-muted);
  margin: 0;
  letter-spacing: 0.02em;
}

/* --------------------------------------------------------------------------
   9. Guide page
   -------------------------------------------------------------------------- */
.guide-hero {
  position: relative;
  margin: 0;
  padding: 0;
  background: var(--c-basalt-900);
  color: var(--c-stone-50);
  overflow: hidden;
}
.guide-hero picture { display: block; }
.guide-hero__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  /* Taller on mobile so overlaid title clears the sticky header. */
  aspect-ratio: 4 / 5;
}
.guide-hero__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  /* Top padding reserves room under the 64px sticky header. */
  padding: calc(64px + var(--space-5)) 0 var(--space-6);
  background: linear-gradient(to bottom,
    rgba(22,19,16,0.62) 0%,
    rgba(22,19,16,0.15) 32%,
    rgba(22,19,16,0) 55%,
    rgba(22,19,16,0.78) 100%);
}
.guide-hero__overlay > .container {
  width: 100%;
}
/* The eyebrow repeats the site name already shown in the header — hide on
   mobile to give the title and subtitle breathing room. */
.guide-hero .eyebrow--on-photo { display: none; }
.guide-hero__title {
  font-size: clamp(2rem, 8vw, 2.6rem);
  line-height: 1.1;
  margin: 0 0 var(--space-2);
  text-shadow: 0 2px 12px rgba(22,19,16,0.55);
}
.guide-hero__subtitle {
  font-family: var(--ff-display);
  font-style: italic;
  font-size: 1.0625rem;
  color: var(--c-stone-50);
  opacity: 0.95;
  margin: 0;
  max-width: 38ch;
  text-shadow: 0 1px 8px rgba(22,19,16,0.5);
}

@media (min-width: 640px) {
  .guide-hero__img { aspect-ratio: 16 / 9; }
  .guide-hero .eyebrow--on-photo { display: inline-block; }
}
@media (min-width: 1024px) {
  .guide-hero__img { aspect-ratio: 21 / 8; max-height: 460px; }
  .guide-hero__overlay { padding: var(--space-7) 0 var(--space-6); }
  .guide-hero__overlay { background: linear-gradient(to right,
    rgba(22,19,16,0.55) 0%,
    rgba(22,19,16,0.35) 40%,
    rgba(22,19,16,0) 100%); }
  .guide-hero__title { font-size: clamp(2.4rem, 4vw, 3.2rem); }
}

/* ----- WIFI block (rendered server-side from .env at request time) ----- */
.wifi-block {
  margin: var(--space-6) 0;
  padding: var(--space-5) var(--space-5);
  background: var(--c-lake-50);
  border-left: 4px solid var(--c-lake-600);
  border-radius: var(--radius-md);
  display: grid;
  gap: var(--space-3);
  align-items: center;
}
.wifi-block__heading {
  margin: 0;
  font-family: var(--ff-display);
  font-size: 1.5rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--c-lake-600);
}
.wifi-block__creds {
  display: grid;
  grid-template-columns: max-content 1fr;
  column-gap: var(--space-4);
  row-gap: var(--space-2);
  margin: 0;
}
.wifi-block__creds dt {
  font-size: var(--fs-small);
  color: var(--c-ink-600);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  align-self: center;
}
.wifi-block__creds dd {
  margin: 0;
  font-size: 1.0625rem;
  color: var(--c-ink-900);
  word-break: break-all;
}
.wifi-block__creds code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  background: rgba(255,255,255,0.6);
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  font-size: 1rem;
}
.wifi-block .wifi-qr {
  display: block;
  width: 200px;
  height: 200px;
  background: #fff;
  padding: var(--space-3);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
  image-rendering: pixelated;
  justify-self: center;
}
.wifi-block__copy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: start;
  padding: 10px 16px;
  min-height: 44px;
  background: var(--c-lake-600);
  color: #fff;
  border: 0;
  border-radius: var(--radius-sm);
  font-family: var(--ff-body);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-out),
              transform var(--dur-fast) var(--ease-out);
  justify-self: start;
  -webkit-tap-highlight-color: transparent;
}
.wifi-block__copy:hover { background: color-mix(in oklab, var(--c-lake-600) 88%, black); }
.wifi-block__copy:active { transform: translateY(1px); }
.wifi-block__copy[data-state="copied"] { background: var(--c-success); }
.wifi-block__copy svg { flex-shrink: 0; }
.wifi-block__hint {
  margin: 0;
  font-size: var(--fs-small);
  color: var(--c-ink-600);
  text-align: center;
  max-width: 40ch;
  justify-self: center;
}
@media (min-width: 640px) {
  .wifi-block {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "heading qr"
      "creds   qr"
      "hint    qr";
    column-gap: var(--space-6);
    padding: var(--space-6);
  }
  .wifi-block {
    grid-template-areas:
      "heading qr"
      "creds   qr"
      "copy    qr"
      "hint    qr";
  }
  .wifi-block__heading { grid-area: heading; }
  .wifi-block__creds   { grid-area: creds; }
  .wifi-block__copy    { grid-area: copy; }
  .wifi-block .wifi-qr { grid-area: qr; align-self: center; }
  .wifi-block__hint    { grid-area: hint; text-align: left; justify-self: start; }
}
.guide-signoff {
  font-family: var(--ff-display);
  font-style: italic;
  font-size: var(--fs-body-lg);
  color: var(--c-ink-600);
  text-align: center;
  margin: var(--space-6) 0;
}

.guide-layout {
  display: block;
  padding-top: var(--space-7);
  padding-bottom: var(--space-9);
}

@media (min-width: 1024px) {
  .guide-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: var(--space-7);
    align-items: start;
  }
}

.guide-toc {
  position: relative;
  margin-bottom: var(--space-5);
}
@media (min-width: 1024px) {
  .guide-toc {
    position: sticky;
    top: 96px;
    margin-bottom: 0;
  }
}
.guide-toc__details {
  border: var(--border-hairline);
  border-radius: var(--radius-sm);
  padding: var(--space-3) var(--space-4);
  background: var(--bg-card);
}
.guide-toc__details summary {
  font-family: var(--ff-body);
  font-weight: 600;
  font-size: var(--fs-small);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  color: var(--fg-muted);
  list-style: none;
}
.guide-toc__details summary::-webkit-details-marker { display: none; }
.guide-toc__details summary::after {
  content: "▾";
  float: right;
  transition: transform var(--dur-fast) var(--ease-out);
}
.guide-toc__details[open] summary::after { transform: rotate(180deg); }

@media (min-width: 1024px) {
  .guide-toc__details {
    border: none;
    padding: 0;
    background: transparent;
  }
  .guide-toc__details summary { margin-bottom: var(--space-3); }
  .guide-toc__details summary::after { display: none; }
  .guide-toc__details[open] summary { pointer-events: none; }
}

.guide-toc__nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: var(--space-3);
}
.guide-toc__nav a {
  display: block;
  padding: var(--space-2) var(--space-3);
  font-size: var(--fs-small);
  line-height: 1.35;
  color: var(--fg-muted);
  text-decoration: none;
  border-left: 2px solid transparent;
  margin-left: -2px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  transition: color var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out),
              background-color var(--dur-fast) var(--ease-out);
}
.guide-toc__nav a:hover {
  background: var(--c-stone-100);
  color: var(--fg);
}
.guide-toc__nav a.is-active {
  border-left-color: var(--c-terracotta-600);
  color: var(--c-ink-900);
  font-weight: 600;
}

.guide-toc__logout {
  margin: var(--space-5) 0 0;
  padding-top: var(--space-3);
  border-top: var(--border-hairline);
}
.link-btn {
  background: transparent;
  border: 0;
  color: var(--c-terracotta-700);
  font-size: var(--fs-small);
  font-weight: 600;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.guide-content {
  max-width: var(--container-prose);
  margin: 0 auto;
  font-size: var(--fs-body-lg);
}
@media (min-width: 1024px) {
  .guide-content { margin: 0; }
}

.guide-content h1 {
  font: 500 var(--fs-h1)/1.1 var(--ff-display);
  margin: var(--space-7) 0 var(--space-4);
}
.guide-content h2 {
  font: 500 var(--fs-h2)/1.2 var(--ff-display);
  margin: var(--space-7) 0 var(--space-3);
  padding-top: var(--space-5);
  border-top: var(--border-hairline);
  scroll-margin-top: 96px;
  color: var(--c-ink-900);
}
.guide-content h3 {
  font: 600 var(--fs-h3)/1.3 var(--ff-body);
  margin: var(--space-5) 0 var(--space-2);
}
.guide-content p {
  font-size: var(--fs-body-lg);
  line-height: 1.6;
  margin: 0 0 var(--space-4);
  max-width: 65ch;
  color: var(--c-ink-700);
}
.guide-content .guide-lead {
  font-family: var(--ff-display);
  font-style: italic;
  font-size: 1.5rem;
  line-height: 1.4;
  color: var(--c-ink-900);
  max-width: 32ch;
  margin: 0 0 var(--space-6);
}
.guide-content ul,
.guide-content ol {
  padding-left: var(--space-5);
  margin: 0 0 var(--space-4);
}
.guide-content li {
  margin-bottom: var(--space-2);
  line-height: 1.55;
  color: var(--c-ink-700);
}
.guide-content li p { margin-bottom: var(--space-2); }
.guide-content figure {
  margin: var(--space-5) 0;
}
.guide-content figure img,
.guide-content img {
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
  display: block;
}
.guide-content .guide-gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-2);
  margin: var(--space-5) 0;
}
.guide-content .guide-gallery figure { margin: 0; }
.guide-content .guide-gallery img { margin: 0; border-radius: var(--radius-sm); }

.guide-content a {
  color: var(--c-terracotta-700);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.guide-content blockquote {
  border-left: 3px solid var(--c-reed-500);
  padding-left: var(--space-4);
  font: italic var(--fs-body-lg)/1.5 var(--ff-display);
  color: var(--c-ink-600);
  margin: var(--space-5) 0;
}

.guide-content__back {
  margin: var(--space-9) 0 0;
  padding-top: var(--space-5);
  border-top: var(--border-hairline);
  text-align: center;
  font-size: var(--fs-small);
  color: var(--fg-muted);
}
.guide-content__back a {
  color: var(--fg-muted);
  text-decoration: none;
}
.guide-content__back a:hover { color: var(--c-terracotta-700); }

/* --------------------------------------------------------------------------
   10. Login card
   -------------------------------------------------------------------------- */
.login-stage {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: var(--space-7) var(--gutter);
  position: relative;
  background: var(--bg);
  overflow: hidden;
}
.login-stage__bg {
  position: absolute;
  inset: 0;
  background-image: url("/static/img/hero/IMG_3746-1440.webp");
  background-size: cover;
  background-position: center;
  opacity: 0.25;
  z-index: 0;
  filter: saturate(1.05);
}
.login-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
    color-mix(in oklab, var(--bg) 30%, transparent),
    color-mix(in oklab, var(--bg) 78%, transparent));
  z-index: 1;
  pointer-events: none;
}

.login-card {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 380px;
  background: var(--c-stone-50);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: var(--space-7);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.login-card__brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
  font-family: var(--ff-display);
  font-size: 1.75rem;
  font-weight: 500;
  color: var(--c-ink-900);
  margin-bottom: var(--space-2);
}
.login-card__rule {
  display: block;
  width: 28px;
  height: 2px;
  background: var(--c-reed-500);
  border-radius: 2px;
  margin-bottom: var(--space-3);
}
.login-card__title {
  font-size: var(--fs-h2);
  line-height: 1.2;
  margin: 0;
}
.login-card__lead {
  font-size: var(--fs-small);
  color: var(--fg-muted);
  margin: 0 0 var(--space-3);
}
.login-card__label {
  font-size: var(--fs-small);
  font-weight: 600;
  color: var(--fg-muted);
  margin-bottom: -2px;
}
.login-card__input {
  height: 48px;
  padding: 0 var(--space-3);
  font: 400 var(--fs-body) "Inter", ui-monospace, "SFMono-Regular", Menlo, monospace;
  border: var(--border-hairline);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--c-ink-900);
  transition: border-color var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out);
}
.login-card__input:focus {
  outline: none;
  border-color: var(--c-terracotta-600);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--c-terracotta-600) 40%, transparent);
}
.login-card--error .login-card__input {
  border-color: var(--c-error);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--c-error) 30%, transparent);
}
.login-card__error {
  margin: 0;
  font-size: var(--fs-small);
  color: var(--c-error);
}
.login-card__submit { margin-top: var(--space-3); }

.login-card--error { animation: shake 280ms var(--ease-in-out); }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

/* --------------------------------------------------------------------------
   11. Callouts (used in guide content)
   -------------------------------------------------------------------------- */
.callout {
  background: var(--c-lake-50);
  border-left: 3px solid var(--c-lake-600);
  padding: var(--space-5) var(--space-5);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: var(--space-6) 0;
  display: block;
}
.callout-warning {
  background: color-mix(in oklab, var(--c-warning) 12%, var(--c-stone-50));
  border-left-color: var(--c-warning);
}
.callout-title {
  display: block;
  font-family: var(--ff-display);
  font-weight: 500;
  font-size: var(--fs-h3);
  margin: 0 0 var(--space-2);
  color: var(--c-ink-900);
}
.callout p { margin: 0 0 var(--space-3); color: var(--c-ink-700); }
.callout p:last-child { margin-bottom: 0; }
.callout figure { margin: var(--space-3) 0; }
.callout img { border-radius: var(--radius-sm); }

/* --------------------------------------------------------------------------
   11b. Standalone WIFI page
   -------------------------------------------------------------------------- */
.page-wifi { background: var(--c-stone-50); }
.page-wifi .site-header { background: var(--bg); color: var(--fg); box-shadow: var(--shadow-xs); }
.wifi-page { padding: var(--space-7) 0 var(--space-9); min-height: 60vh; }
.wifi-page__layout {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--space-5);
  max-width: 36rem;
  margin: 0 auto;
}
.wifi-page__intro { text-align: center; }
.wifi-page__title {
  font-family: var(--ff-display);
  font-weight: 500;
  font-size: clamp(2.25rem, 6vw, 3rem);
  line-height: 1.1;
  margin: var(--space-2) 0 var(--space-3);
  color: var(--c-ink-900);
}
.wifi-page__subtitle {
  font-family: var(--ff-display);
  font-style: italic;
  font-size: 1.0625rem;
  color: var(--c-ink-600);
  margin: 0;
}
.wifi-page__missing {
  text-align: center;
  color: var(--c-ink-600);
  background: var(--c-stone-100);
  border-radius: var(--radius-md);
  padding: var(--space-6);
}
.wifi-page__hint-tip {
  text-align: center;
  font-size: var(--fs-small);
  color: var(--c-ink-600);
  max-width: 36ch;
  margin: var(--space-3) auto 0;
  line-height: 1.5;
}
.wifi-page__logout {
  display: flex;
  justify-content: center;
  margin-top: var(--space-5);
}
/* On the dedicated WIFI page give the QR generous space. */
.wifi-page .wifi-block {
  margin: 0;
  padding: var(--space-6);
}
.wifi-page .wifi-block .wifi-qr {
  width: 260px;
  height: 260px;
}
@media (min-width: 640px) {
  .wifi-page .wifi-block .wifi-qr {
    width: 280px;
    height: 280px;
  }
}

/* --------------------------------------------------------------------------
   12. Motion + reduced-motion + dark mode
   -------------------------------------------------------------------------- */
@keyframes ken-burns {
  0%   { transform: scale(1.0)  translate(0%, 0%); }
  50%  { transform: scale(1.06) translate(-1.5%, -1.0%); }
  100% { transform: scale(1.0)  translate(0%, 0%); }
}
.tile__img--ken-burns {
  animation: ken-burns var(--dur-ken-burns) var(--ease-in-out) infinite alternate;
  transform-origin: center center;
  will-change: transform;
}

[data-reveal] {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity var(--dur-slow) var(--ease-out),
              transform var(--dur-slow) var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
}
[data-reveal].is-revealed {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .tile__img--ken-burns { animation: none; }
  [data-reveal] { opacity: 1; transform: none; }
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
  :root {
    --bg:       var(--c-basalt-900);
    --bg-elev:  var(--c-basalt-800);
    --bg-card:  var(--c-basalt-800);
    --fg:       var(--c-stone-50);
    --fg-muted: color-mix(in oklab, var(--c-stone-50) 70%, transparent);
    --fg-faint: color-mix(in oklab, var(--c-stone-50) 45%, transparent);
    --hairline: var(--c-basalt-700);
  }
  .welcome { background: var(--bg-card); }
  .pull-quote p { color: var(--c-stone-50); }
  .login-card { background: var(--c-basalt-800); }
  .login-card__input { background: var(--c-basalt-900); color: var(--c-stone-50); border-color: var(--c-basalt-700); }
  .guide-toc__details { background: var(--bg-card); }
  .guide-content h2, .guide-content .guide-lead, .callout-title { color: var(--c-stone-50); }
  .guide-content p, .guide-content li, .callout p { color: color-mix(in oklab, var(--c-stone-50) 88%, transparent); }
  .callout { background: color-mix(in oklab, var(--c-lake-600) 14%, var(--c-basalt-800)); }
  .callout-warning { background: color-mix(in oklab, var(--c-warning) 14%, var(--c-basalt-800)); }
  .site-footer { background: var(--bg); }
}
