/* ===========================================================
   jett.mu: the personal site. Deliberately not jettm.dev.
   Ground: pale sage. Ink: deep moss. One olive accent.
   Type: Alegreya (serif, carries the voice) with Alegreya Sans
   for small UI text. The one signature motif is the VA3NDE
   callsign drawn in Morse. Theme follows the system setting.
   =========================================================== */

:root {
  color-scheme: light dark;

  --ground: oklch(0.948 0.02 118);
  --ground-2: oklch(0.918 0.028 118);      /* sunken panels */
  --ink: oklch(0.25 0.035 128);
  --ink-2: oklch(0.4 0.03 125);            /* secondary text */
  --ink-3: oklch(0.47 0.028 122);          /* tertiary text, meta */
  --olive: oklch(0.47 0.095 112);          /* links, text-safe accent */
  --olive-hover: oklch(0.36 0.08 115);
  --signal: oklch(0.6 0.11 110);          /* the Morse marks, fills */
  --signal-dim: oklch(0.6 0.11 110 / 0.22);
  --rule: oklch(0.25 0.035 128 / 0.14);
  --focus: oklch(0.47 0.095 112);
  --deep: oklch(0.3 0.045 125);           /* the moss band */
  --on-deep: oklch(0.95 0.02 115);
  --on-deep-2: oklch(0.84 0.03 115);
  --bright: oklch(0.86 0.13 112);          /* olive lit up, on --deep */

  --serif: 'Alegreya', 'Iowan Old Style', Georgia, serif;
  --sans: 'Alegreya Sans', 'Gill Sans', system-ui, sans-serif;

  /* modular scale, ratio ~1.333 */
  --step--1: 0.9375rem;
  --step-0: clamp(1.125rem, 1.06rem + 0.3vw, 1.25rem);
  --step-1: clamp(1.375rem, 1.27rem + 0.5vw, 1.625rem);
  --step-2: clamp(1.75rem, 1.55rem + 1vw, 2.25rem);
  --step-3: clamp(2.25rem, 1.8rem + 2.2vw, 3.5rem);
  --step-4: clamp(3.25rem, 2.2rem + 5vw, 6rem);

  --gutter: clamp(16px, 5vw, 64px);
  --measure: 62ch;
  --max: 1160px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);   /* quint */

  --z-header: 10;
  --z-skip: 50;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ground: oklch(0.205 0.02 125);
    --ground-2: oklch(0.245 0.024 125);
    --ink: oklch(0.93 0.02 115);
    --ink-2: oklch(0.8 0.025 115);
    --ink-3: oklch(0.72 0.025 115);
    --olive: oklch(0.82 0.1 110);
    --olive-hover: oklch(0.9 0.08 110);
    --signal: oklch(0.78 0.12 110);
    --signal-dim: oklch(0.78 0.12 110 / 0.2);
    --rule: oklch(0.93 0.02 115 / 0.14);
    --focus: oklch(0.82 0.1 110);
    --deep: oklch(0.29 0.04 122);
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 24px;
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--serif);
  font-size: var(--step-0);
  line-height: 1.6;
  font-variant-numeric: oldstyle-nums proportional-nums;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  margin: 0;
  font-weight: 500;
  line-height: 1.1;
  text-wrap: balance;
}

p { margin: 0; text-wrap: pretty; }

a {
  color: var(--olive);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition: color 0.2s var(--ease-out), text-decoration-color 0.2s var(--ease-out);
}
a:hover { color: var(--olive-hover); }

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

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: var(--z-skip);
  padding: 10px 16px;
  background: var(--ink);
  color: var(--ground);
  font-family: var(--sans);
  border-radius: 6px;
}
.skip-link:focus { top: 12px; }

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

/* ---------- header ---------- */

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  padding-block: 20px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--ink);
  font-size: var(--step-1);
  font-weight: 600;
  text-decoration: none;
}
.wordmark:hover { color: var(--ink); }

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0 4px;
  font-family: var(--sans);
  font-size: 1.0625rem;
}
.site-nav a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  padding-inline: 10px;
  color: var(--ink-2);
  text-decoration: none;
  border-radius: 6px;
}
.site-nav a:hover { color: var(--ink); }
.site-nav a[aria-current="page"] {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--signal);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.35em;
}
.site-nav a:last-child { padding-right: 0; }

.ext {
  width: 0.7em;
  height: 0.7em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

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

.hero {
  padding-block: clamp(56px, 12vh, 140px) clamp(48px, 9vh, 96px);
}

.hero-name {
  font-size: var(--step-4);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 0.95;
}

.hero-lede {
  max-width: 34ch;
  margin-top: clamp(28px, 4vw, 44px);
  color: var(--ink-2);
  font-size: var(--step-1);
  line-height: 1.45;
}
.hero-lede a { white-space: nowrap; }

/* the callsign, keyed out in Morse */
.morse {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 0;
  margin-top: clamp(22px, 3vw, 32px);
  --u: clamp(7px, 0.9vw, 10px);   /* one Morse unit */
  cursor: default;
}
.morse .ch {
  display: inline-flex;
  align-items: center;
  gap: var(--u);
  margin-right: calc(var(--u) * 3);
}
.morse .ch:last-of-type { margin-right: calc(var(--u) * 2); }
.morse i {
  display: block;
  width: var(--u);
  height: var(--u);
  border-radius: var(--u);
  background: var(--signal);
}
.morse i.dah { width: calc(var(--u) * 3); }
.morse-call {
  font-family: var(--sans);
  font-size: var(--step--1);
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--ink-3);
}

/* each mark flashes on at its real Morse timing, then settles.
   Without animation it is simply drawn. */
@media (prefers-reduced-motion: no-preference) {
  .morse.keying i {
    animation: key 0.9s var(--ease-out) both;
    animation-delay: calc(var(--t) * 65ms + 250ms);
  }
  .morse.keying .morse-call {
    animation: settle 0.8s var(--ease-out) both;
    animation-delay: 3.9s;
  }
}
@keyframes key {
  0%   { background: var(--signal-dim); transform: scale(0.7); }
  12%  { background: var(--olive-hover); transform: scale(1.12); }
  100% { background: var(--signal); transform: scale(1); }
}
@keyframes settle {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ---------- the door to jettm.dev ---------- */

.code-door {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 20px 40px;
  padding: clamp(28px, 5vw, 56px) clamp(22px, 5vw, 56px);
  background: var(--deep);
  color: var(--on-deep);
  border-radius: 22px;
}
/* a faint "DEV" in Morse runs along the bottom edge */
.code-door::after {
  content: "";
  position: absolute;
  left: clamp(22px, 5vw, 56px);
  bottom: 18px;
  width: 138px;
  height: 6px;
  opacity: 0.35;
  background:
    linear-gradient(var(--bright), var(--bright)) 0px 0 / 18px 6px no-repeat,
    radial-gradient(circle at 3px 3px, var(--bright) 2.6px, transparent 3px) 24px 0 / 6px 6px no-repeat,
    radial-gradient(circle at 3px 3px, var(--bright) 2.6px, transparent 3px) 36px 0 / 6px 6px no-repeat,
    radial-gradient(circle at 3px 3px, var(--bright) 2.6px, transparent 3px) 60px 0 / 6px 6px no-repeat,
    radial-gradient(circle at 3px 3px, var(--bright) 2.6px, transparent 3px) 84px 0 / 6px 6px no-repeat,
    radial-gradient(circle at 3px 3px, var(--bright) 2.6px, transparent 3px) 96px 0 / 6px 6px no-repeat,
    radial-gradient(circle at 3px 3px, var(--bright) 2.6px, transparent 3px) 108px 0 / 6px 6px no-repeat,
    linear-gradient(var(--bright), var(--bright)) 120px 0 / 18px 6px no-repeat;
  border-radius: 3px;
  pointer-events: none;
}
.code-door p {
  max-width: 46ch;
  color: var(--on-deep-2);
}
.code-door strong {
  display: block;
  margin-bottom: 8px;
  color: var(--on-deep);
  font-size: var(--step-2);
  font-weight: 500;
  line-height: 1.15;
}
.code-door-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 26px;
  background: var(--bright);
  color: var(--deep);
  font-family: var(--sans);
  font-size: 1.125rem;
  font-weight: 700;
  text-decoration: none;
  border-radius: 999px;
  transition: background 0.2s var(--ease-out), transform 0.2s var(--ease-out);
}
.code-door-link:hover { background: var(--on-deep); color: var(--deep); }
.code-door-link:active { transform: scale(0.97); }
.code-door-link:focus-visible { outline-color: var(--bright); }
.code-door-link .ext { width: 0.8em; height: 0.8em; transition: transform 0.25s var(--ease-out); }
.code-door-link:hover .ext { transform: translate(2px, -2px); }

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

.section {
  padding-block: clamp(72px, 12vw, 136px) 0;
}
.section-head {
  display: grid;
  gap: 12px;
  margin-bottom: clamp(32px, 5vw, 56px);
}
.section-title { font-size: var(--step-3); letter-spacing: -0.01em; }
.section-lede { max-width: var(--measure); color: var(--ink-2); }

/* icons: one line style everywhere, sat in a soft tile */
.ico-tile {
  display: grid;
  place-items: center;
  flex: none;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--ground-2);
  color: var(--olive);
  transition: background 0.3s var(--ease-out), color 0.3s var(--ease-out), transform 0.4s var(--ease-out);
}
.ico {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* about me: icon | name, line, one fact */
.about-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
  gap: 0 clamp(32px, 5vw, 72px);
  margin: 0;
  padding: 0;
  list-style: none;
}
.about-item {
  display: flex;
  gap: 22px;
  align-items: flex-start;
  padding-block: clamp(22px, 3vw, 30px);
  border-top: 1px solid var(--rule);
}
.about-item:hover .ico-tile {
  background: var(--deep);
  color: var(--bright);
  transform: rotate(-6deg);
}
.about-body { display: grid; gap: 6px; padding-top: 4px; }
.about-body h3 { font-size: var(--step-1); line-height: 1.2; }
.about-body p { max-width: 46ch; color: var(--ink-2); }
.about-body .fact {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-self: start;
  margin-top: 4px;
  font-family: var(--sans);
  font-size: var(--step--1);
  font-weight: 500;
  color: var(--ink-3);
}
.about-body .fact::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--signal);
}
.about-body .fact a { color: var(--olive); }

/* awards highlights on the home page */
.highlights {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 32px clamp(24px, 4vw, 56px);
  margin: 0 0 40px;
  padding: 0;
  list-style: none;
}
.highlights li { display: grid; gap: 6px; align-content: start; }
.highlights li::before {
  content: "";
  width: 30px;
  height: 8px;
  margin-bottom: 12px;
  border-radius: 8px;
  background: var(--signal);
}
.highlights .hl-result {
  font-size: var(--step-2);
  font-weight: 500;
  line-height: 1.15;
  text-wrap: balance;
}
.highlights .hl-where { color: var(--ink-2); }
.highlights time {
  font-family: var(--sans);
  font-size: var(--step--1);
  color: var(--ink-3);
}

.text-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-family: var(--sans);
  font-size: 1.125rem;
  font-weight: 500;
}

/* contact */
.contact-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.contact-list a {
  display: grid;
  gap: 6px;
  padding: clamp(22px, 3vw, 32px);
  border: 1px solid var(--rule);
  border-radius: 18px;
  color: var(--ink);
  text-decoration: none;
  transition: border-color 0.2s var(--ease-out), background 0.2s var(--ease-out);
}
.contact-list .ico-tile { margin-bottom: 14px; }
.contact-list a:hover { border-color: var(--olive); background: var(--ground-2); }
.contact-list a:hover .ico-tile { background: var(--deep); color: var(--bright); }
.contact-role {
  font-family: var(--sans);
  font-size: var(--step--1);
  color: var(--ink-3);
}
.contact-addr {
  font-size: var(--step-2);
  font-weight: 500;
  line-height: 1.15;
  overflow-wrap: anywhere;
}
.contact-note {
  margin-top: 28px;
  max-width: var(--measure);
  color: var(--ink-2);
}

/* ---------- awards page ---------- */

.page-head {
  padding-block: clamp(48px, 10vh, 112px) clamp(40px, 6vw, 72px);
}
.page-title { font-size: var(--step-4); letter-spacing: -0.02em; line-height: 0.95; }
.page-lede {
  max-width: 44ch;
  margin-top: 24px;
  color: var(--ink-2);
  font-size: var(--step-1);
  line-height: 1.45;
}

.year {
  display: grid;
  grid-template-columns: minmax(120px, 14rem) minmax(0, 1fr);
  gap: 16px 40px;
  padding-block: clamp(28px, 4vw, 44px);
  border-top: 1px solid var(--rule);
}
.year-num {
  font-size: var(--step-3);
  font-weight: 400;
  font-variant-numeric: lining-nums tabular-nums;
  color: var(--ink-3);
  line-height: 1;
  position: sticky;
  top: 24px;
  align-self: start;
}
.year-list { margin: 0; padding: 0; list-style: none; display: grid; gap: clamp(24px, 3vw, 32px); }
.award {
  display: grid;
  grid-template-columns: 7rem minmax(0, 1fr);
  gap: 4px 24px;
  align-items: baseline;
}
.award time {
  font-family: var(--sans);
  font-size: var(--step--1);
  color: var(--ink-3);
}
.award h3 { font-size: var(--step-1); font-weight: 500; line-height: 1.25; }
.award p { grid-column: 2; max-width: 56ch; color: var(--ink-2); }

.awards-foot {
  padding-top: clamp(28px, 4vw, 44px);
  border-top: 0;
  color: var(--ink-2);
  max-width: var(--measure);
}

.year:last-of-type { border-bottom: 1px solid var(--rule); }

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

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  margin-top: clamp(80px, 12vw, 144px);
  padding-block: 28px 36px;
  border-top: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: var(--step--1);
  color: var(--ink-3);
}
.footer-links { display: flex; flex-wrap: wrap; gap: 0 20px; }
.footer-links a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  color: var(--ink-2);
  text-decoration: none;
}
.footer-links a:hover { color: var(--ink); text-decoration: underline; }
.site-footer > span { display: inline-flex; align-items: center; min-height: 44px; }

/* ---------- small screens ---------- */

@media (max-width: 860px) {
  .code-door { grid-template-columns: 1fr; }
  .code-door-link { justify-self: start; }
  .code-door { padding-bottom: 56px; }
  .year { grid-template-columns: 1fr; }
  .year-num { position: static; }
}

@media (max-width: 520px) {
  .about-item { gap: 16px; }
  .ico-tile { width: 48px; height: 48px; border-radius: 14px; }
  .ico { width: 24px; height: 24px; }
  .site-nav { margin-left: -10px; }
  .award { grid-template-columns: 1fr; }
  .award p { grid-column: 1; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; }
  .about-item:hover .ico-tile { transform: none; }
}
