/* ============================================================
   ee · eeapp.is landing page
   Tokens ported from "ee Design System/colors_and_type.css".
   Self-hosted fonts (no Google Fonts / no third-party beacon).
   Light primary / dark secondary via prefers-color-scheme.
   ============================================================ */

/* ---- Self-hosted fonts ------------------------------------- */
@font-face {
  font-family: 'Hanken Grotesk';
  src: url('assets/fonts/HankenGrotesk.ttf') format('truetype');
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Newsreader';
  src: url('assets/fonts/Newsreader.ttf') format('truetype');
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Newsreader';
  src: url('assets/fonts/Newsreader-Italic.ttf') format('truetype');
  font-weight: 400 600;
  font-style: italic;
  font-display: swap;
}

/* ============================================================
   TOKENS (light, default)
   ============================================================ */
:root {
  --forest:        #2E5E4E;
  --forest-strong: #244C3F;
  --forest-deep:   #1C2B27;
  --sage:          #7FA99B;
  --sage-deep:     #5E8B7B;
  --sand:          #E8E2D5;
  --sand-deep:     #DAD2C1;

  --bg:            #F7F4EE;
  --surface:       #FFFFFF;
  --surface-2:     #F1ECE2;
  --surface-3:     #E9E3D6;
  --border:        #E2DCCE;
  --border-strong: #CFC7B5;

  --ink:           #1C2B27;
  --ink-2:         #4C5A54;
  --ink-3:         #7E887F;
  --ink-on-color:  #F7F4EE;

  --primary:        var(--forest);
  --primary-strong: var(--forest-strong);
  --primary-soft:   #E3EDE7;
  --on-primary:     #F7F4EE;

  --accent:       var(--sage);
  --accent-soft:  #E7F0EB;

  --success:       #2F7D55;
  --success-soft:  #E2F0E7;
  --warning:       #B98330;
  --warning-soft:  #F6ECDB;
  --danger:        #B4483B;
  --danger-strong: #9C3B30;
  --danger-soft:   #F6E4E0;

  --focus: #5E8B7B;

  --r-xs: 8px;  --r-sm: 12px; --r-md: 16px; --r-lg: 20px; --r-xl: 28px; --r-pill: 999px;

  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px;
  --s-5: 20px; --s-6: 24px; --s-7: 32px; --s-8: 40px;
  --s-9: 48px; --s-10: 64px;

  --shadow-sm: 0 1px 2px rgba(28,43,39,.06);
  --shadow-md: 0 2px 6px rgba(28,43,39,.06), 0 1px 2px rgba(28,43,39,.05);
  --shadow-lg: 0 10px 30px rgba(28,43,39,.10), 0 2px 8px rgba(28,43,39,.05);

  --font-sans:  'Hanken Grotesk', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-serif: 'Newsreader', Georgia, 'Times New Roman', serif;

  --t-counter: 68px;
  --t-h1: 32px; --t-h2: 27px; --t-h3: 22px; --t-title: 19px;
  --t-body: 17px; --t-callout: 16px; --t-subhead: 15px;
  --t-footnote: 13px; --t-caption: 12px;

  --lh-tight: 1.12; --lh-snug: 1.28; --lh-body: 1.5;

  --ease: cubic-bezier(.4,.0,.2,1);
  --dur: 220ms;

  --maxw: 1120px;     /* container max */
  --readw: 680px;     /* readable text-block max */

  /* generous vertical rhythm between major sections */
  --sec-pad: 128px;   /* desktop section padding-block */
}

/* ---- Dark mode (mirrors the design system) -----------------
   Dark tokens apply via the OS preference UNLESS the page is
   explicitly forced light with [data-theme="light"], and always
   apply when forced dark with [data-theme="dark"]. The DEFAULT
   light theme genuinely reads light. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:            #131D1A;
    --surface:       #1B2723;
    --surface-2:     #21302B;
    --surface-3:     #283833;
    --border:        #314039;
    --border-strong: #3E5048;

    --ink:           #ECE7DC;
    --ink-2:         #ABB5AE;
    --ink-3:         #79857E;
    --ink-on-color:  #131D1A;

    --primary:        #6FA68D;
    --primary-strong: #84B7A0;
    --primary-soft:   #21342D;
    --on-primary:     #0F1714;

    --accent:       #8FB6A7;
    --accent-soft:  #213029;

    --success:       #5FA67E; --success-soft:  #1C2E25;
    --warning:       #D4A258; --warning-soft:  #2E2719;
    --danger:        #D2685B; --danger-strong: #E07A6D; --danger-soft: #2E1C19;

    --focus: #8FB6A7;

    --shadow-sm: 0 1px 2px rgba(0,0,0,.30);
    --shadow-md: 0 2px 8px rgba(0,0,0,.35);
    --shadow-lg: 0 12px 34px rgba(0,0,0,.45);
  }
}

[data-theme="dark"] {
  --bg:            #131D1A;
  --surface:       #1B2723;
  --surface-2:     #21302B;
  --surface-3:     #283833;
  --border:        #314039;
  --border-strong: #3E5048;

  --ink:           #ECE7DC;
  --ink-2:         #ABB5AE;
  --ink-3:         #79857E;
  --ink-on-color:  #131D1A;

  --primary:        #6FA68D;
  --primary-strong: #84B7A0;
  --primary-soft:   #21342D;
  --on-primary:     #0F1714;

  --accent:       #8FB6A7;
  --accent-soft:  #213029;

  --success:       #5FA67E; --success-soft:  #1C2E25;
  --warning:       #D4A258; --warning-soft:  #2E2719;
  --danger:        #D2685B; --danger-strong: #E07A6D; --danger-soft: #2E1C19;

  --focus: #8FB6A7;

  --shadow-sm: 0 1px 2px rgba(0,0,0,.30);
  --shadow-md: 0 2px 8px rgba(0,0,0,.35);
  --shadow-lg: 0 12px 34px rgba(0,0,0,.45);
}

/* ============================================================
   BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--t-body);
  line-height: var(--lh-body);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

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

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}

.skip-link {
  position: absolute;
  left: var(--s-4);
  top: -100px;
  background: var(--surface);
  color: var(--ink);
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  z-index: 100;
  transition: top var(--dur) var(--ease);
}
.skip-link:focus { top: var(--s-4); }

.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--s-6);
}
@media (min-width: 720px) {
  .container { padding-inline: var(--s-8); }
}

/* Language visibility — JS toggles [lang] on <html>, CSS hides the other */
[data-lang]:not([hidden]) { display: revert; }
html[lang="is"] [data-lang="en"] { display: none; }
html[lang="en"] [data-lang="is"] { display: none; }

/* ============================================================
   HEADER / NAV
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  min-height: 64px;
  padding-block: var(--s-2);
}
.wordmark {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--primary);
  font-size: 30px;
  line-height: 1;
  text-decoration: none;
  padding: var(--s-1) var(--s-2);
  margin-left: calc(var(--s-2) * -1);
}
.wordmark:hover { text-decoration: none; }

/* Language toggle (segmented pill) */
.lang-toggle {
  display: inline-flex;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  padding: 3px;
}
.lang-toggle button {
  font-family: var(--font-sans);
  font-size: var(--t-subhead);
  font-weight: 600;
  color: var(--ink-2);
  background: transparent;
  border: 0;
  border-radius: var(--r-pill);
  padding: 8px 14px;
  min-height: 38px;
  cursor: pointer;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.lang-toggle button[aria-pressed="true"] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

/* ============================================================
   BUTTONS / PILLS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  font-family: var(--font-sans);
  font-size: var(--t-callout);
  font-weight: 600;
  min-height: 48px;
  padding: 12px 22px;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.btn:hover { text-decoration: none; }
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-strong); }
.btn-quiet {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--border-strong);
}
.btn-quiet:hover { background: var(--surface-2); }

.pill {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-size: var(--t-subhead);
  font-weight: 600;
  color: var(--ink-2);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  padding: 8px 16px;
  min-height: 36px;
}

.eyebrow {
  display: inline-block;
  font-size: var(--t-caption);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
  margin-bottom: var(--s-3);
}

/* ============================================================
   SECTIONS
   ============================================================ */
section { padding-block: 80px; }
@media (min-width: 720px) { section { padding-block: var(--sec-pad); } }

.section-head { max-width: var(--readw); margin-bottom: var(--s-9); }
.section-head h2 {
  font-size: var(--t-h2);
  font-weight: 700;
  line-height: var(--lh-snug);
  letter-spacing: -0.012em;
}
@media (min-width: 720px) { .section-head h2 { font-size: 34px; } }
.section-head p {
  margin-top: var(--s-4);
  color: var(--ink-2);
  font-size: var(--t-title);
  line-height: 1.6;
}

/* ---- Hero --------------------------------------------------
   Light. A very soft sand → off-white wash, dark ink text.
   The only forest moment is the small contained app icon. */
.hero {
  padding-top: 96px;
  padding-bottom: 96px;
  text-align: center;
  background:
    radial-gradient(110% 80% at 50% -10%, var(--accent-soft) 0%, transparent 60%),
    linear-gradient(180deg, var(--surface-2) 0%, var(--bg) 70%);
  border-bottom: 1px solid var(--border);
}
@media (min-width: 720px) {
  .hero { padding-top: 128px; padding-bottom: 128px; }
}
.hero-icon {
  width: 88px;
  height: 88px;
  margin: 0 auto var(--s-7);
  border-radius: 20px;
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.hero-icon svg { width: 100%; height: 100%; }
.hero h1 {
  font-size: var(--t-h1);
  font-weight: 700;
  line-height: var(--lh-tight);
  letter-spacing: -0.015em;
  max-width: 16ch;
  margin: 0 auto;
}
.hero-sub {
  margin: var(--s-5) auto 0;
  max-width: 44ch;
  color: var(--ink-2);
  font-size: var(--t-title);
  line-height: 1.55;
}
.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
  justify-content: center;
  margin-top: var(--s-7);
}
.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
  justify-content: center;
  align-items: center;
  margin-top: var(--s-8);
}
.coming-soon {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-size: var(--t-subhead);
  font-weight: 600;
  color: var(--ink-2);
  background: var(--primary-soft);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  padding: 12px 20px;
  min-height: 48px;
}

@media (min-width: 720px) {
  .hero h1 { font-size: 44px; }
  .hero-icon { width: 112px; height: 112px; }
}

/* ---- Feature cards ----------------------------------------
   Light EECard style: white surface, hairline border, 16px radius,
   soft low shadow. Roomy padding. Cards live inside the carousel. */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
  padding: var(--s-7);
}
.card-icon {
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-sm);
  background: var(--primary-soft);
  color: var(--primary);
  margin-bottom: var(--s-5);
}
.card-icon svg { width: 24px; height: 24px; }
.card h3 {
  font-size: var(--t-title);
  font-weight: 600;
  line-height: var(--lh-snug);
  margin-bottom: var(--s-3);
}
.card p { color: var(--ink-2); font-size: var(--t-callout); line-height: 1.6; }

/* ---- Features carousel ------------------------------------
   Calm slideshow. Fewer cards visible at once than the old grid:
   1 on mobile, 2 on tablet, 3 on desktop. Soft fades/slides only.
   No-JS fallback: the viewport is a horizontal scroll strip. */
.carousel { position: relative; }

.carousel-viewport {
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;            /* tidy by default; arrows/dots drive it */
  scroll-padding-inline: 0;
}
.carousel-viewport::-webkit-scrollbar { display: none; }

.carousel-track {
  display: flex;
  gap: var(--s-6);
  padding-block: var(--s-1);        /* room for focus rings / shadow */
}
@media (min-width: 940px) { .carousel-track { gap: var(--s-7); } }

.carousel-slide {
  scroll-snap-align: start;
  flex: 0 0 100%;                   /* mobile: 1 per view */
}
@media (min-width: 620px) {
  /* tablet: 2 per view (account for one gap) */
  .carousel-slide { flex-basis: calc((100% - var(--s-6)) / 2); }
}
@media (min-width: 940px) {
  /* desktop: 3 per view (account for two gaps) */
  .carousel-slide { flex-basis: calc((100% - 2 * var(--s-7)) / 3); }
}

/* When JS is active, advance via transform on the track (soft slide). */
.carousel.is-enhanced .carousel-viewport {
  overflow: hidden;
  scroll-snap-type: none;
}
.carousel.is-enhanced .carousel-track {
  transition: transform var(--dur) var(--ease);
  will-change: transform;
}
@media (prefers-reduced-motion: reduce) {
  .carousel.is-enhanced .carousel-track { transition: none; }
}

/* ---- Controls --------------------------------------------- */
.carousel-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-4);
  margin-top: var(--s-7);
}

.carousel-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease),
              border-color var(--dur) var(--ease);
}
.carousel-arrow:hover { background: var(--surface-2); }
.carousel-arrow:disabled {
  opacity: .4;
  cursor: default;
  box-shadow: none;
}
.carousel-arrow-icon { display: inline-flex; }
.carousel-arrow-icon svg { width: 20px; height: 20px; }

.carousel-dots {
  display: inline-flex;
  align-items: center;
  gap: var(--s-1);
  flex-wrap: wrap;
  justify-content: center;
}
.carousel-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;                       /* 44px tap target */
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  border-radius: var(--r-pill);
}
.carousel-dot::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: var(--r-pill);
  background: var(--border-strong);
  transition: background var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.carousel-dot:hover::before { background: var(--sage-deep); }
.carousel-dot[aria-current="true"]::before {
  background: var(--primary);
  transform: scale(1.25);
}
@media (prefers-reduced-motion: reduce) {
  .carousel-dot[aria-current="true"]::before { transform: none; }
}

/* Visually hidden but available to screen readers. */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
  white-space: nowrap;
}

/* ---- Privacy ----------------------------------------------
   Soft sage tint (a calm accent moment), not a dark fill.
   The checklist sits on white cards for contrast and air. */
.privacy {
  background: var(--accent-soft);
  border-block: 1px solid var(--border);
}
.privacy-grid {
  display: grid;
  gap: var(--s-8);
  grid-template-columns: 1fr;
}
@media (min-width: 880px) {
  .privacy-grid { grid-template-columns: 5fr 6fr; align-items: start; gap: var(--s-10); }
}
.privacy-list { display: grid; gap: var(--s-4); }
.privacy-item {
  display: flex;
  gap: var(--s-4);
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
  padding: var(--s-5);
}
.privacy-item .check {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  margin-top: 1px;
  color: var(--success);
}
.privacy-item h3 { font-size: var(--t-callout); font-weight: 600; margin-bottom: 3px; }
.privacy-item p { color: var(--ink-2); font-size: var(--t-subhead); line-height: 1.55; }

.reflection {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  font-size: var(--t-h3);
  line-height: 1.45;
  color: var(--ink);
  text-wrap: pretty;
}

/* ---- Crisis -----------------------------------------------
   A calm LIGHT card. Off-white section; the only terracotta is
   a restrained left border, the heading, and the numbers. */
.crisis { background: var(--bg); }
.crisis-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--danger);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  padding: var(--s-8);
}
@media (min-width: 720px) { .crisis-card { padding: var(--s-9); } }
.crisis .section-head { margin-bottom: var(--s-7); }
.crisis .section-head .eyebrow { color: var(--danger); }
.crisis .section-head h2 { color: var(--danger-strong); }
.crisis-grid {
  display: grid;
  gap: var(--s-4);
  grid-template-columns: 1fr;
}
@media (min-width: 600px) { .crisis-grid { grid-template-columns: repeat(2, 1fr); } }
.crisis-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--s-4) var(--s-5);
  min-height: 64px;
  color: var(--ink);
  font-weight: 500;
}
.crisis-link:hover { text-decoration: none; background: var(--surface-2); border-color: var(--border-strong); }
.crisis-link .label { font-size: var(--t-subhead); color: var(--ink-2); }
.crisis-link .number {
  font-size: var(--t-title);
  font-weight: 700;
  color: var(--danger-strong);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.crisis-note {
  margin-top: var(--s-7);
  font-family: var(--font-serif);
  font-style: italic;
  font-size: var(--t-h3);
  color: var(--ink);
}

/* ---- Traditions / about ----------------------------------- */
.about { background: var(--bg); }
.about p { color: var(--ink-2); max-width: var(--readw); font-size: var(--t-callout); line-height: 1.65; }
.about p + p { margin-top: var(--s-5); }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  padding-block: var(--s-9);
}
.footer-top {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-5);
  justify-content: space-between;
  align-items: flex-start;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2) var(--s-5);
  align-items: center;
}
.footer-links a { color: var(--ink-2); font-size: var(--t-subhead); font-weight: 500; }
.footer-bottom {
  margin-top: var(--s-6);
  padding-top: var(--s-5);
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2) var(--s-4);
  justify-content: space-between;
  align-items: center;
  color: var(--ink-2);
  font-size: var(--t-footnote);
}
.footer-bottom .just {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--ink-2);
  font-size: var(--t-callout);
}
