/* ---------------------------------------------------------------
   chriseckhout.com
   Warm modern editorial. Palette derived from FamJet's own brand
   (navy #2D3A5F, cyan #0891B2, terracotta #cb6432), shifted for
   text contrast on a warm paper ground.
   --------------------------------------------------------------- */

:root {
  --paper:      #FBFAF8;
  --paper-sunk: #F3F1EC;
  --ink:        #1E2A47;
  --ink-soft:   #2D3A5F;
  --muted:      #5C6370;
  --rule:       #E2DED5;
  --rule-firm:  #CFC9BC;
  --accent:     #0E7490;
  --accent-bright: #0891B2;
  --warm:       #B4541F;
  --warm-bright:#CB6432;

  --sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --measure: 36rem;
  --gutter: 9.5rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper:      #14181F;
    --paper-sunk: #1B212B;
    --ink:        #ECE9E3;
    --ink-soft:   #D6D2CA;
    --muted:      #9BA3B0;
    --rule:       #2B323E;
    --rule-firm:  #3C4552;
    --accent:     #5AC4DA;
    --accent-bright: #7AD4E6;
    --warm:       #E28C5C;
    --warm-bright:#EFA274;
  }
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---------- shell ---------- */

.wrap {
  max-width: 68rem;
  margin: 0 auto;
  padding-inline: 1.5rem;
}

@media (max-width: 34rem) {
  .wrap { padding-inline: 1.25rem; }
  body { font-size: 16px; }
}

/* ---------- masthead ---------- */

.masthead {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}

.masthead__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.4rem 1.5rem;
  padding-block: 1.05rem;
}

.wordmark {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.0625rem;
  letter-spacing: 0.005em;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}

.wordmark:hover { color: var(--accent); }

.nav {
  display: flex;
  gap: 1.5rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

@media (max-width: 30rem) {
  .masthead__inner { column-gap: 1rem; }
  .nav { gap: 0.65rem; font-size: 0.6875rem; letter-spacing: 0.02em; }
  .wordmark { font-size: 0.875rem; }
}

.nav a {
  color: var(--muted);
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
}

.nav a:hover { color: var(--ink); border-bottom-color: var(--accent); }
.nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--warm-bright); }

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

.hero { padding-block: 5.5rem 4rem; }

@media (max-width: 48rem) { .hero { padding-block: 3.5rem 2.5rem; } }

.eyebrow {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 1.75rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.eyebrow::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--rule);
  max-width: 7rem;
}

h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2.25rem, 6.2vw, 4rem);
  line-height: 1.04;
  letter-spacing: -0.021em;
  margin: 0 0 1.75rem;
  max-width: 19ch;
  font-variation-settings: "SOFT" 20, "WONK" 1;
}

h1 em {
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
}

.lede {
  font-size: 1.1875rem;
  line-height: 1.6;
  color: var(--ink-soft);
  max-width: var(--measure);
  margin: 0 0 2.25rem;
}

@media (max-width: 34rem) { .lede { font-size: 1.0625rem; } }

.lede strong { font-weight: 600; color: var(--ink); }

/* ---------- inline links ---------- */

a.link {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  padding-bottom: 1px;
  transition: border-color 0.15s ease;
}

a.link:hover { border-bottom-color: var(--accent); }

.meta-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.25rem;
  font-family: var(--mono);
  font-size: 0.8125rem;
  letter-spacing: 0.01em;
}

.meta-links a {
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: 1px solid var(--rule-firm);
  padding-bottom: 2px;
}

.meta-links a:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* ---------- figures band ---------- */

.figures {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border-top: 1px solid var(--rule-firm);
  border-bottom: 1px solid var(--rule);
  margin-bottom: 1rem;
}

.figure { padding: 1.75rem 1.25rem; border-right: 1px solid var(--rule); }
.figure:first-child { padding-left: 0; }
.figure:last-child { border-right: 0; }

@media (max-width: 52rem) {
  .figures { grid-template-columns: repeat(2, 1fr); }
  .figure:nth-child(2n) { border-right: 0; }
  .figure:nth-child(-n+2) { border-bottom: 1px solid var(--rule); }
  .figure { padding-inline: 1rem; }
  .figure:nth-child(2n+1) { padding-left: 0; }
  .figure:nth-child(2n) { padding-right: 0; }
}

@media (max-width: 34rem) {
  .figure { padding-block: 1.25rem; }
  .figure__num { font-size: 2.125rem; }
  .figure__label { font-size: 0.8125rem; }
}

@media (max-width: 19rem) {
  .figures { grid-template-columns: 1fr; }
  .figure, .figure:nth-child(2n) { border-right: 0; border-bottom: 1px solid var(--rule); padding-inline: 0; }
  .figure:last-child { border-bottom: 0; }
}

.figure__num {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 2.5rem;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--ink);
  display: block;
  margin-bottom: 0.6rem;
  font-variation-settings: "SOFT" 20;
}

.figure__num .approx { color: var(--warm); font-size: 0.6em; vertical-align: 0.28em; margin-right: 0.04em; }

.figure__label {
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--muted);
  margin: 0;
  max-width: 17ch;
}

/* ---------- sections ---------- */

.section {
  display: grid;
  grid-template-columns: var(--gutter) minmax(0, 1fr);
  gap: 2.5rem;
  padding-block: 3.75rem;
  border-top: 1px solid var(--rule);
}

.section:first-of-type,
.figures + .section { border-top: 0; }

@media (max-width: 52rem) {
  .section { grid-template-columns: 1fr; gap: 1.5rem; padding-block: 2.75rem; }
}

.section__label {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0.45rem 0 0;
  position: sticky;
  top: 5rem;
  align-self: start;
}

@media (max-width: 52rem) {
  .section__label { position: static; margin: 0; }
  .section__label::after {
    content: "";
    display: block;
    width: 2rem;
    height: 1px;
    background: var(--warm-bright);
    margin-top: 0.6rem;
  }
}

.section__label .num { color: var(--warm); margin-right: 0.5rem; }

h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.5rem, 3.2vw, 1.9rem);
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 0 0 1.5rem;
  font-variation-settings: "SOFT" 20;
}

h3 {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 1.0625rem;
  line-height: 1.4;
  margin: 0 0 0.35rem;
  letter-spacing: -0.003em;
}

.prose { max-width: var(--measure); }
.prose p { margin: 0 0 1.15rem; color: var(--ink-soft); }
.prose p:last-child { margin-bottom: 0; }

/* ---------- entry list (now / work / career) ---------- */

.entries { margin: 0; padding: 0; list-style: none; }

.entry {
  padding-block: 1.6rem;
  border-top: 1px solid var(--rule);
}

.entry:first-child { border-top: 0; padding-top: 0; }

.entry__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 1.5rem;
  margin-bottom: 0.5rem;
}

.entry__org {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.5rem;
}

.entry__when {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.02em;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
}

/* On a phone the date can't reliably share a line with the title, so it
   always sits under it rather than jumping depending on title length. */
@media (max-width: 34rem) {
  .entry__head { flex-direction: column; align-items: flex-start; }
}

.entry p {
  margin: 0;
  color: var(--ink-soft);
  max-width: var(--measure);
  font-size: 1rem;
}

.entry p + p { margin-top: 0.75rem; }

.outcome {
  display: inline-block;
  margin-top: 0.85rem;
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--ink);
  border-left: 2px solid var(--warm-bright);
  padding-left: 0.75rem;
  line-height: 1.5;
}

/* ---------- career table ---------- */

.career { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }

.career td {
  padding: 0.85rem 1rem 0.85rem 0;
  border-bottom: 1px solid var(--rule);
  vertical-align: baseline;
}

.career tr:last-child td { border-bottom: 0; }
.career td:first-child { font-weight: 600; color: var(--ink); }
.career td:nth-child(2) { color: var(--muted); }
.career td:last-child {
  text-align: right;
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--muted);
  white-space: nowrap;
  padding-right: 0;
}

@media (max-width: 40rem) {
  .career, .career tbody, .career tr, .career td { display: block; width: 100%; }
  .career tr { padding-block: 0.85rem; border-bottom: 1px solid var(--rule); }
  .career tr:last-child { border-bottom: 0; }
  .career td { border-bottom: 0; padding: 0; }
  .career td:last-child { text-align: left; margin-top: 0.2rem; }
}

/* ---------- callout / famjet teaser ---------- */

.teaser {
  background: var(--paper-sunk);
  border-left: 3px solid var(--accent-bright);
  padding: 1.75rem 1.75rem 1.6rem;
  max-width: 40rem;
}

@media (max-width: 34rem) { .teaser { padding: 1.35rem 1.25rem 1.25rem; } }

.teaser blockquote {
  margin: 0 0 1.1rem;
  font-family: var(--serif);
  font-size: 1.25rem;
  line-height: 1.35;
  font-weight: 400;
  font-style: italic;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.teaser p { margin: 0 0 1.1rem; color: var(--ink-soft); font-size: 1rem; }

.cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--warm-bright);
  padding-bottom: 3px;
}

.cta:hover { color: var(--warm); }
.cta .arr { transition: transform 0.15s ease; }
.cta:hover .arr { transform: translateX(3px); }

/* ---------- contact ---------- */

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 1.75rem 2.5rem;
  margin-top: 0.5rem;
}

.contact-item dt {
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.contact-item dd { margin: 0; font-size: 1rem; }

.contact-item a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--rule-firm); padding-bottom: 1px; }
.contact-item a:hover { color: var(--accent); border-bottom-color: var(--accent); }

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

.foot {
  border-top: 1px solid var(--rule);
  margin-top: 1rem;
  padding-block: 2.25rem 3.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 2rem;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.foot a { color: var(--muted); text-decoration: none; border-bottom: 1px solid var(--rule); }
.foot a:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* ---------- utility ---------- */

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 0.6rem 1rem;
  z-index: 50;
  font-family: var(--mono);
  font-size: 0.8125rem;
}
.skip:focus { left: 0.5rem; top: 0.5rem; }

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

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

html { scroll-behavior: smooth; scroll-padding-top: 5rem; }

/* ---------------------------------------------------------------
   Cross-document view transitions
   Chrome/Edge/Safari honour these; everywhere else the navigation
   is an ordinary load and nothing below matters.
   --------------------------------------------------------------- */

@view-transition { navigation: auto; }

/* The masthead holds still while the page body moves underneath it. */
.masthead { view-transition-name: masthead; }
h1 { view-transition-name: page-title; }

::view-transition-old(root) {
  animation: vt-leave 180ms cubic-bezier(0.4, 0, 1, 1) both;
}
::view-transition-new(root) {
  animation: vt-enter 300ms cubic-bezier(0.16, 0.84, 0.44, 1) both;
}
::view-transition-old(page-title),
::view-transition-new(page-title) {
  animation-duration: 320ms;
  animation-timing-function: cubic-bezier(0.16, 0.84, 0.44, 1);
}

@keyframes vt-leave { to { opacity: 0; transform: translateY(-8px); } }
@keyframes vt-enter { from { opacity: 0; transform: translateY(12px); } }

@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  ::view-transition-old(root),
  ::view-transition-new(root),
  ::view-transition-old(page-title),
  ::view-transition-new(page-title) { animation: none; }
}

/* ---------------------------------------------------------------
   Terminal
   --------------------------------------------------------------- */

.egg-hint {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
  background: none;
  border: 0;
  border-bottom: 1px solid transparent;
  padding: 0 0 2px;
  cursor: pointer;
  letter-spacing: 0.02em;
}
.egg-hint:hover { color: var(--accent); border-bottom-color: var(--accent); }
.egg-hint .blink { color: var(--warm-bright); }

@media (prefers-reduced-motion: no-preference) {
  .egg-hint .blink { animation: blink 1.4s steps(1) infinite; }
  @keyframes blink { 0%, 55% { opacity: 1; } 56%, 100% { opacity: 0; } }
}

.term {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(10, 13, 19, 0.55);
}

.term__panel {
  width: min(44rem, 100%);
  height: min(24rem, calc(100vh - 2rem));
  display: flex;
  flex-direction: column;
  background: #10141C;
  color: #E5E3DE;
  border: 1px solid #2E3543;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
  font-family: var(--mono);
  font-size: 0.8125rem;
  line-height: 1.6;
  overflow: hidden;
}

@media (prefers-reduced-motion: no-preference) {
  .term__panel { animation: term-in 180ms cubic-bezier(0.16, 0.84, 0.44, 1) both; }
  @keyframes term-in { from { opacity: 0; transform: translateY(10px) scale(0.99); } }
}

.term__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 0.85rem;
  border-bottom: 1px solid #2E3543;
  color: #7E8798;
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  flex-shrink: 0;
}

.term__close {
  background: none;
  border: 0;
  color: #7E8798;
  font-family: inherit;
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  cursor: pointer;
  padding: 0;
}
.term__close:hover { color: #E5E3DE; }

.term__out {
  flex: 1;
  overflow-y: auto;
  padding: 0.85rem 0.95rem;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font: inherit;
}

.term__out b { color: #5AC4DA; font-weight: 400; }
.term__out i { color: #E2A06E; font-style: normal; }
.term__out u { color: #7E8798; text-decoration: none; }

.term__form {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.6rem 0.95rem 0.75rem;
  border-top: 1px solid #2E3543;
  flex-shrink: 0;
}

.term__prompt { color: #5AC4DA; flex-shrink: 0; }

.term__in {
  flex: 1;
  min-width: 0;
  background: none;
  border: 0;
  outline: none;
  color: #E5E3DE;
  font: inherit;
  padding: 0;
}

.term__in::placeholder { color: #4B5464; }
