/* Tidewater Labs — design-language study in the Anthropic idiom.
   Warm paper, one grotesque + one serif, tinted panels, hairline rules. */

:root {
  --paper: #f0eee6;
  --ink: #141413;
  --ink-soft: #33312d;
  --panel: #e7e1d2;
  --muted: #6f6b60;
  --muted-dark: #b8b4a9;   /* muted on ink */
  --rule: #d7d2c3;
  --rule-panel: #cfc8b6;
  --rule-dark: #3a3833;
  --tide: #33625c;         /* the one accent — used sparingly */
  --sans: "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif;
  --serif: "Source Serif 4", Georgia, serif;
  --mono: "IBM Plex Mono", "Courier New", monospace;
  --pad: clamp(20px, 5.4vw, 78px);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: #d9cfb6; }

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

a { color: inherit; text-decoration: none; }

.container {
  max-width: 1440px;
  margin-inline: auto;
  padding-inline: var(--pad);
}

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

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

/* ---------- nav ---------- */

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}

.wordmark {
  font-weight: 700;
  font-size: 19px;
  letter-spacing: 0.05em;
  white-space: nowrap;
}
.wordmark .tilde { color: var(--ink); font-weight: 700; }
.wordmark:hover .tilde { color: var(--tide); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 30px;
  list-style: none;
}
.nav-links a:not(.btn) {
  font-size: 15px;
  font-weight: 450;
  padding: 4px 0;
  border-bottom: 1.5px solid transparent;
  transition: border-color 0.18s ease;
}
.nav-links a:not(.btn):hover { border-bottom-color: var(--ink); }

.nav-toggle {
  display: none;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 10px;
  margin-right: -10px;
}
.nav-toggle .bar {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--ink);
  margin: 5px 0;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

/* mobile drawer */
.drawer {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 60;
  background: var(--paper);
  padding: 0 var(--pad) 32px;
  overflow-y: auto;
}
.drawer.open { display: block; }
.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}
.drawer-close {
  background: none;
  border: 0;
  cursor: pointer;
  font-size: 15px;
  font-weight: 500;
  font-family: var(--sans);
  padding: 10px;
  margin-right: -10px;
  color: var(--ink);
}
.drawer-links { list-style: none; margin-top: 20px; }
.drawer-links li { border-bottom: 1px solid var(--rule); }
.drawer-links a {
  display: block;
  padding: 20px 0;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.drawer-links a:hover { color: var(--tide); }
.drawer .btn { margin-top: 32px; }

body.drawer-locked { overflow: hidden; }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--ink);
  color: var(--paper);
  border: 0;
  border-radius: 999px;
  padding: 11px 20px;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.18s ease;
}
.btn .arr { transition: transform 0.18s ease; }
.btn:hover { background: var(--ink-soft); }
.btn:hover .arr { transform: translateX(3px); }

.btn-light { background: var(--paper); color: var(--ink); }
.btn-light:hover { background: #ffffff; }
.btn-light:focus-visible { outline-color: var(--paper); }

/* ---------- hero ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 7.2fr) minmax(0, 4.8fr);
  gap: clamp(32px, 5vw, 96px);
  align-items: center;
  padding-block: clamp(56px, 9vw, 128px) clamp(48px, 7vw, 104px);
}

.hero h1 {
  font-size: clamp(38px, 5.5vw, 80px);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.022em;
}
.hero h1 .u {
  text-decoration: underline;
  text-decoration-thickness: 0.05em;
  text-underline-offset: 0.14em;
}

.hero-lede {
  font-family: var(--serif);
  font-size: clamp(19px, 1.7vw, 24px);
  line-height: 1.5;
  max-width: 34ch;
}

/* entrance */
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}
.hero > * { animation: rise 0.65s cubic-bezier(0.2, 0.6, 0.2, 1) both; }
.hero > :nth-child(2) { animation-delay: 0.12s; }

/* ---------- dark panel ---------- */

.dark-panel {
  background: var(--ink);
  color: var(--paper);
  border-radius: 24px;
  padding: clamp(72px, 9vw, 128px) clamp(24px, 4vw, 56px);
  text-align: center;
}
.dark-panel h2 {
  font-family: var(--serif);
  font-weight: 450;
  font-size: clamp(34px, 4.4vw, 62px);
  line-height: 1.12;
  letter-spacing: -0.01em;
  max-width: 22ch;
  margin-inline: auto;
}
.dark-panel p {
  font-size: 17px;
  line-height: 1.55;
  max-width: 58ch;
  margin: 26px auto 0;
  color: #e6e3da;
}
.dark-panel .btn { margin-top: 34px; }

/* ---------- releases / cards ---------- */

.section { padding-block: clamp(64px, 8vw, 112px) 0; }

.section-title {
  font-size: 23px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 28px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 26px;
}

.card {
  background: var(--panel);
  border-radius: 10px;
  padding: 24px 24px 26px;
  display: flex;
  flex-direction: column;
  min-height: 430px;
}
.card h3 {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.012em;
  line-height: 1.25;
}
.card .card-body {
  font-family: var(--serif);
  font-size: 16.5px;
  line-height: 1.55;
  margin-top: 13px;
}
.card .card-more {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 14px;
  font-size: 14.5px;
  font-weight: 500;
  width: fit-content;
  border-bottom: 1.5px solid transparent;
  transition: border-color 0.18s ease;
}
.card .card-more:hover { border-bottom-color: var(--ink); }

.card-meta { margin-top: auto; padding-top: 56px; }
.meta-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--rule-panel);
  padding: 12px 2px;
}
.meta-row dt {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.meta-row dd { font-family: var(--serif); font-size: 15px; }
.card .btn { margin-top: 18px; width: fit-content; }

/* ---------- index list ---------- */

.index-section {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  gap: clamp(40px, 6vw, 96px);
  padding-block: clamp(64px, 8vw, 112px) clamp(80px, 10vw, 136px);
}

.index-statement {
  font-size: 22px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.012em;
  max-width: 24ch;
}

.index-list { list-style: none; }
.index-list a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  padding: 17px 0;
  border-bottom: 1px solid var(--rule);
}
.index-list li:first-child a { border-top: 1px solid var(--rule); }
.index-list .index-title {
  font-size: 15.5px;
  font-weight: 500;
  border-bottom: 1.5px solid transparent;
  transition: border-color 0.18s ease;
}
.index-list a:hover .index-title { border-bottom-color: var(--ink); }
.index-list .index-cat {
  font-size: 14px;
  color: var(--muted);
  flex-shrink: 0;
}

/* ---------- interior hero variant ---------- */

.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 22px;
}

/* ---------- prose page (stub / 404) ---------- */

.prose-hero {
  padding-block: clamp(80px, 14vw, 180px) clamp(96px, 14vw, 200px);
  max-width: 780px;
}
.prose-hero h1 {
  font-family: var(--serif);
  font-weight: 450;
  font-size: clamp(36px, 5vw, 64px);
  line-height: 1.12;
  letter-spacing: -0.01em;
}
.prose-hero p {
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink-soft);
  max-width: 52ch;
  margin-top: 24px;
}
.prose-hero .btn { margin-top: 32px; }
.prose-hero .text-link {
  font-weight: 500;
  border-bottom: 1.5px solid var(--ink);
  transition: color 0.18s ease, border-color 0.18s ease;
}
.prose-hero .text-link:hover { color: var(--tide); border-color: var(--tide); }

/* ---------- footer ---------- */

.footer {
  background: var(--ink);
  color: var(--muted-dark);
  margin-top: clamp(56px, 8vw, 96px);
  padding: clamp(64px, 8vw, 96px) 0 44px;
  font-size: 13px;
}
.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) repeat(4, minmax(0, 1fr));
  gap: 40px;
}
.footer-mark svg { width: 52px; height: auto; }
.footer h4 {
  color: var(--paper);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 14px;
}
.footer h4 + ul + h4 { margin-top: 30px; }
.footer ul { list-style: none; }
.footer ul a {
  display: inline-block;
  padding: 4.5px 0;
  transition: color 0.15s ease;
}
.footer ul a:hover { color: #ffffff; text-decoration: underline; text-underline-offset: 3px; }
.footer ul a:focus-visible { outline-color: var(--paper); }
.footer-bottom {
  margin-top: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  color: #8b877c;
  font-size: 12.5px;
}

/* ---------- responsive ---------- */

@media (max-width: 1024px) {
  .cards { gap: 20px; }
  .card { min-height: 400px; }
}

@media (max-width: 900px) {
  .nav-links { display: none; }
  .nav-toggle { display: block; }

  .hero { grid-template-columns: 1fr; align-items: start; }
  .hero-lede { max-width: 46ch; }

  .cards { grid-template-columns: 1fr; }
  .card { min-height: 0; }
  .card-meta { padding-top: 40px; }

  .index-section { grid-template-columns: 1fr; gap: 28px; }
  .index-statement { max-width: 30ch; }

  .footer-grid { grid-template-columns: 1fr 1fr; gap: 36px 28px; }
  .footer-mark { grid-column: 1 / -1; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 640px) {
  .index-list a { display: block; padding: 15px 0; }
  .index-list .index-cat { display: block; margin-top: 5px; }
}

@media (max-width: 560px) {
  .footer-grid { grid-template-columns: 1fr; }
  .dark-panel { border-radius: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
