/* ============================================================
   Think Heart Apps AB — thinkheartapps.com
   Editorial-archival. Shares its grammar with ozcarstorm.com:
   Fraunces display, DM Mono metadata, hairlines instead of
   shadows, a grain overlay, 2–3px radius, one easing curve.

   Departs from it in exactly two places, deliberately:
     1. A warmer paper ground (#F5F1E8) than the portfolio's
        cool oat (#E9E8E1).
     2. Three categorical signal colours taken from the logo,
        instead of the portfolio's single ultramarine.
   Body face is Atkinson Hyperlegible, not Instrument Sans.

   Every value lives here as a custom property. Never write a
   colour literal into a component rule.
   ============================================================ */

:root {
  /* --- ground --- */
  --paper:      #F5F1E8;
  --paper-2:    #EFEADF;
  --paper-3:    #E7E1D3;

  /* --- ink --- */
  --ink:        #16150F;
  --ink-2:      #55524A;
  --ink-3:      #857F72;

  /* --- structure --- */
  --rule:       rgba(22, 21, 15, 0.20);
  --rule-soft:  rgba(22, 21, 15, 0.10);

  /* --- signal ---
     These three are CATEGORICAL, not decorative. Each maps to a
     product family and appears only as a catalogue mark:
       think = learning · heart = wellbeing · apps = everyday
     --think doubles as the interactive accent (links, focus).
     Do not introduce a fourth hue. */
  --think:      #2B4CE0;
  --heart:      #E0322D;
  --apps:       #7B2FE0;
  --think-deep: #1F3AB4;

  --on-dark:      rgba(245, 241, 232, 0.58);
  --on-dark-rule: rgba(245, 241, 232, 0.22);

  /* --- type --- */
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans:  "Atkinson Hyperlegible", Helvetica, Arial, sans-serif;
  --mono:  "DM Mono", ui-monospace, Menlo, monospace;

  /* --- metrics --- */
  --pad:   clamp(20px, 4.5vw, 72px);
  --shell: 1360px;
  --ease:  cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Fixed grain, above the ground and below the content. */
.grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}
body > *:not(.grain) { position: relative; z-index: 2; }

/* --- shared primitives --- */
.mono {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.tab { font-variant-numeric: tabular-nums; }

a { color: inherit; }

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 12px 18px;
  z-index: 100;
}
.skip:focus { left: 0; }

:where(a, button):focus-visible {
  outline: 2px solid var(--think);
  outline-offset: 3px;
  border-radius: 2px;
}

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

/* ============================================================
   HEADER
   ============================================================ */
.site-head {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 20px var(--pad);
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
  transition: transform .4s var(--ease);
}
.site-head.is-hidden { transform: translateY(-101%); }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
}
.brand-name {
  font-family: var(--serif);
  font-variation-settings: "opsz" 40, "SOFT" 20, "WONK" 0;
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -.018em;
}
.brand-marks { display: inline-flex; gap: 5px; }
.brand-marks i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: block;
}
.brand-marks i:nth-child(1) { background: var(--think); }
.brand-marks i:nth-child(2) { background: var(--heart); }
.brand-marks i:nth-child(3) { background: var(--apps); }
.brand-marks.sm i { width: 7px; height: 7px; }

.nav { display: flex; gap: clamp(16px, 2.4vw, 34px); }
.nav a {
  color: var(--ink-2);
  text-decoration: none;
  padding-bottom: 3px;
  border-bottom: 1px solid transparent;
  transition: color .25s var(--ease), border-color .25s var(--ease);
}
.nav a:hover { color: var(--ink); border-bottom-color: var(--think); }

/* ============================================================
   HERO
   ============================================================ */
/* Statement left, one real product right. No divider between the
   headline and the lede — the size change already separates them. */
.hero {
  max-width: var(--shell);
  margin: 0 auto;
  padding: clamp(48px, 7vw, 96px) var(--pad) clamp(48px, 6vw, 84px);
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(0, 0.82fr);
  gap: clamp(32px, 5vw, 76px);
  align-items: center;
}

.eyebrow { color: var(--ink-3); margin: 0 0 clamp(22px, 3vw, 40px); }

.hero h1 {
  font-family: var(--serif);
  font-variation-settings: "opsz" 144, "SOFT" 0, "WONK" 0;
  font-weight: 400;
  font-size: clamp(38px, 5.9vw, 86px);
  line-height: .95;
  letter-spacing: -.030em;
  margin: 0;
  max-width: 15ch;
  text-wrap: balance;
}
.hero h1 em {
  font-style: italic;
  font-variation-settings: "opsz" 144, "SOFT" 0, "WONK" 1;
}

.lede {
  margin: clamp(24px, 2.8vw, 34px) 0 0;
  max-width: 52ch;
  color: var(--ink-2);
  font-size: clamp(16px, 1.15vw, 17.5px);
}

/* One catalogue title, shown as the product it is. A cut-out device
   render carries its own edge and its own shadow, so it is NOT mounted
   on a --paper-3 mat — the mat exists for flat screenshots that would
   otherwise dissolve into the paper. */
.showcase {
  margin: 0;
  justify-self: end;
  max-width: 440px;
  width: 100%;
}
.showcase a {
  display: block;
  border-radius: 3px;
}
.showcase img {
  display: block;
  width: 100%;
  height: auto;
  /* The shots vary slightly in proportion. A fixed box with contain keeps
     the layout identical whichever one the picker lands on, and the cut-out
     backgrounds make the letterboxing invisible. */
  aspect-ratio: 900 / 1203;
  object-fit: contain;
  object-position: center;
  transition: transform .5s var(--ease);
}
.showcase a:hover img { transform: translateY(-5px); }
.showcase figcaption {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: clamp(10px, 1.4vw, 16px);
  color: var(--ink-3);
}
.showcase-cat { margin-left: auto; }

/* House primitive for any imagery added later: artwork on a light
   ground dissolves without an edge, so it is always mounted on a
   --paper-3 mat inside a hairline. Currently unused — the homepage
   hero is type only. */
.plate { margin: 0; }
.plate-mat {
  background: var(--paper-3);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: clamp(14px, 2.4vw, 34px);
}
.plate-mat img {
  display: block;
  width: 100%;
  height: auto;
  mix-blend-mode: multiply;
}
.plate figcaption {
  color: var(--ink-3);
  margin-top: 12px;
}

/* ============================================================
   SECTIONS
   ============================================================ */
.sec {
  max-width: var(--shell);
  margin: 0 auto;
  padding: clamp(48px, 6.5vw, 96px) var(--pad);
  border-top: 1px solid var(--rule);
}

.sec-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px 28px;
  margin-bottom: clamp(28px, 3.6vw, 46px);
}
.sec-head h2 {
  font-family: var(--serif);
  font-variation-settings: "opsz" 96, "SOFT" 0, "WONK" 0;
  font-weight: 400;
  font-size: clamp(28px, 3.6vw, 48px);
  line-height: 1;
  letter-spacing: -.026em;
  margin: 0;
}
.note { color: var(--ink-3); margin: 0; }

/* Legend for the catalogue marks. The three signal colours encode
   family, so they need decoding once. */
.legend {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px clamp(14px, 2vw, 26px);
  color: var(--ink-3);
}
.legend li { display: flex; align-items: center; gap: 8px; }

/* ============================================================
   CATALOGUE INDEX
   Numbered because these are catalogue numbers, the way a press
   numbers its titles — not because three things needed markers.
   ============================================================ */
.index { border-top: 1px solid var(--rule); }

.row {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  align-items: baseline;
  gap: clamp(12px, 2vw, 26px);
  padding: clamp(18px, 2.1vw, 26px) 0;
  border-bottom: 1px solid var(--rule-soft);
  text-decoration: none;
  position: relative;
}
/* Hairline sweep on hover — the one accent moment per row. */
.row::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  height: 1px;
  width: 0;
  background: var(--think);
  transition: width .55s var(--ease);
}
a.row:hover::after { width: 100%; }

.row-num { color: var(--ink-3); }

.row-mark {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--mark);
  align-self: center;
}

.row-body { display: block; min-width: 0; }

.row-name {
  display: block;
  font-family: var(--serif);
  font-variation-settings: "opsz" 60, "SOFT" 0, "WONK" 0;
  font-weight: 400;
  font-size: clamp(21px, 2.2vw, 30px);
  line-height: 1.05;
  letter-spacing: -.022em;
}
.row-desc {
  display: block;
  margin-top: 7px;
  color: var(--ink-2);
  font-size: 15px;
  max-width: 58ch;
}

.row-meta {
  color: var(--ink-3);
  text-align: right;
  line-height: 1.75;
  white-space: nowrap;
}

/* Unshipped titles read as reserved slots, not as gaps. */
.is-pending .row-name { color: var(--ink-3); }
.is-pending .row-desc { color: var(--ink-3); }
.is-pending .row-mark { opacity: .32; }

/* The For Kidz sub-series: five titles bracketed as one line of
   the catalogue rather than five unrelated entries. */
.series {
  border-left: 1px solid var(--rule);
  padding-left: clamp(14px, 2.4vw, 34px);
  margin-left: clamp(4px, 1vw, 14px);
}
.series-head {
  color: var(--ink-3);
  margin: 0;
  padding: clamp(20px, 2.4vw, 30px) 0 6px;
}
.row-in .row-num { color: var(--ink-3); }
.series .row:last-child { border-bottom: 0; }

/* ============================================================
   APPROACH — an essay spread, not icon cards
   ============================================================ */
.essay {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid var(--rule);
}
.essay article {
  padding: clamp(24px, 2.8vw, 36px) clamp(18px, 2.4vw, 34px) 4px 0;
  border-right: 1px solid var(--rule-soft);
}
.essay article + article { padding-left: clamp(18px, 2.4vw, 34px); }
.essay article:last-child { border-right: 0; padding-right: 0; }

.essay-label { color: var(--ink-3); margin: 0 0 14px; }
.essay h3 {
  font-family: var(--serif);
  font-variation-settings: "opsz" 40, "SOFT" 0, "WONK" 0;
  font-weight: 400;
  font-size: clamp(20px, 1.85vw, 25px);
  line-height: 1.1;
  letter-spacing: -.022em;
  margin: 0 0 14px;
  text-wrap: balance;
}
.essay p:not(.essay-label) {
  margin: 0;
  color: var(--ink-2);
  font-size: 15.5px;
  max-width: 46ch;
}

/* ============================================================
   CONTACT
   ============================================================ */
.contact { max-width: 46ch; }
.contact h2 {
  font-family: var(--serif);
  font-variation-settings: "opsz" 96, "SOFT" 0, "WONK" 0;
  font-weight: 400;
  font-size: clamp(30px, 4.2vw, 56px);
  line-height: 1;
  letter-spacing: -.028em;
  margin: 0 0 20px;
}
.contact-lede {
  margin: 0 0 26px;
  color: var(--ink-2);
  max-width: 46ch;
}
.mail {
  font-family: var(--serif);
  font-variation-settings: "opsz" 60, "SOFT" 0, "WONK" 0;
  font-size: clamp(20px, 2.2vw, 28px);
  letter-spacing: -.022em;
  color: var(--think);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 4px;
  transition: border-color .3s var(--ease);
}
.mail:hover { border-bottom-color: var(--think); }

/* ============================================================
   DOCUMENT PAGES (privacy, and anything else that is read
   straight through rather than scanned). One narrow column,
   headings carrying the hierarchy, no decoration.
   ============================================================ */
.doc {
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(44px, 6vw, 84px) var(--pad) clamp(40px, 5vw, 64px);
}

.doc-head { padding-bottom: clamp(26px, 3.4vw, 40px); }
.doc-head h1 {
  font-family: var(--serif);
  font-variation-settings: "opsz" 144, "SOFT" 0, "WONK" 0;
  font-weight: 400;
  font-size: clamp(40px, 6vw, 80px);
  line-height: .94;
  letter-spacing: -.030em;
  margin: 0;
}
.doc-lede {
  margin: clamp(20px, 2.4vw, 28px) 0 0;
  color: var(--ink-2);
  font-size: clamp(16px, 1.15vw, 17.5px);
  max-width: 56ch;
}
.doc-date { color: var(--ink-3); margin: clamp(18px, 2vw, 24px) 0 0; }

.doc-sec {
  border-top: 1px solid var(--rule);
  padding: clamp(28px, 3.4vw, 42px) 0 clamp(8px, 1vw, 12px);
}
.doc-sec h2 {
  font-family: var(--serif);
  font-variation-settings: "opsz" 60, "SOFT" 0, "WONK" 0;
  font-weight: 400;
  font-size: clamp(24px, 2.6vw, 34px);
  line-height: 1.04;
  letter-spacing: -.024em;
  margin: 0 0 clamp(14px, 1.6vw, 20px);
}
.doc-sec h3 {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 16.5px;
  line-height: 1.35;
  letter-spacing: -.004em;
  margin: clamp(24px, 2.6vw, 32px) 0 10px;
}
.doc-sec h3:first-of-type { margin-top: 0; }
.doc-sec p {
  margin: 0 0 14px;
  color: var(--ink-2);
  max-width: 66ch;
}
.doc-sec a { color: var(--think); text-decoration: none; border-bottom: 1px solid var(--rule); }
.doc-sec a:hover { border-bottom-color: var(--think); }

.doc-facts { margin: 18px 0 4px; }
.doc-facts > div {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 0 20px;
  padding: 10px 0;
  border-top: 1px solid var(--rule-soft);
}
.doc-facts dt { color: var(--ink-3); padding-top: 2px; }
.doc-facts dd { margin: 0; color: var(--ink); }

.doc-back {
  margin: clamp(30px, 4vw, 46px) 0 0;
  padding-top: clamp(22px, 2.6vw, 30px);
  border-top: 1px solid var(--rule);
}
.doc-back a {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--think);
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  padding-bottom: 4px;
}

@media (max-width: 560px) {
  .doc-facts > div { grid-template-columns: minmax(0, 1fr); gap: 3px; }
}

/* ============================================================
   COLOPHON — set like an imprint page
   ============================================================ */
.colophon {
  background: var(--ink);
  color: var(--on-dark);
  padding: clamp(34px, 4.5vw, 56px) var(--pad) clamp(26px, 3vw, 38px);
  margin-top: clamp(40px, 5vw, 72px);
}
.colophon-inner {
  max-width: var(--shell);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 12px clamp(24px, 4vw, 60px);
  align-items: center;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--on-dark-rule);
}
.colophon-inner p { margin: 0; display: flex; align-items: center; gap: 10px; }
.colophon-inner p:first-child { color: var(--paper); }
.colophon a {
  color: var(--on-dark);
  text-decoration: none;
  border-bottom: 1px solid var(--on-dark-rule);
  padding-bottom: 2px;
  transition: color .25s var(--ease);
}
.colophon a:hover { color: var(--paper); }
.copyright {
  max-width: var(--shell);
  margin: 18px auto 0;
  color: var(--on-dark);
  opacity: .7;
}

/* ============================================================
   LOAD ORCHESTRATION
   Content is visible by default. The sequence only runs when JS
   marks the document ready, so nothing is ever stranded hidden.
   ============================================================ */
.js-ready .load-1,
.js-ready .load-2,
.js-ready .load-3 { animation: rise .75s var(--ease) backwards; }
.js-ready .load-1 { animation-delay: .05s; }
.js-ready .load-2 { animation-delay: .16s; }
.js-ready .load-3 { animation-delay: .26s; }

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1000px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    gap: clamp(28px, 5vw, 44px);
  }
  .showcase { justify-self: start; max-width: 340px; }
  .essay { grid-template-columns: minmax(0, 1fr); }
  .essay article {
    border-right: 0;
    border-bottom: 1px solid var(--rule-soft);
    padding: clamp(22px, 3vw, 30px) 0;
  }
  .essay article + article { padding-left: 0; }
  .essay article:last-child { border-bottom: 0; }
}

@media (max-width: 720px) {
  body { font-size: 16px; }
  .nav { gap: 16px; }
  .nav a:last-child { display: none; }

  .row {
    grid-template-columns: auto auto minmax(0, 1fr);
    row-gap: 8px;
  }
  .row-meta {
    grid-column: 3;
    text-align: left;
    line-height: 1.6;
  }
  .series { padding-left: 16px; }
}

@media (max-width: 480px) {
  .brand-name { font-size: 17px; }
  .colophon-inner { display: grid; gap: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .site-head.is-hidden { transform: none; }
}
