/* Tanilan CC: site styles. One typeface, logo colours, one opening animation. */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/assets/fonts/bricolage-grotesque-latin-standard-normal.woff2") format("woff2-variations");
  font-weight: 200 800;
  font-stretch: 75% 100%;
  font-display: swap;
}

:root {
  --blue: #2E6FD8;
  --ink: #0C1838;
  --sky: #EAF1FB;
  --paper: #FBFCFE;
  --dot: #000000;
  --muted: #5B6A88;
  --rule: #DFE5EF;
  --gutter: clamp(16px, 3.4vw, 40px);
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Bricolage Grotesque", system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
}

img { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, p, ul, ol { margin: 0; }

:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 4px; }
.site-header :focus-visible,
.half-tools :focus-visible,
.dot-tools:focus-visible,
.site-footer :focus-visible { outline-color: #fff; }

.skip {
  position: absolute; left: var(--gutter); top: -60px; z-index: 20;
  background: #fff; color: var(--ink); padding: 8px 14px; border-radius: 99px;
}
.skip:focus { top: 12px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- Header ---------- */
.site-header {
  position: absolute; z-index: 10; top: 0; left: 0; right: 0;
  display: flex; align-items: center; gap: 12px;
  padding: 22px var(--gutter);
  color: #fff;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; font-weight: 700; font-size: 1.2rem; letter-spacing: -0.01em; }
.site-nav { margin-left: auto; display: flex; align-items: center; gap: 28px; font-size: 0.95rem; }
.site-nav a { text-decoration: none; }
.site-nav a:hover { text-decoration: underline; text-underline-offset: 4px; }
.pill { background: #fff; color: var(--ink); padding: 7px 15px; border-radius: 99px; font-weight: 600; }
.site-nav .pill:hover { text-decoration: none; background: var(--sky); }

/* ---------- Hero: the two halves ---------- */
.hero {
  position: relative;
  min-height: 700px;
  background: var(--sky);
  overflow: hidden;
}

.curve { position: absolute; inset: 0; width: 100%; height: 100%; }
.curve-narrow { display: none; }
.curve-shape { fill: var(--ink); }
.curve-edge { fill: none; stroke: var(--blue); stroke-width: 3; vector-effect: non-scaling-stroke; }

.half { position: absolute; z-index: 3; width: min(400px, 32%); }
.half-tools { left: var(--gutter); top: 118px; color: #fff; }
.half-stories { right: var(--gutter); bottom: 46px; }

.half h1, .half h2 {
  font-size: clamp(2.6rem, 4.6vw, 4rem);
  font-weight: 800;
  font-stretch: 76%;
  line-height: 0.9;
  letter-spacing: -0.015em;
  margin-bottom: 22px;
}
.half-stories h2 { text-align: right; }

.product-list { list-style: none; padding: 0; }
.product-list li {
  display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap;
  padding: 9px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  font-size: 1.05rem;
}
.product-list strong { font-weight: 600; }
.product-list li > span { font-size: 0.94rem; opacity: 0.66; }
.product-list a { text-decoration: none; border-bottom: 2px solid currentColor; }
.product-list a:hover { border-bottom-color: var(--blue); }
.half-stories .product-list li { border-top-color: rgba(12, 24, 56, 0.14); justify-content: space-between; }

.half-link { display: inline-block; margin-top: 18px; font-size: 0.95rem; text-underline-offset: 4px; opacity: 0.85; }

/* dots: the two black dots of the logo, each showing a featured product */
.dot { position: absolute; z-index: 4; display: block; text-decoration: none; }
.dot[hidden] { display: none; }
.dot-ring {
  display: block; width: 168px; height: 168px; border-radius: 50%;
  background: var(--dot); padding: 8px;
}
.dot-ring img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; background: #13254F; }
/* dot centres sit on the curve itself: (69%, 33%) and (42%, 82%) of the hero, from the Bezier points */
.dot-caption { position: absolute; top: 50%; transform: translateY(-50%); width: 190px; font-size: 0.9rem; line-height: 1.35; }
.dot-caption b { display: block; font-size: 1.02rem; }
.dot-tools { left: calc(69% - 84px); top: calc(33% - 84px); }
.dot-tools .dot-caption { right: calc(100% + 16px); text-align: right; color: #fff; }
.dot-stories { left: calc(42% - 84px); top: calc(82% - 84px); }
.dot-stories .dot-caption { left: calc(100% + 12px); width: 140px; background: var(--sky); padding: 6px 10px; border-radius: 10px; }
a.dot:hover .dot-ring { background: var(--blue); }

.see-all {
  position: absolute; z-index: 4; left: var(--gutter); bottom: 40px;
  background: #fff; color: var(--ink); text-decoration: none;
  padding: 10px 18px; border-radius: 99px; font-weight: 600; font-size: 0.95rem;
  box-shadow: 0 0 0 2px var(--ink);
}
.see-all:hover { background: var(--sky); }

/* the one opening moment: edge draws, navy half sweeps in, dots drop into place.
   The finished state is the default; the animations only play from the hidden state
   (fill-mode backwards), so the page is complete even if animation never runs. */
.curve-edge { animation: draw 1.1s 0.15s cubic-bezier(.6, 0, .2, 1) backwards; }
.curve-shape { animation: wipe 1s 0.35s cubic-bezier(.6, 0, .2, 1) backwards; }
.dot-ring { animation: pop 0.55s cubic-bezier(.3, 1.5, .5, 1) backwards; }
.dot-tools .dot-ring { animation-delay: 1.05s; }
.dot-stories .dot-ring { animation-delay: 1.25s; }
/* the dash only exists during the draw; non-scaling strokes measure it in screen px, so it is long enough for wide screens */
@keyframes draw { from { stroke-dasharray: 4000; stroke-dashoffset: 4000; } to { stroke-dasharray: 4000; stroke-dashoffset: 0; } }
@keyframes wipe { from { clip-path: inset(0 100% 0 0); } }
@keyframes pop { from { opacity: 0; transform: scale(0.4); } }

@media (prefers-reduced-motion: reduce) {
  .curve-edge, .curve-shape, .dot-ring { animation: none; }
}

/* motion (js/motion.js): dots ride the curve's lean, shrink as it unwinds, and flip like a coin */
.motion-toggle {
  position: absolute; z-index: 4; left: calc(var(--gutter) + 252px); bottom: 44px;
  font: inherit; font-size: 0.85rem; font-weight: 600; color: var(--ink);
  border: 2px solid var(--ink); border-radius: 99px; padding: 5px 14px; cursor: pointer;
  background: #fff;
}
.motion-toggle:hover { background: var(--sky); }
.motion-toggle[hidden] { display: none; }

@media (prefers-reduced-motion: no-preference) {
  .dot-tools { translate: var(--tools-dx, 0px) var(--tools-dy, 0px); }
  .dot-stories { translate: var(--stories-dx, 0px) var(--stories-dy, 0px); }
  .dot-ring { scale: calc(1 - var(--unwind, 0) * 0.35); transition: rotate 180ms ease-in; }
  .dot-ring.is-flipping { rotate: y 90deg; }
}

/* ---------- New from the studio ---------- */
.latest {
  display: grid; grid-template-columns: 240px 1fr; gap: 40px;
  padding: 72px var(--gutter);
  border-bottom: 1px solid var(--rule);
}
.latest[hidden] { display: none; }
.latest h2 { font-size: 1.9rem; font-weight: 700; font-stretch: 80%; line-height: 1; }
.latest-list { list-style: none; padding: 0; }
.latest-list li {
  display: grid; grid-template-columns: 110px 1fr auto; gap: 20px; align-items: baseline;
  padding: 16px 0; border-top: 1px solid var(--rule); font-size: 1.1rem;
}
.latest-list time { color: var(--muted); font-size: 0.88rem; }
.latest-list .half-name { color: var(--blue); font-weight: 600; font-size: 0.88rem; }

/* ---------- Studio note ---------- */
.studio {
  display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: end;
  padding: 80px var(--gutter);
}
.studio-big { font-size: clamp(1.7rem, 3.2vw, 2.4rem); line-height: 1.08; font-weight: 500; font-stretch: 90%; letter-spacing: -0.015em; max-width: 22ch; }
.studio-small { color: var(--muted); max-width: 46ch; }

/* ---------- Footer ---------- */
.site-footer {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px;
  padding: 26px var(--gutter);
  background: var(--ink); color: #C9D4EA; font-size: 0.9rem;
}
.site-footer b { color: #fff; margin-left: -12px; }
.footer-nav { margin-left: auto; display: flex; flex-wrap: wrap; gap: 22px; }
.footer-nav a { text-decoration: none; }
.footer-nav a:hover { text-decoration: underline; }

/* ---------- Everything page: the shelf ---------- */
.page-solid .site-header { position: static; background: var(--ink); }
.site-nav [aria-current="page"] { text-decoration: underline; text-underline-offset: 4px; }

.shelf-page { padding: 56px var(--gutter) 80px; max-width: 1200px; margin: 0 auto; }
.shelf-intro h1 { font-size: clamp(2.4rem, 5vw, 4rem); font-weight: 800; font-stretch: 76%; line-height: 0.9; letter-spacing: -0.015em; }
.shelf-intro p { margin-top: 14px; color: var(--muted); max-width: 52ch; }

.shelf-section { margin-top: 56px; scroll-margin-top: 16px; }
.shelf-section h2 { font-size: 1.5rem; font-weight: 700; font-stretch: 80%; margin-bottom: 8px; }

/* one blue board under every row; spines stand on it and the grid wraps as products grow */
.shelf {
  display: grid;
  grid-template-columns: repeat(auto-fill, 60px);
  grid-auto-rows: 270px;
  align-items: end;
  column-gap: 6px;
  background: repeating-linear-gradient(to bottom, transparent 0 258px, var(--blue) 258px 270px);
}
.shelf-note { grid-column: 1 / -1; align-self: center; color: var(--muted); }

.spine {
  height: var(--h); width: 60px; margin-bottom: 12px;
  display: flex; align-items: flex-end; justify-content: center; padding: 0 0 14px;
  background: var(--spine); color: var(--spine-ink);
  border: 0; border-radius: 4px 4px 0 0; cursor: pointer;
  font: inherit; font-size: 1.2rem; font-weight: 700; font-stretch: 80%;
  transform-origin: bottom left;
}
.spine span { writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; }
.spine:hover { filter: brightness(1.08); }
.spine.is-open { transform: rotate(-7deg) translateY(-14px); }
@media (prefers-reduced-motion: no-preference) {
  .spine { transition: transform 200ms cubic-bezier(.3, 1.4, .5, 1); }
}

.shelf-detail {
  display: grid; grid-template-columns: 280px 1fr; gap: 32px; align-items: start;
  margin-top: 28px; padding: 28px; border-radius: 16px; background: var(--sky); scroll-margin-top: 16px;
}
.shelf-detail[hidden] { display: none; }
.detail-cover img, .cover-block { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; }
.cover-block {
  display: flex; align-items: flex-end; padding: 16px;
  background: var(--spine); color: var(--spine-ink); font-weight: 800; font-stretch: 80%; font-size: 1.6rem; line-height: 1;
}
.detail-text h2 { font-size: clamp(1.8rem, 3vw, 2.4rem); font-weight: 800; font-stretch: 78%; line-height: 1; }
/* the name only receives focus so screen readers announce it; it is not a control, so no ring */
.detail-text h2:focus { outline: none; }
.detail-kind { color: var(--muted); margin-top: 6px; }
.detail-description { margin-top: 14px; max-width: 60ch; }
.detail-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.pill-link {
  background: #fff; color: var(--ink); text-decoration: none; font-weight: 600;
  padding: 9px 16px; border-radius: 99px; box-shadow: 0 0 0 2px var(--ink);
}
.pill-link:hover { background: var(--paper); }
.detail-close {
  margin-top: 22px; font: inherit; font-size: 0.9rem; color: var(--muted);
  background: none; border: 0; padding: 0; text-decoration: underline; text-underline-offset: 4px; cursor: pointer;
}

@media (max-width: 760px) {
  .shelf-detail { grid-template-columns: 1fr; padding: 20px; gap: 20px; }
}

/* ---------- Work with us ---------- */
.work-page {
  display: grid; grid-template-columns: 1fr minmax(320px, 460px); gap: 64px; align-items: start;
  max-width: 1200px; margin: 0 auto; padding: 64px var(--gutter) 88px;
}
.work-intro h1 { font-size: clamp(2.4rem, 5vw, 4rem); font-weight: 800; font-stretch: 76%; line-height: 0.9; letter-spacing: -0.015em; }
.work-lead { margin-top: 16px; color: var(--muted); max-width: 46ch; }
.offerings { list-style: none; padding: 0; margin-top: 40px; }
.offerings li { padding: 22px 0; border-top: 1px solid var(--rule); }
.offerings h2 { font-size: 1.45rem; font-weight: 700; font-stretch: 82%; line-height: 1.1; }
.offerings p { margin-top: 6px; max-width: 52ch; }

.work-form { background: var(--sky); border-radius: 16px; padding: 28px; }
.work-form h2 { font-size: 1.45rem; font-weight: 700; font-stretch: 82%; margin-bottom: 18px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 600; margin-bottom: 6px; }
.optional { font-weight: 400; color: var(--muted); }
.field input, .field textarea {
  width: 100%; font: inherit; font-size: 1rem; color: var(--ink);
  background: #fff; border: 2px solid var(--muted); border-radius: 10px; padding: 10px 12px;
}
.field textarea { resize: vertical; min-height: 140px; }
.field input:focus-visible, .field textarea:focus-visible { outline: 3px solid var(--blue); outline-offset: 1px; border-color: var(--blue); }
.field [aria-invalid="true"] { border-color: #B42318; }
.field-error { color: #B42318; font-size: 0.9rem; margin-top: 4px; min-height: 0; }
.field-error:empty { display: none; }
.trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-note { font-size: 0.88rem; color: var(--muted); margin: 6px 0 16px; }
.send {
  font: inherit; font-weight: 600; color: #fff; background: var(--ink);
  border: 0; border-radius: 99px; padding: 11px 22px; cursor: pointer;
}
.send:hover { background: #1B2B57; }
.send:disabled { opacity: 0.7; cursor: progress; }
.form-failed { margin-top: 14px; color: #B42318; }
.form-done { font-size: 1.15rem; font-weight: 600; }
.form-done:focus { outline: none; }

@media (max-width: 900px) {
  .work-page { grid-template-columns: 1fr; gap: 40px; padding-top: 48px; }
}

/* ---------- Legal pages ---------- */
.prose { max-width: 68ch; margin: 0 auto; padding: 64px var(--gutter) 88px; box-sizing: content-box; }
.prose h1 { font-size: clamp(2.4rem, 5vw, 3.6rem); font-weight: 800; font-stretch: 76%; line-height: 0.95; letter-spacing: -0.015em; }
.prose-meta { color: var(--muted); margin-top: 12px; }
.prose-note { margin-top: 18px; padding: 12px 16px; background: var(--sky); border-radius: 10px; font-size: 0.95rem; }
.prose h2 { font-size: 1.4rem; font-weight: 700; font-stretch: 82%; margin: 36px 0 8px; }
.prose p + p { margin-top: 12px; }
.prose ul { padding-left: 1.2em; margin-top: 8px; }
.prose li + li { margin-top: 8px; }
.prose a { text-underline-offset: 3px; }
.footer-nav [aria-current="page"] { text-decoration: underline; text-underline-offset: 4px; color: #fff; }

/* ---------- Phone and small tablet: the curve becomes a band between the halves ---------- */
@media (max-width: 1180px) {
  .site-nav a:not(.pill) { display: none; }
  .site-header { padding-top: 16px; padding-bottom: 16px; }

  .hero {
    min-height: 0;
    display: grid;
    grid-template-areas: "tools" "bend" "stories" "all";
    background: var(--sky);
  }
  .curve-wide { display: none; }
  .curve-narrow { display: block; position: relative; grid-area: bend; height: 150px; }
  .half, .dot, .see-all { position: static; width: auto; }

  .half-tools { grid-area: tools; background: var(--ink); padding: 92px var(--gutter) 40px; }
  .half-stories { grid-area: stories; padding: 8px var(--gutter) 24px; }
  .see-all { grid-area: all; justify-self: start; margin: 0 var(--gutter) 32px; }
  .motion-toggle { position: static; grid-area: all; justify-self: end; align-self: start; margin: 4px var(--gutter) 32px 0; }

  .dot { grid-area: bend; z-index: 4; }
  .dot-tools { justify-self: end; align-self: start; margin: -24px var(--gutter) 0 0; }
  .dot-stories { justify-self: start; align-self: end; margin: 0 0 -30px var(--gutter); }
  .dot-ring { width: 104px; height: 104px; padding: 6px; }
  .dot-caption {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap;
  }
  .half-stories { padding-top: 40px; }
  /* name above description, so every row is the same height whatever the wording;
     then reserve four rows so nothing below jumps when the products load (layout shift) */
  .product-list li { display: block; }
  .product-list li > span { display: block; margin-top: 2px; }
  .half-stories .product-list li { text-align: left; }
  .product-list { min-height: calc(4 * 4.5rem); } /* rows are 4.5rem (72px) each */

  .latest, .studio { grid-template-columns: 1fr; gap: 20px; padding-top: 48px; padding-bottom: 48px; }
  .latest-list li { grid-template-columns: 1fr auto; gap: 4px 16px; }
  .latest-list time { grid-column: 1 / -1; }
  .footer-nav { margin-left: 0; width: 100%; }
}
