/* =========================================================================
   HASDAI DATA INSTITUTE — static site
   Type: Technical   ·   Style: Gallery
   Palettes: Parchment (default) ⇄ Sepia Noir  — toggled via [data-palette]
   ---------------------------------------------------------------------------
   Everything visual is driven by the custom properties in this block. To
   retune the look, edit the tokens below — you rarely need to touch markup.
   ========================================================================= */

:root {
  /* ---- Type: Technical -------------------------------------------------- */
  --f-display: 'Space Grotesk', system-ui, sans-serif;
  --f-body:    'IBM Plex Sans', system-ui, sans-serif;
  --f-mono:    'Space Mono', ui-monospace, monospace;

  /* ---- Palette: Parchment (default) ------------------------------------- */
  --bg:       #fdfcfa;
  --surface:  #f6f3ec;
  --ink:      #1c1811;
  --muted:    #34312d;
  --line:     rgba(28, 24, 17, .13);
  --accent:   oklch(0.5 0.09 60);
  --accent-2: oklch(0.62 0.09 66);
  --sel:      oklch(0.5 0.09 60 / .16);
  --nav-bg:   rgba(253, 252, 250, .82);

  /* CTA panel tokens (parchment: dark panel, light text) */
  --cta-bg:     var(--ink);
  --cta-ink:    var(--bg);
  --cta-muted:  oklch(0.82 0.03 70);
  --cta-accent: var(--accent-2);
  --cta-btn-ink: var(--ink);

  /* ---- Shared shape tokens --------------------------------------------- */
  --maxw: 1280px;
  --gutter: clamp(20px, 5vw, 60px); /* shared left/right page inset */
  --radius: 2px;
}

/* ---- Palette: Sepia Noir ------------------------------------------------ */
[data-palette="noir"] {
  --bg:       #181510;
  --surface:  #211d16;
  --ink:      #ece2d1;
  --muted:    #9c917d;
  --line:     rgba(236, 226, 209, .14);
  --accent:   oklch(0.75 0.09 72);
  --accent-2: oklch(0.83 0.07 78);
  --sel:      oklch(0.75 0.09 72 / .2);
  --nav-bg:   rgba(24, 21, 16, .8);

  /* CTA panel tokens (noir: raised surface panel, keeps dark ink) */
  --cta-bg:     var(--surface);
  --cta-ink:    var(--ink);
  --cta-muted:  var(--muted);
  --cta-accent: var(--accent-2);
  --cta-btn-ink: var(--bg);
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  padding-bottom: 88px;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background .4s ease, color .4s ease;
}

::selection { background: var(--sel); }

a { color: inherit; }

/* One shared inset for every content block, so all left edges line up at
   any viewport width (including > max-width, where content centres). */
.container,
.nav__inner,
.hero__grid,
.principles__grid,
.guarantee__grid,
.footer__inner {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Gallery section label — mono, wide-tracked, muted */
.label {
  font-family: var(--f-mono);
  font-size: 13px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--accent);
}

/* Reusable buttons ------------------------------------------------------- */
.btn {
  display: inline-block;
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 15px 26px;
  border-radius: var(--radius);
  transition: filter .2s ease, border-color .2s ease;
}
.btn--primary { color: var(--bg); background: var(--accent); }
.btn--primary:hover { filter: brightness(1.08); }
.btn--ghost {
  color: var(--ink);
  padding: 0 0 3px;
  border-radius: 0;
  border-bottom: 1px solid var(--line);
}
.btn--ghost:hover { border-color: var(--accent); }

/* =========================================================================
   NAV
   ========================================================================= */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 40;
  padding-block: 18px;
  background: var(--nav-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav__brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.nav__brand .logo { width: 150px; }
.nav__links { display: flex; align-items: center; gap: 34px; }
.nav__link {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
  padding-bottom: 3px;
  border-bottom: 1px solid transparent;
  transition: color .2s, border-color .2s;
}
.nav__link:hover,
.nav__link.is-active { color: var(--accent); border-color: var(--accent); }
/* Right-hand cluster: CTA + theme toggle sit together at the nav's far right */
.nav__actions { display: flex; align-items: center; }
.nav__cta {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--bg);
  background: var(--ink);
  padding: 11px 18px;
  border-radius: var(--radius);
  transition: opacity .2s;
}
.nav__cta:hover { opacity: .86; }

/* Logo is inlined in the markup (nav + footer) and uses fill:currentColor,
   so it inherits the palette ink colour and inverts on noir. The standalone
   logo.svg file mirrors this artwork — keep the two in sync if you edit it. */
.logo { display: block; width: 100%; color: var(--ink); }
.logo svg { display: block; width: 100%; height: auto; }

/* =========================================================================
   HERO
   ========================================================================= */
.hero {
  padding-block: clamp(120px, 16vh, 190px) clamp(70px, 9vh, 110px);
}
.hero__grid {
  display: grid;
  /* text column | image column — raise the 2nd number to enlarge the image */
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: clamp(40px, 6vw, 90px);
  align-items: center;
}
.hero__title {
  font-family: var(--f-display);
  font-weight: 500;
  font-size: clamp(34px, 3.1vw, 60px);
  line-height: 1.2;
  letter-spacing: -.01em;
  margin: 22px 0 0;
  text-wrap: balance;
}
.hero__lead {
  font-family: var(--f-body);
  font-size: clamp(22px, 1.35vw, 22px);
  line-height: 1.62;
  color: var(--muted);
  max-width: 52ch;
  margin: 28px 0 0;
}
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  margin-top: 38px;
}
.hero__graphic {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 340px;
  margin-right: calc(var(--gutter) * -1);  /* pull graphic toward the page's right edge; 0 = default */
}
.hero__graphic svg { width: 100%; max-width: 400px; }

/* Prototype image slot — holds a PNG (e.g. parliament.png) in a gallery
   "plate" frame. Tweak the tokens below to taste:
     aspect-ratio : shape of the frame (1/1 square, 4/5 portrait, 3/2 landscape)
     object-fit   : cover = fill + crop (tidy);  contain = show whole image
     padding      : the mat/border width around the image                     */
.hero__image {
  width: 100%;      /* fills the hero's right column — raise/lower via max-width */
  margin: 0;
  aspect-ratio: 3 / 2;
}
.hero__image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: saturate(1.15) contrast(1.15);  /* +15% punch on the animation colours */
}

/* =========================================================================
   PRINCIPLES STRIP
   ========================================================================= */
.principles {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.principles__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}
.principle {
  padding: clamp(38px, 4vw, 56px) clamp(24px, 3vw, 44px);
  border-right: 1px solid var(--line);
}

/* Principles: outer cells flush with the container edges so the first/last
   columns line up left & right with the hero title and page gutters.
   (Pillars keep their padding — their hover white box needs the text inset.
   Only while multi-column — the mobile stack keeps full padding.) */
@media (min-width: 921px) {
  .principle:first-child { padding-left: 0; }
  .principle:last-child { padding-right: 0; }
}
.principle:last-child { border-right: 0; }
.principle__num {
  font-family: var(--f-mono);
  font-size: 13px;
  letter-spacing: .2em;
  color: var(--accent);
}
.principle__text {
  font-family: var(--f-display);
  font-weight: 500;
  font-size: clamp(21px, 1.9vw, 27px);
  line-height: 1.28;
  margin: 16px 0 0;
}

/* =========================================================================
   MANIFESTO
   ========================================================================= */
.manifesto { padding-block: clamp(90px, 12vh, 150px); }
.manifesto__inner { max-width: 1000px; margin-inline: auto; padding-inline: var(--gutter); }
.manifesto__quote {
  font-family: var(--f-display);
  font-weight: 500;
  font-size: clamp(18px, 3.4vw, 40px);
  line-height: 1.24;
  letter-spacing: -.01em;
  margin: 28px 0 0;
  text-wrap: pretty;
}
.manifesto__quote em { color: var(--accent); font-style: italic; }
.manifesto__body {
  font-family: var(--f-body);
  font-size: clamp(25px, 1.3vw, 22px);
  line-height: 1.66;
  color: var(--muted);
  max-width: 64ch;
  margin: 34px 0 0;
}
.manifesto__cite {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  margin-top: 26px;
}

/* =========================================================================
   PILLARS  (gallery: "Plate 0X", no motif graphics)
   ========================================================================= */
.pillars {
  padding-block: clamp(70px, 9vh, 110px);
  background: var(--surface);
  border-top: 1px solid var(--line);
}
.pillars__head {
  margin-bottom: clamp(40px, 5vw, 68px);
}
.pillars__title {
  font-family: var(--f-display);
  font-weight: 500;
  font-size: clamp(34px, 3.1vw, 60px);   /* match hero title */
  line-height: 1.2;
  letter-spacing: -.01em;
  margin: 14px 0 0;                        /* gap under the 03 GUARANTEES eyebrow */
  max-width: 30ch;                         /* narrower — wraps sooner instead of full width */
  text-wrap: balance;                      /* even line lengths */
  
}
.pillars__lead {
  font-family: var(--f-body);
  font-size: clamp(17px, 1.35vw, 20px);   /* match hero lead */
  line-height: 1.62;
  color: var(--muted);
  margin: 24px 0 0;                        /* full width — no max-width, spans left to right */
  max-width: 58ch;
}
.pillars__count { font-family: var(--f-mono); font-size: 13px; letter-spacing: .2em; color: var(--accent); }
.pillars__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
}
.pillar {
  background: var(--surface);
  padding: clamp(30px, 2.8vw, 44px) clamp(26px, 2.2vw, 38px);
  display: flex;
  flex-direction: column;
  gap: 18px;
  transition: background .2s ease;
}
.pillar:hover { background: var(--bg); }
.pillar__num {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--muted);
}
.pillar__sub {
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--accent);
}
.pillar__title {
  font-family: var(--f-display);
  font-weight: 600;
  font-size: clamp(23px, 2vw, 30px);
  line-height: 1.14;
  margin: 10px 0 0;
}
/* Emphasis anywhere in a pillar (title + body) = brown accent, upright (not italic) */
.pillar em { color: var(--accent); font-style: normal; }
.pillar__body {
  font-family: var(--f-body);
  font-size: 15.5px;
  line-height: 1.62;
  color: var(--muted);
  margin: 0;
}

/* =========================================================================
   GUARANTEE
   ========================================================================= */
.guarantee { padding-block: clamp(90px, 12vh, 150px); }
.guarantee__grid {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(40px, 6vw, 90px);
  align-items: start;
}
.guarantee__lead {
  font-family: var(--f-display);
  font-weight: 500;
  font-size: clamp(24px, 2.6vw, 36px);
  line-height: 1.22;
  margin: 22px 0 0;
}
.g-item {
  display: flex;
  gap: 26px;
  padding: 26px 0;
  border-bottom: 1px solid var(--line);
}
.g-item:last-child { border-bottom: 0; }
.g-item__num {
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--accent);
  flex: none;
  width: 34px;
  padding-top: 4px;
}
.g-item__title { font-family: var(--f-display); font-weight: 600; font-size: 22px; margin: 0 0 8px; }
.g-item__body { font-family: var(--f-body); font-size: 16px; line-height: 1.6; color: var(--muted); margin: 0; }

/* =========================================================================
   CTA
   ========================================================================= */
.cta {
  margin: 0 clamp(14px, 3vw, 40px);
  border-radius: 6px;
  padding: clamp(80px, 12vh, 140px) clamp(24px, 5vw, 60px);
  background: var(--cta-bg);
  background-image: radial-gradient(circle at 50% 120%, var(--sel), transparent 60%);
  position: relative;
  overflow: hidden;
}
.cta__inner { max-width: 900px; margin: 0 auto; text-align: center; position: relative; z-index: 2; }
.cta__label { font-family: var(--f-mono); font-size: 11px; letter-spacing: .24em; text-transform: uppercase; color: var(--cta-accent); }
.cta__title {
  font-family: var(--f-display);
  font-weight: 500;
  font-size: clamp(38px, 5.6vw, 74px);
  line-height: 1.02;
  letter-spacing: -.015em;
  margin: 22px auto 0;
  max-width: 16ch;
  color: var(--cta-ink);
  text-wrap: balance;
}
.cta__body {
  font-family: var(--f-body);
  font-size: clamp(20.4px, 1.68vw, 24px); /* +20% from clamp(17px, 1.4vw, 20px) */
  line-height: 1.6;
  color: var(--cta-muted);
  max-width: 50ch;
  margin: 24px auto 0;
}
.cta__btn {
  display: inline-block;
  margin-top: 40px;
  font-family: var(--f-mono);
  font-size: 13px;
  letter-spacing: .12em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--cta-btn-ink);
  background: var(--accent);
  padding: 17px 32px;
  border-radius: var(--radius);
  transition: filter .2s;
}
.cta__btn:hover { filter: brightness(1.08); }

/* =========================================================================
   FOOTER
   ========================================================================= */
.footer { padding-block: clamp(50px, 6vw, 80px) 44px; border-top: 1px solid var(--line); }
.footer__inner {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  flex-wrap: wrap;
}
.footer .logo { width: 170px; }
.footer__meta { font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); margin-top: 18px; }
.footer__tags { display: flex; gap: 10px; align-items: center; font-family: var(--f-mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.footer__tag { border: 1px solid var(--line); padding: 7px 12px; border-radius: var(--radius); }
.footer__legal {
  max-width: var(--maxw);
  margin: clamp(28px, 4vw, 44px) auto 0;
  padding: 22px var(--gutter) 0;
  border-top: 1px solid var(--line);
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: .04em;
  color: var(--muted);
  display: grid;
  gap: 6px;
}
.footer__legal p { margin: 0; }
.footer__legal i { font-style: italic; }
.footer__legal .reg { font-family: var(--f-body); font-size: 1.4em; vertical-align: baseline; }
.footer__legal .tm  { font-family: Georgia, 'Times New Roman', serif; font-size: 1.05em; vertical-align: baseline; }

/* =========================================================================
   THEME TOGGLE  (discreet light ⇄ dark switch, top-right of the nav)
   ========================================================================= */
.theme-toggle {
  --tt-w: 46px;
  --tt-h: 24px;
  --tt-thumb: 18px;
  --tt-pad: 2px;
  position: relative;
  flex: none;
  width: var(--tt-w);
  height: var(--tt-h);
  margin-left: 22px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  cursor: pointer;
  transition: background .3s ease, border-color .3s ease;
}
.theme-toggle:hover { border-color: var(--accent); }
.theme-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* The current-mode icon rides ON the thumb (cream on the accent knob, so it
   reads clearly); the other is hidden. Each icon sits centred over the thumb's
   rest position — sun at home (left), moon at the end (right). */
.theme-toggle__icon {
  position: absolute;
  top: 50%;
  width: 12px;
  height: 12px;
  color: var(--bg);            /* contrasts against the accent-coloured thumb */
  pointer-events: none;
  z-index: 2;                  /* above the thumb */
  opacity: 0;
  transform: translateY(-50%);
  transition: opacity .25s ease;
}
.theme-toggle__icon--sun  { left: 5px; }
.theme-toggle__icon--moon { right: 5px; }
[data-palette="parchment"] .theme-toggle__icon--sun  { opacity: 1; }
[data-palette="noir"]      .theme-toggle__icon--moon { opacity: 1; }

.theme-toggle__thumb {
  position: absolute;
  top: var(--tt-pad);
  left: var(--tt-pad);
  z-index: 1;
  width: var(--tt-thumb);
  height: var(--tt-thumb);
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
  transition: transform .3s cubic-bezier(.4, .1, .2, 1);
}
[data-palette="noir"] .theme-toggle__thumb {
  /* travel = track width - 2·border - thumb - 2·pad */
  transform: translateX(calc(var(--tt-w) - 2px - var(--tt-thumb) - (2 * var(--tt-pad))));
}

/* =========================================================================
   RESPONSIVE
   ========================================================================= */
@media (max-width: 920px) {
  .hero__grid,
  .guarantee__grid,
  .principles__grid,
  .pillars__grid { grid-template-columns: 1fr; gap: 48px; }
  .principle { border-right: 0; border-bottom: 1px solid var(--line); }
  .nav__links { display: none; }
}

/* Nav gets tight once the links drop out — shrink the brand mark and pull the
   toggle in so the wordmark, CTA and switch don't collide. */
@media (max-width: 560px) {
  .nav__brand .logo { width: 116px; }
  .theme-toggle { margin-left: 12px; }
  .nav__cta { padding: 10px 14px; }
}
