/* East Wind house components, shared by every page built on _includes/base.njk.
   Colours and type come from styles.css (paper, ink, cyan; Fraunces and Work Sans). */

:root { --wrap: 1080px; --gutter: 48px; --ease: cubic-bezier(.2,.7,.2,1); }
@media (max-width: 600px) { :root { --gutter: 20px; } }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { -webkit-font-smoothing: antialiased; }
img, svg { max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

.skip { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--ink); color: var(--paper); padding: 8px 14px; border-radius: 3px; font-size: 13px; }
.skip:focus { left: 12px; }

/* ---------- Menu ---------- */
.ew-nav { position: relative; z-index: 40; background: var(--paper); }
.ew-nav .tabs a.active { color: var(--ink); font-weight: 600; }
.tab-menu { position: relative; display: inline-flex; align-items: center; gap: 2px; }
.tab-caret { background: none; border: 0; padding: 6px 4px; cursor: pointer; color: var(--ink-soft); display: inline-flex; line-height: 0; }
.tab-caret svg { transition: transform .25s var(--ease); }
.tab-menu.is-open .tab-caret svg, .tab-menu:hover .tab-caret svg { transform: rotate(180deg); }
.tab-drop {
  list-style: none; position: absolute; top: calc(100% + 14px); left: -18px; min-width: 220px;
  background: var(--paper); border: 1px solid var(--rule); border-top: 1px solid var(--ink);
  padding: 8px; box-shadow: 0 18px 40px -24px rgba(46,46,44,.35);
  opacity: 0; visibility: hidden; transform: translateY(-4px);
  transition: opacity .2s ease, transform .25s var(--ease), visibility 0s .25s;
}
.tab-drop::before { content: ""; position: absolute; left: 0; right: 0; top: -16px; height: 16px; }
.tab-menu:hover .tab-drop, .tab-menu.is-open .tab-drop { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.tab-drop a { display: flex; justify-content: space-between; align-items: baseline; gap: 20px; padding: 10px 12px; border-radius: 3px; color: var(--ink) !important; }
.tab-drop a:hover, .tab-drop a:focus-visible { background: #F2EEE5; }
.tab-drop b { font-family: 'Fraunces', serif; font-weight: 500; font-size: 16px; }
.tab-drop span { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); }
@media (max-width: 600px) { .tab-caret, .tab-drop { display: none; } }

/* ---------- Footer ---------- */
.ew-foot { text-align: center; padding: 56px var(--gutter) 44px; border-top: 1px solid var(--rule); }
.foot-line { font-family: 'Fraunces', serif; font-weight: 500; font-size: 17px; line-height: 1.5; max-width: 34ch; margin: 0 auto 22px; color: var(--ink); }
.foot-links { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 22px; font-size: 13px; margin-bottom: 18px; }
.foot-links a { color: var(--ink-soft); text-decoration: none; display: inline-block; padding: 6px 0; }
.foot-links a:hover { color: var(--ink); }
.foot-press { font-size: 12.5px; color: var(--ink-soft); margin-bottom: 6px; }
.foot-press a { color: var(--ink-soft); }
.foot-copy { font-size: 12px; color: #75726B; }

/* ---------- Layout ---------- */
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: 720px; }
.sec { padding: 88px 0; border-top: 1px solid var(--rule); }
.sec:first-child { border-top: 0; }
.sec-tight { padding: 64px 0; }
.eyebrow-s { font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: #3F6569; margin-bottom: 18px; display: flex; align-items: center; gap: 10px; }
.eyebrow-s::before { content: ""; width: 22px; height: 1px; background: currentColor; }
.h2 { font-family: 'Fraunces', serif; font-weight: 500; font-size: clamp(28px, 3.6vw, 42px); line-height: 1.16; letter-spacing: -.01em; max-width: 22ch; margin-bottom: 22px; }
.body-t { font-size: 17px; line-height: 1.72; color: #4A4945; max-width: 62ch; }
.body-t + .body-t { margin-top: 16px; }
.split { display: grid; grid-template-columns: 5fr 7fr; gap: 56px; align-items: start; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; gap: 24px; } .sec { padding: 64px 0; } }

/* ---------- Page header ---------- */
.ph { padding: 96px 0 72px; position: relative; overflow: hidden; }
.ph-kick { font-size: 12px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: #3F6569; margin-bottom: 22px; }
.ph h1 { font-family: 'Fraunces', serif; font-weight: 500; font-size: clamp(36px, 5.6vw, 68px); line-height: 1.06; letter-spacing: -.02em; max-width: 17ch; }
.ph-lede { font-size: 19px; line-height: 1.6; color: #4A4945; max-width: 54ch; margin-top: 26px; }
.ph-wind { position: absolute; inset: 0; pointer-events: none; opacity: .55; }
.ph > .wrap { position: relative; }
@media (max-width: 600px) { .ph { padding: 64px 0 48px; } .ph-lede { font-size: 17px; } }

/* ---------- Buttons ---------- */
.b-solid, .b-line {
  display: inline-flex; align-items: center; gap: 10px; font-family: 'Work Sans', sans-serif; font-weight: 600; font-size: 14px;
  text-decoration: none; border-radius: 3px; padding: 14px 26px; transition: background .2s ease, transform .2s var(--ease); cursor: pointer; border: 0;
}
.b-solid { background: var(--cyan); color: var(--ink); }
.b-solid:hover { background: #A6D3D7; }
.b-line { background: none; color: var(--ink); padding: 0 0 4px; border-radius: 0; border-bottom: 1.5px solid var(--ink); }
.b-solid .arr, .b-line .arr { transition: transform .2s var(--ease); }
.b-solid:hover .arr, .b-line:hover .arr { transform: translateX(4px); }
.b-row { display: flex; flex-wrap: wrap; gap: 18px 28px; align-items: center; margin-top: 34px; }

/* ---------- Three bodies of work ---------- */
.work { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-top: 1px solid var(--ink); }
.work-card { position: relative; padding: 30px 28px 34px; border-right: 1px solid var(--rule); text-decoration: none; color: inherit; display: flex; flex-direction: column; min-height: 340px; transition: background .3s ease; }
.work-card:last-child { border-right: 0; }
.work-card:hover { background: #F4F0E7; }
.work-verb { font-size: 11.5px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-soft); }
.work-card h3 { font-family: 'Fraunces', serif; font-weight: 500; font-size: 32px; letter-spacing: -.01em; margin: 10px 0 14px; }
.work-card p { font-size: 15.5px; line-height: 1.65; color: #4A4945; }
.work-with { margin-top: auto; padding-top: 22px; font-size: 13px; color: var(--ink-soft); line-height: 1.5; }
.work-go { margin-top: 18px; font-size: 13.5px; font-weight: 600; display: inline-flex; gap: 8px; align-items: center; }
.work-go .arr { transition: transform .2s var(--ease); }
.work-card:hover .work-go .arr { transform: translateX(4px); }
.work-glyph { position: absolute; top: 26px; right: 24px; width: 44px; height: 44px; color: #3F6569; opacity: .8; }
@media (max-width: 860px) { .work { grid-template-columns: 1fr; } .work-card { border-right: 0; border-bottom: 1px solid var(--rule); min-height: 0; } }

/* ---------- Chapter rows ---------- */
.rows { list-style: none; border-top: 1px solid var(--ink); }
.row { border-bottom: 1px solid var(--rule); }
.row > a, .row > div { display: grid; grid-template-columns: 64px 1fr auto 28px; gap: 18px; align-items: center; padding: 26px 4px; text-decoration: none; color: inherit; transition: background .25s ease, padding .3s var(--ease); }
.row > a:hover { background: #F4F0E7; padding-left: 14px; }
.row-n { font-family: 'Fraunces', serif; font-size: 15px; color: var(--ink-soft); }
.row-name { font-family: 'Fraunces', serif; font-weight: 500; font-size: clamp(24px, 3vw, 34px); letter-spacing: -.01em; }
.row-note { display: block; font-family: 'Work Sans', sans-serif; font-size: 14px; color: var(--ink-soft); margin-top: 4px; letter-spacing: 0; }
.row-arr { color: var(--ink-soft); transition: transform .2s var(--ease); }
.row > a:hover .row-arr { transform: translateX(4px); color: var(--ink); }
.status { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); white-space: nowrap; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid currentColor; }
.status.is-live { color: #2F6B4A; }
.status.is-live::before { background: currentColor; box-shadow: 0 0 0 0 rgba(47,107,74,.5); animation: live 2.4s ease-out infinite; }
@keyframes live { 0% { box-shadow: 0 0 0 0 rgba(47,107,74,.45); } 70% { box-shadow: 0 0 0 9px rgba(47,107,74,0); } 100% { box-shadow: 0 0 0 0 rgba(47,107,74,0); } }
@media (prefers-reduced-motion: reduce) { .status.is-live::before { animation: none; } }
@media (max-width: 600px) { .row > a, .row > div { grid-template-columns: 1fr auto; } .row-n, .row-arr { display: none; } }

/* ---------- Routes (Build with us, Join) ---------- */
.routes { list-style: none; counter-reset: r; border-top: 1px solid var(--ink); }
.routes li { counter-increment: r; border-bottom: 1px solid var(--rule); }
.routes a, .routes button { width: 100%; background: none; border: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; display: grid; grid-template-columns: 48px 1fr 28px; gap: 16px; align-items: baseline; padding: 22px 4px; text-decoration: none; transition: padding .3s var(--ease), background .25s ease; }
.routes a::before, .routes button::before { content: "0" counter(r); font-family: 'Fraunces', serif; font-size: 14px; color: var(--ink-soft); }
.routes a:hover, .routes button:hover { background: #F4F0E7; padding-left: 14px; }
.routes b { font-family: 'Fraunces', serif; font-weight: 500; font-size: 22px; }
.routes small { display: block; font-size: 14.5px; color: var(--ink-soft); margin-top: 4px; }
.routes .arr { transition: transform .2s var(--ease); }
.routes a:hover .arr, .routes button:hover .arr { transform: translateX(4px); }
.routes button[aria-pressed="true"] { background: #EAF5F6; padding-left: 14px; }

/* ---------- Figures ---------- */
.figs { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 0; border-top: 1px solid var(--ink); margin-top: 40px; }
.fig { padding: 26px 26px 26px 0; border-bottom: 1px solid var(--rule); }
.fig + .fig { padding-left: 26px; border-left: 1px solid var(--rule); }
.fig-n { font-family: 'Fraunces', serif; font-weight: 500; font-size: clamp(34px, 4vw, 48px); line-height: 1; letter-spacing: -.02em; color: #3F6569; }
.fig-t { font-size: 15px; line-height: 1.6; color: #4A4945; margin-top: 12px; max-width: 34ch; }
.fig-s { font-size: 12px; color: var(--ink-soft); margin-top: 10px; letter-spacing: .02em; }
@media (max-width: 600px) { .fig + .fig { padding-left: 0; border-left: 0; } }

/* ---------- Principles ---------- */
.princ { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0; border-top: 1px solid var(--ink); }
.princ > div { padding: 30px 30px 34px 0; border-bottom: 1px solid var(--rule); }
.princ > div:nth-child(even) { padding-left: 30px; border-left: 1px solid var(--rule); }
.princ h3 { font-family: 'Fraunces', serif; font-weight: 500; font-size: 24px; margin-bottom: 10px; }
.princ p { font-size: 15.5px; line-height: 1.65; color: #4A4945; max-width: 40ch; }
@media (max-width: 700px) { .princ { grid-template-columns: 1fr; } .princ > div:nth-child(even) { padding-left: 0; border-left: 0; } }

/* ---------- Closing band ---------- */
.close { padding: 96px 0; text-align: center; border-top: 1px solid var(--rule); background: linear-gradient(180deg, var(--paper), #F2EEE4); }
.close h2 { font-family: 'Fraunces', serif; font-weight: 500; font-size: clamp(30px, 4.4vw, 52px); letter-spacing: -.015em; line-height: 1.1; margin-bottom: 30px; }

/* ---------- Plain pages (Contact, Privacy, Terms) ---------- */
.prose p { font-size: 17px; line-height: 1.75; color: #4A4945; max-width: 62ch; margin-bottom: 18px; }
.prose a { color: var(--ink); text-underline-offset: 3px; }
.mail-list { list-style: none; border-top: 1px solid var(--ink); max-width: 640px; }
.mail-list li { display: grid; grid-template-columns: 180px 1fr; gap: 16px; padding: 22px 0; border-bottom: 1px solid var(--rule); align-items: baseline; }
.mail-list span { font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); }
.mail-list a { font-family: 'Fraunces', serif; font-size: clamp(20px, 2.6vw, 26px); color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--rule); }
.mail-list a:hover { border-color: var(--ink); }
@media (max-width: 600px) { .mail-list li { grid-template-columns: 1fr; gap: 6px; } }

/* ---------- Reveal ---------- */
.js-reveal [data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity .8s var(--ease), transform .9s var(--ease); transition-delay: calc(var(--d, 0) * 90ms); }
.js-reveal [data-reveal].is-in { opacity: 1; transform: none; }

/* ---------- Partner pages: the East Wind frame around a partner's own design ---------- */
.pbar { border-bottom: 1px solid var(--rule); background: var(--paper); }
.pbar .wrap { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-top: 12px; padding-bottom: 12px; font-size: 12.5px; color: var(--ink-soft); }
.pbar a { color: var(--ink-soft); text-decoration: none; }
.pbar a:hover { color: var(--ink); }
.pbar b { color: var(--ink); font-weight: 600; }
.pbar-with { display: inline-flex; align-items: center; gap: 8px; }
.pbar-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
@media (max-width: 600px) { .pbar-with { display: none; } }

.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.partners-list { list-style: none; display: flex; flex-wrap: wrap; gap: 0; border-top: 1px solid var(--ink); }
.partners-list li { flex: 1 1 33%; min-width: 220px; padding: 26px 20px 26px 0; border-bottom: 1px solid var(--rule); font-family: 'Fraunces', serif; font-weight: 500; font-size: clamp(22px, 2.6vw, 30px); letter-spacing: -.01em; }
.partners-list a { text-decoration: none; background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size .35s var(--ease); }
.partners-list a:hover { background-size: 100% 1px; }
.partners-list a::after { content: " \2197"; font-size: .6em; color: var(--ink-soft); vertical-align: super; }

.crumb { display: inline-block; font-size: 13px; color: var(--ink-soft); text-decoration: none; margin-bottom: 26px; }
.crumb::before { content: "\2190  "; }
.crumb:hover { color: var(--ink); }
.ph-status { margin-top: 22px; }
.wind-l { stroke-dasharray: 1400; stroke-dashoffset: 1400; animation: wind 3.2s var(--ease) forwards; animation-delay: calc(var(--w, 0) * 220ms + 200ms); }
@keyframes wind { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) { .wind-l { animation: none; stroke-dashoffset: 0; } }

/* Dot field: one dot per child in the study */
.dots-fig { display: grid; grid-template-columns: minmax(0, 480px) 1fr; gap: 48px; align-items: center; margin-top: 36px; }
.dot-grid { width: 100%; display: block; height: auto; }
.dot-grid .d { fill: var(--rule); }
.dot-grid .d.on { fill: #3F6569; }
.js-reveal .dots-fig .d.on { fill: var(--rule); transition: fill .5s ease calc(var(--i) * 8ms); }
.js-reveal .dots-fig.is-in .d.on { fill: #3F6569; }
.dots-key { list-style: none; display: grid; gap: 12px; font-size: 15px; }
.dots-key li { display: flex; gap: 12px; align-items: center; }
.dots-key i { width: 12px; height: 12px; border-radius: 50%; background: #3F6569; flex: none; }
.dots-key li + li i { background: var(--rule); }
.dots-key b { font-family: 'Fraunces', serif; font-weight: 500; font-size: 28px; margin-right: 6px; }
.src-note { font-size: 12.5px; color: var(--ink-soft); margin-top: 22px; }
@media (max-width: 760px) { .dots-fig { grid-template-columns: 1fr; gap: 24px; } }

/* Research list */
.rs-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px 24px; margin-bottom: 10px; }
.rs-head .eyebrow-s { margin: 0; }
.rs-head .category-tabs { margin: 0; }
.report-list { border-top: 1px solid var(--ink); }
.report { display: block; padding: 34px 0 36px; border-bottom: 1px solid var(--rule); text-decoration: none; color: inherit; }
.report[hidden] { display: none; }
.report-tag { font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: #3F6569; }
.report h2 { font-family: 'Fraunces', serif; font-weight: 500; font-size: clamp(26px, 3.4vw, 38px); line-height: 1.15; letter-spacing: -.01em; margin: 12px 0 14px; max-width: 26ch; }
.report p { font-size: 16.5px; line-height: 1.65; color: #4A4945; max-width: 62ch; margin-bottom: 22px; }
.notebook-line { padding: 40px 0; border-bottom: 1px solid var(--rule); font-family: 'Fraunces', serif; font-weight: 500; font-size: 19px; color: var(--ink-soft); }
.notebook-line[hidden] { display: none; }

/* Join */
.routes .route-go { color: var(--ink); font-weight: 600; margin-top: 10px; }
.join-sheet { background: #fff; border: 1px solid var(--rule); border-top: 1px solid var(--ink); padding: 32px 32px 26px; }
.join-sheet .form-group select, .form-group select {
  width: 100%; background: var(--paper); border: 1px solid var(--rule); color: var(--ink); font-family: 'Work Sans', sans-serif;
  font-size: 14.5px; padding: 10px 36px 10px 12px; border-radius: 3px; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%232E2E2C' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
.join-sheet textarea.canvas { font-family: 'Fraunces', serif; font-size: 18px; line-height: 1.6; min-height: 150px; background: #fff; }
.join-sheet .form-feedback.success { background: none; border: 0; padding: 0; font-family: 'Fraunces', serif; font-weight: 500; font-size: 24px; line-height: 1.35; }
@media (max-width: 600px) { .join-sheet { padding: 22px 18px; } }
