/* ==========================================================================
   CURRENT — shared styles
   1. Tokens   2. Base   3. Layout   4. Type   5. Header / footer
   6. Buttons & links   7. Photo   9. Tiles   13. Motion
   ========================================================================== */

/* 1. Tokens ---------------------------------------------------------------- */
:root {
  --cream: #f5f0e4;
  --paper: #fbf8f1;
  --sand: #e9e1cf;
  --navy: #0e2238;
  --ink-2: #34465b;
  --muted: #5d6a7a;
  --rule: rgba(14, 34, 56, 0.16);
  --rule-strong: rgba(14, 34, 56, 0.45);

  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  --gutter: clamp(1.25rem, 4vw, 3rem);
  --max: 82rem;
  --section: clamp(4.5rem, 9vw, 8.5rem);
  --gap: clamp(0.75rem, 1.5vw, 1.25rem);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* 2. Base ------------------------------------------------------------------ */
*,
*::before,
*::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--cream);
  color: var(--navy);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
a { color: inherit; }
h1, h2, h3, p, dl, dd, figure, ul { margin: 0; padding: 0; }
ul { list-style: none; }

:focus-visible { outline: 2px solid var(--navy); outline-offset: 3px; }
.hero :focus-visible, .band :focus-visible, .tile:focus-visible, .site-footer :focus-visible { outline-color: var(--cream); }

.skip-link {
  position: absolute; left: var(--gutter); top: -4rem;
  background: var(--navy); color: var(--cream);
  padding: 0.6rem 1rem; z-index: 20;
}
.skip-link:focus { top: 0.75rem; }

/* 3. Layout ---------------------------------------------------------------- */
.container { width: min(100% - 2 * var(--gutter), var(--max)); margin-inline: auto; }
.section { padding-block: var(--section); }
.section--flush-top { padding-top: var(--gap); }

.section__head {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: 2rem;
  row-gap: 1rem;
  margin-bottom: clamp(2rem, 4vw, 3.5rem);
  align-items: end;
}
.section__head > .eyebrow { grid-column: 1 / -1; }
.section__head > h2 { grid-column: 1 / span 8; }
.section__head > .section__aside { grid-column: 9 / -1; justify-self: end; }
@media (max-width: 52rem) {
  .section__head > h2, .section__head > .section__aside { grid-column: 1 / -1; justify-self: start; }
}

/* Thin chart-scale tick ruler: the one nautical detail, used in the footer only */
.scale {
  height: 9px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='9'%3E%3Cpath d='M.5 0v9M12.5 0v4M24.5 0v4M36.5 0v4M48.5 0v4' stroke='%230E2238' stroke-opacity='.4' fill='none'/%3E%3C/svg%3E");
  background-repeat: repeat-x;
}

/* 4. Type ------------------------------------------------------------------ */
.display-1,
.display-2,
.display-3 {
  font-family: var(--serif);
  font-weight: 350;
  letter-spacing: -0.02em;
  text-wrap: balance;
  font-optical-sizing: auto;
}
.display-1 { font-size: clamp(3.4rem, 8vw, 8.25rem); line-height: 0.94; letter-spacing: -0.035em; }
.display-2 { font-size: clamp(2.1rem, 4.2vw, 3.6rem); line-height: 1.05; }
.display-3 { font-size: clamp(2.2rem, 4vw, 3.9rem); line-height: 1; }
.display-1 em,
.display-2 em { font-style: italic; font-weight: 300; }

.eyebrow {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.lede { font-size: clamp(1.05rem, 1.4vw, 1.2rem); line-height: 1.5; max-width: 32rem; }
.small { font-size: 0.875rem; color: var(--muted); }
.label { font-size: 0.6875rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }

/* 5. Header / footer ------------------------------------------------------- */
.site-header { position: relative; border-bottom: 1px solid var(--rule); }
.site-header__inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 5rem; gap: 2rem;
}

.wordmark {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 500;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  text-decoration: none;
}

.nav { display: flex; align-items: center; gap: clamp(1.25rem, 2.6vw, 2.25rem); font-size: 0.9375rem; }
.nav a { text-decoration: none; padding-block: 0.25rem; border-bottom: 1px solid transparent; }
.nav a:not(.btn):hover,
.nav a[aria-current="page"] { border-bottom-color: currentColor; }
.nav__soon { opacity: 0.55; cursor: default; }
.nav .btn { padding: 0.6rem 1.15rem; font-size: 0.875rem; }

.nav-toggle {
  display: none;
  background: none; border: 0; padding: 0.5rem 0;
  font: inherit; font-size: 0.9375rem; color: inherit; cursor: pointer;
}

@media (max-width: 52rem) {
  .nav-toggle { display: inline-flex; }
  .nav {
    display: none;
    position: absolute; top: 100%; left: 0; right: 0; z-index: 10;
    flex-direction: column; align-items: flex-start; gap: 0.25rem;
    padding: 1rem var(--gutter) 1.5rem;
    background: var(--cream); color: var(--navy);
    border-bottom: 1px solid var(--rule);
    font-size: 1.125rem;
  }
  .nav.is-open { display: flex; }
  .nav a { padding-block: 0.5rem; }
  .nav .btn { margin-top: 0.75rem; }
}

.site-footer { border-top: 1px solid var(--rule); padding-block: 3rem 2.5rem; }
.site-footer__row {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 1.5rem 3rem;
}
.site-footer__links { display: flex; flex-wrap: wrap; gap: 0.5rem 2rem; font-size: 0.9375rem; }
.site-footer__links a { text-decoration: none; }
.site-footer__links a:hover { text-decoration: underline; text-underline-offset: 3px; }
.site-footer__note { margin-top: 2rem; }
.site-footer .scale { margin-top: 2.5rem; }

/* 6. Buttons & links ------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.6rem;
  padding: 1rem 1.7rem;
  border: 1px solid var(--navy);
  border-radius: 2px;
  background: var(--navy); color: var(--cream);
  font: inherit; font-size: 0.9375rem; font-weight: 500;
  text-decoration: none; cursor: pointer;
  transition: background 0.25s, color 0.25s, border-color 0.25s;
}
.btn:hover { background: transparent; color: var(--navy); }
.btn--ghost { background: transparent; color: var(--navy); }
.btn--ghost:hover { background: var(--navy); color: var(--cream); }
.btn--light { background: var(--cream); color: var(--navy); border-color: var(--cream); }
.btn--light:hover { background: transparent; color: var(--cream); }
.btn--ghost-light { background: transparent; color: var(--cream); border-color: rgba(245, 240, 228, 0.6); }
.btn--ghost-light:hover { background: var(--cream); color: var(--navy); border-color: var(--cream); }

.link-arrow {
  display: inline-flex; gap: 0.5rem; align-items: baseline;
  font-weight: 500; text-decoration: none;
  border-bottom: 1px solid var(--rule-strong); padding-bottom: 0.15rem;
  transition: border-color 0.2s;
}
.link-arrow span { transition: transform 0.25s var(--ease); }
.link-arrow:hover span { transform: translateX(4px); }
.link-arrow:hover { border-bottom-color: currentColor; }

/* Identity-verified tick (inline SVG from script.js) */
.verified { flex: none; width: 0.95em; height: 0.95em; }
.verified circle { fill: currentColor; }
.verified path { fill: none; stroke: var(--paper); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* 7. Photo ------------------------------------------------------------------
   Each photo slot is an <img> pointing at a named file in images/. Behind it
   sits a tonal placeholder that shows the filename. If the file is missing the
   <img> hides itself (onerror) and the placeholder stays; add the file and it
   appears with no code changes. */
.photo__frame {
  position: relative; overflow: hidden;
  aspect-ratio: var(--ratio, 3 / 2);
  background: var(--ph, #1b3550);
}
.photo__media {
  position: absolute; inset: 0;
  transition: transform 1.2s var(--ease);
}
.photo__media img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: var(--pos, center);
  color: transparent;
}
.photo__ph {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; justify-content: flex-end; gap: 0.1rem;
  padding: 1rem 1.15rem;
  color: var(--ph-ink, rgba(245, 240, 228, 0.7));
  font-size: 0.6875rem; letter-spacing: 0.12em; text-transform: uppercase;
}
.photo__ph span:last-child { font-size: 0.75rem; letter-spacing: 0.02em; text-transform: none; opacity: 0.85; }
/* a faint horizon so an empty frame still reads as sea */
.photo__ph::before {
  content: ""; position: absolute; left: 0; right: 0; top: 56%;
  border-top: 1px solid currentColor; opacity: 0.22;
}
/* flat tint (not a gradient) to keep text legible over any photo */
.photo__scrim { position: absolute; inset: 0; background: var(--navy); opacity: var(--scrim, 0); pointer-events: none; }

/* 9. Tiles: People / Skills / Boats ---------------------------------------- */
.tiles {
  display: grid; grid-template-columns: repeat(12, 1fr); grid-template-rows: 1fr 1fr;
  gap: var(--gap);
  height: clamp(34rem, 62vw, 54rem);
}
.tile {
  position: relative; display: block; overflow: hidden; min-height: 0;
  color: var(--cream); text-decoration: none;
}
.tile--people { grid-column: 1 / span 7; grid-row: 1 / span 2; }
.tile--skills { grid-column: 8 / -1; grid-row: 1; }
.tile--boats  { grid-column: 8 / -1; grid-row: 2; }
.tile .photo__frame { position: absolute; inset: 0; aspect-ratio: auto; --scrim: 0.4; }
.tile:hover .photo__media { transform: scale(1.045); }
.tile .photo__ph { justify-content: flex-start; padding-top: 1.15rem; }
.tile .photo__ph::before { display: none; }

.tile__text {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  padding: clamp(1.25rem, 3vw, 2.5rem);
  display: grid; gap: 0.6rem; justify-items: start;
}
.tile__line { font-size: clamp(1rem, 1.3vw, 1.15rem); max-width: 22rem; line-height: 1.4; }
.tile__more { font-size: 0.9375rem; font-weight: 500; border-bottom: 1px solid rgba(245, 240, 228, 0.6); padding-bottom: 0.1rem; transition: border-color 0.2s; }
.tile__more span { display: inline-block; transition: transform 0.25s var(--ease); }
.tile:hover .tile__more { border-bottom-color: var(--cream); }
.tile:hover .tile__more span { transform: translateX(5px); }

@media (max-width: 52rem) {
  .tiles { display: flex; flex-direction: column; height: auto; }
  .tile { aspect-ratio: 4 / 4.4; }
  .tile--skills, .tile--boats { aspect-ratio: 4 / 3.2; }
}

/* Simple text pages (stubs) */
.page-intro { padding-block: clamp(3rem, 7vw, 6rem); max-width: 46rem; display: grid; gap: 1.5rem; justify-items: start; }
.page-intro .lede { color: var(--ink-2); }

/* Photo credits list */
.credits { display: grid; gap: 1.25rem; margin-top: 1rem; width: 100%; }
.credits li { padding-top: 1rem; border-top: 1px solid var(--rule); }
.credits p { margin-top: 0.25rem; }
.credits a { text-underline-offset: 3px; }

/* 13. Motion --------------------------------------------------------------- */
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.rise { opacity: 0; animation: rise 1s var(--ease) forwards; animation-delay: calc(var(--i, 0) * 120ms); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rise { opacity: 1; animation: none; }
  * { transition: none !important; }
}
