/* patrickstabell.com — one stylesheet for index.html and 404.html */

:root {
  --navy: #0f1d35;
  --navy-2: #003b5c;
  --navy-3: #16284a;
  --gold: #d4af37;
  --gold-soft: rgba(212, 175, 55, 0.55);
  --ivory: #f7f4ec;
  --on-navy: #f3efe6;
  --on-navy-muted: #b9c5d6;

  /* page surfaces (light) */
  --bg: #f7f4ec;
  --surface: #ffffff;
  --ink: #0f1d35;
  --muted: #44506a;
  --gold-ink: #7c5e10;
  --rule: #e2dccd;
  --card-border: #e4ded0;
  --shadow: 0 1px 2px rgba(15, 29, 53, 0.06), 0 8px 24px rgba(15, 29, 53, 0.06);

  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;

  --gutter: 20px;
  --max: 1120px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a1424;
    --surface: #111f38;
    --ink: #edeae2;
    --muted: #a9b6ca;
    --gold-ink: #d4af37;
    --rule: #1f3150;
    --card-border: #213555;
    --shadow: none;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1.0625rem/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, p, dl, dd, figure, blockquote, ul { margin: 0; }
ul { padding: 0; list-style: none; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 10;
  background: var(--gold); color: var(--navy); padding: 10px 14px;
  border-radius: 8px; font-weight: 600; text-decoration: none;
}
.skip:focus { top: 12px; }

:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 4px; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  color: var(--on-navy);
  background:
    radial-gradient(120% 80% at 85% 0%, rgba(0, 59, 92, 0.95) 0%, rgba(0, 59, 92, 0) 60%),
    var(--navy);
  padding-bottom: 28px;
}
.hero::before { /* blueprint grid, fading out */
  content: "";
  position: absolute; inset: 0; z-index: -1;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 36px 36px;
  -webkit-mask-image: radial-gradient(120% 90% at 70% 20%, #000 20%, transparent 75%);
          mask-image: radial-gradient(120% 90% at 70% 20%, #000 20%, transparent 75%);
}

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 0 8px;
}
.mark { display: inline-flex; border-radius: 9px; }
.mark img { width: 36px; height: 36px; }
.toplinks { display: flex; gap: 4px; }
.toplinks a {
  display: inline-block; padding: 10px 10px;
  font: 500 0.78rem/1 var(--mono); letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--on-navy-muted); text-decoration: none;
}
.toplinks a:hover { color: var(--gold); }

/* Phones and tablets: photo stacked above the name, so the name keeps one line. */
.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-areas:
    "photo"
    "title"
    "copy";
  padding-top: 22px;
}
.hero-title { grid-area: title; min-width: 0; }
.portrait { grid-area: photo; width: clamp(136px, 40vw, 208px); margin-bottom: 26px; }
.hero-copy { grid-area: copy; padding-top: 22px; }

.eyebrow {
  font: 500 0.72rem/1.4 var(--mono);
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 10px;
}
h1 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.005em;
  color: var(--on-navy);
}
/* "Patrick Stabell" always on one line; the vw term keeps it inside 320px screens */
.hero-title h1 {
  font-size: clamp(2rem, 10.5vw, 4rem);
  white-space: nowrap;
}

.portrait { position: relative; }
.portrait img { /* the gold border sits on the photo's own edge */
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: 50% 50%;
  border: 2px solid var(--gold);
  border-radius: 18px;
  background: var(--navy-3);
  box-shadow: 0 24px 48px -24px rgba(0, 0, 0, 0.65);
}

.kicker {
  display: flex; flex-direction: column; gap: 2px;
  margin-bottom: 18px;
}
.k-policy {
  font: 500 clamp(1.35rem, 5vw, 1.95rem)/1.2 var(--serif);
  font-style: italic;
  color: var(--gold);
}
.k-policy em { font-style: italic; }
.k-code {
  font: 500 clamp(1.1rem, 4.6vw, 1.6rem)/1.3 var(--mono);
  color: var(--on-navy);
  letter-spacing: -0.01em;
}
.caret {
  display: inline-block;
  width: 0.55em; height: 1.05em;
  margin-left: 0.12em;
  vertical-align: -0.16em;
  background: var(--gold);
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.summary {
  max-width: 36rem;
  color: var(--on-navy-muted);
  font-size: 1.02rem;
  line-height: 1.6;
}
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 12px 22px;
  border-radius: 999px;
  font: 600 0.95rem/1 var(--sans);
  text-decoration: none;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease, transform .2s ease;
}
.btn-gold { background: var(--gold); color: var(--navy); }
.btn-gold:hover { background: #e3c25a; transform: translateY(-1px); }
.btn-line { border: 1.5px solid rgba(243, 239, 230, 0.4); color: var(--on-navy); }
.btn-line:hover { border-color: var(--gold); color: var(--gold); }

.ledger {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 20px;
  margin-top: 40px;
  padding-top: 22px;
  border-top: 1px solid rgba(212, 175, 55, 0.35);
}
.ledger dt {
  font: 500 0.68rem/1.3 var(--mono);
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 4px;
}
.ledger dd {
  font: 500 1.18rem/1.25 var(--serif);
  color: var(--on-navy);
}

/* entrance */
@media (prefers-reduced-motion: no-preference) {
  .hero-title, .portrait, .hero-copy, .ledger {
    animation: rise .8s cubic-bezier(.2, .7, .2, 1) both;
  }
  .portrait { animation-delay: .08s; }
  .hero-copy { animation-delay: .16s; }
  .ledger { animation-delay: .26s; }
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .caret { animation: none; }
  *, *::before, *::after { transition: none !important; }
}

/* ---------- Sections ---------- */
section { padding: 64px 0; }
.section-head { margin-bottom: 28px; }
.label {
  display: flex; align-items: center; gap: 10px;
  font: 500 0.72rem/1 var(--mono);
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--gold-ink);
  margin-bottom: 14px;
}
.label span {
  display: inline-grid; place-items: center;
  min-width: 30px; height: 22px; padding: 0 6px;
  border: 1px solid currentColor; border-radius: 999px;
  letter-spacing: 0.04em;
}
h2 {
  font: 600 clamp(2.1rem, 7vw, 3.4rem)/1.02 var(--serif);
  letter-spacing: -0.01em;
}
.lede { margin-top: 12px; color: var(--muted); max-width: 38rem; }

/* story */
.prose { max-width: 40rem; }
.prose p + p { margin-top: 1.05em; }
.prose p { color: var(--ink); }
.quote {
  margin-top: 36px;
  padding: 26px 0 0;
  border-top: 1px solid var(--rule);
}
.quote p {
  position: relative;
  font: 500 clamp(1.7rem, 6vw, 2.4rem)/1.15 var(--serif);
  font-style: italic;
  color: var(--ink);
  padding-left: 0.1em;
}
.quote p::before {
  content: "\201C";
  display: block;
  font: 600 4rem/0.6 var(--serif);
  font-style: normal;
  color: var(--gold);
  margin-bottom: 10px;
}
.quote footer {
  margin-top: 14px;
  font: 500 0.72rem/1.4 var(--mono);
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--muted);
}

/* work */
.work { background: var(--surface); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
@media (prefers-color-scheme: dark) { .work { background: #0d1a30; } }
.group {
  font: 500 0.72rem/1 var(--mono);
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted);
  margin: 34px 0 14px;
  display: flex; align-items: center; gap: 12px;
}
.group::after { content: ""; flex: 1; height: 1px; background: var(--rule); }
.cards { display: grid; gap: 14px; }
.card {
  position: relative;
  display: flex; flex-direction: column;
  height: 100%;
  padding: 22px 22px 20px;
  background: var(--bg);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  text-decoration: none;
  transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}
.card::before { /* gold top hairline grows on hover */
  content: "";
  position: absolute; left: 22px; right: 22px; top: -1px; height: 2px;
  background: var(--gold);
  transform: scaleX(0.18); transform-origin: left;
  transition: transform .35s ease;
}
.card:hover { border-color: var(--gold-soft); transform: translateY(-2px); box-shadow: var(--shadow); }
.card:hover::before, .card:focus-visible::before { transform: scaleX(1); }
.kind {
  font: 500 0.68rem/1.4 var(--mono);
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--gold-ink);
}
.name {
  margin-top: 10px;
  font: 600 1.85rem/1.05 var(--serif);
  color: var(--ink);
}
.card-feature {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--on-navy);
}
.card-feature .kind { color: var(--gold); }
.card-feature .name { color: var(--on-navy); font-size: clamp(2.1rem, 7vw, 3rem); }
.card-feature .desc { color: var(--on-navy-muted); font-size: 1.05rem; max-width: 34rem; }
.card-feature .url { color: var(--on-navy); }
.card-feature .arrow { color: var(--gold); }
.card-feature:hover { border-color: var(--gold); }
@media (prefers-color-scheme: dark) {
  .card-feature { background: #13284a; border-color: rgba(212, 175, 55, 0.45); }
}
.badge {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  vertical-align: 1px;
  white-space: nowrap;
}
.desc { margin-top: 10px; color: var(--muted); font-size: 0.98rem; line-height: 1.55; flex: 1; }
.url {
  margin-top: 18px;
  font: 500 0.8rem/1 var(--mono);
  color: var(--ink);
  display: inline-flex; align-items: center; gap: 8px;
}
.arrow { display: inline-block; color: var(--gold-ink); transition: transform .2s ease; }
.card:hover .arrow, .links a:hover .arrow { transform: translateX(4px); }

/* contact */
.links { border-top: 1px solid var(--rule); }
.links li { border-bottom: 1px solid var(--rule); }
.links a {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "for arrow" "name arrow";
  align-items: center;
  column-gap: 12px;
  padding: 16px 2px;
  min-height: 64px;
  text-decoration: none;
  font: 600 1.45rem/1.15 var(--serif);
}
.links a:hover { color: var(--gold-ink); }
.links .for {
  grid-area: for;
  font: 500 0.68rem/1.4 var(--mono);
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}
.links .nm { grid-area: name; }
.nw { white-space: nowrap; }
.links .arrow { grid-area: arrow; font-family: var(--sans); font-size: 1.1rem; }

/* footer */
.site-footer { padding: 28px 0 40px; color: var(--muted); font-size: 0.9rem; }
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; }
.coords { font: 500 0.72rem/1.6 var(--mono); letter-spacing: 0.1em; }

/* ---------- Brand marks ---------- */
/* Flex, not grid, so a short last row is centered (5 marks: 2+2+1 on phones, 3+2 wider). */
.marks { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }
.marks > li { flex: 0 0 calc((100% - 14px) / 2); min-width: 0; }
.marks figure {
  margin: 0;
  height: 100%;
  display: flex; flex-direction: column;
  overflow: hidden;
  background: #ffffff; /* the marks are drawn for white, in both color schemes */
  border: 1px solid var(--card-border);
  border-radius: 14px;
}
.marks img { display: block; width: 100%; height: auto; }
.marks figcaption {
  flex: 1;
  padding: 10px 12px;
  font: 500 0.66rem/1.4 var(--mono);
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted);
  background: var(--bg);
  border-top: 1px solid var(--card-border);
}

/* ---------- Larger screens ---------- */
@media (min-width: 640px) {
  :root { --gutter: 32px; }
  .ledger { grid-template-columns: repeat(4, 1fr); }
  .cards-4 { grid-template-columns: repeat(2, 1fr); }
  .marks > li { flex-basis: calc((100% - 28px) / 3); }
  .card { padding: 28px 28px 24px; }
}
@media (min-width: 900px) {
  :root { --gutter: 40px; }
  .hero { padding-bottom: 40px; }
  .hero-grid {
    grid-template-columns: 1.25fr 0.75fr;
    grid-template-areas:
      "title photo"
      "copy  photo";
    column-gap: 56px;
    align-items: end;
    padding-top: 48px;
  }
  .hero-title { align-self: end; }
  .hero-copy { align-self: start; }
  .portrait { max-width: 360px; justify-self: end; align-self: center; width: 100%; margin-bottom: 0; }
  .hero-title h1 { font-size: clamp(3.2rem, 5.4vw, 4.5rem); }
  .hero-copy { padding-top: 26px; }
  .portrait img { border-radius: 24px; }
  .eyebrow { font-size: 0.8rem; letter-spacing: 0.14em; margin-bottom: 18px; }
  .ledger { margin-top: 64px; }
  .ledger dd { font-size: 1.35rem; }
  section { padding: 104px 0; }
  .story-grid {
    display: grid;
    grid-template-columns: 1fr 1.25fr;
    grid-template-areas:
      "head prose"
      "quote prose";
    grid-template-rows: auto 1fr;
    column-gap: 72px;
    align-items: start;
  }
  .story-grid .section-head { grid-area: head; }
  .story-grid .prose { grid-area: prose; font-size: 1.12rem; }
  .story-grid .quote { grid-area: quote; margin-top: 8px; align-self: start; }
  .card-feature { padding: 40px 44px 34px; }
  .contact-grid {
    display: grid; grid-template-columns: 1fr 1.1fr; column-gap: 72px; align-items: start;
  }
  .links a { font-size: 1.7rem; padding: 20px 4px; }
}

/* ---------- 404 ---------- */
.nf { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; padding-bottom: 40px; }
.nf .nf-body { flex: 1; display: flex; flex-direction: column; justify-content: center; padding-top: 48px; padding-bottom: 48px; }
.nf h1 { font-size: clamp(2.6rem, 10vw, 5rem); }
.nf .summary { margin-top: 18px; }
