/* willyclayton.com: one page, four tabs, no framework. */

@font-face {
  font-family: "Geist";
  src: url("/assets/fonts/geist-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("/assets/fonts/geist-mono-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #ffffff;
  --fg: #111113;
  --muted: #5f6368;
  --line: #e6e6e9;
  --link: #b3ddf2;
  --caret: #e4002b;
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --bar-h: 4rem;
  --gutter: clamp(1.25rem, 5vw, 3rem);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0b0c; --fg: #ededee; --muted: #a1a1aa; --line: #26262a; --link: #3f7fa3;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b0b0c; --fg: #ededee; --muted: #a1a1aa; --line: #26262a; --link: #3f7fa3;
  color-scheme: dark;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--bar-h) + 1rem);
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

svg { display: block; }
h1, h2, p, ul, blockquote { margin: 0; }
h1, h2 { line-height: 1.2; }

a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-color: var(--link);
  text-decoration-thickness: .16em;
  text-underline-offset: .2em;
  text-decoration-skip-ink: none;
}
a:hover { text-decoration-color: currentColor; }

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

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  padding: .75rem 1rem; background: var(--fg); color: var(--bg); text-decoration: none;
}
.skip:focus { top: 1rem; }

/* ---------- Top bar: the four tabs ---------- */

.bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  height: var(--bar-h);
  /* Line the tabs up with the content column on wide screens. */
  padding: env(safe-area-inset-top) max(var(--gutter), calc((100% - 46rem) / 2 + var(--gutter))) 0;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  font-family: var(--mono);
  font-size: .9375rem;
  transition: border-color .3s;
}
.bar.scrolled { border-bottom-color: var(--line); }

.tabs { position: relative; display: flex; gap: 1.5rem; }
.tabs a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--muted);
  text-decoration: none;
  transition: color .25s;
}
.tabs a:hover, .tabs a[aria-current="page"] { color: var(--fg); }
/* The line under the current tab glides to the new one. main.js positions it. */
.tabs .ink {
  position: absolute;
  left: 0;
  bottom: 6px;
  width: 0;
  height: 1px;
  background: var(--fg);
  transition: transform .5s var(--ease), width .5s var(--ease);
  pointer-events: none;
}

/* ---------- Panels ---------- */

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 46rem;
  margin: 0 auto;
  padding: clamp(2rem, 6vw, 4rem) var(--gutter) 4rem;
}

/* A big scroll margin means opening a link like /#work lands at the top of the page. */
.panel { scroll-margin-top: 100vh; }
/* Without JavaScript every section shows, one after another. */
.panel + .panel { margin-top: 5rem; }
.js .panel + .panel { margin-top: 0; }
.js .panel[hidden]:not([hidden="until-found"]) { display: none; }
/* hidden="until-found" keeps closed tabs searchable with Ctrl+F; collapse their boxes. */
.js .panel[hidden="until-found"] { flex: none !important; min-height: 0 !important; margin: 0 !important; padding: 0 !important; }
/* Headings get focus after a tab switch so screen readers land there; no ring needed. */
main:focus, .panel [tabindex="-1"]:focus { outline: none; }

/* Tab change: each piece comes in from a soft blur, one after another. */
.panel.entering > * {
  animation: materialize .7s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 70ms);
}
@keyframes materialize {
  from { opacity: 0; filter: blur(10px); transform: translateY(10px); }
  to { opacity: 1; filter: blur(0); transform: none; }
}

.panel-title {
  margin-bottom: 1.75rem;
  font-family: var(--mono);
  font-size: .875rem;
  font-weight: 400;
  letter-spacing: .02em;
  color: var(--muted);
  text-transform: lowercase;
}

/* ---------- Home: just the hello, centered ---------- */

.js #home:not([hidden]) { flex: 1; display: flex; align-items: center; justify-content: center; padding-bottom: 4rem; }
/* As wide as the longest line, so the block never shifts while it types. */
.hero {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: min(100%, 22ch);
  font-family: var(--mono);
  font-size: clamp(1.75rem, 6vw, 3.25rem);
}
.type { font: inherit; line-height: 1.25; letter-spacing: -.03em; }
.type-static { display: block; color: var(--muted); }
/* Room for the longest line ("a really really amateur photographer.") so nothing jumps. */
.type-line { display: block; min-height: 3.75em; }
@media (min-width: 40rem) { .type-line { min-height: 2.5em; } }
/* The caret is a zero-width border so it never adds a line-break point. */
.caret {
  border-left: .085em solid var(--caret);
  margin-left: .06em;
  margin-right: -.145em;
  animation: blink 1.06s steps(1) infinite;
}
/* Solid while typing, blinking while it waits, then three blinks and still. */
.type.typing .caret { animation: none; }
.type.done .caret { animation: blink 1.06s steps(1) 3; }
@keyframes blink { 50% { border-left-color: transparent; } }
/* The not-yet-typed part keeps its space so words never jump lines mid-type. */
.rest { visibility: hidden; }

.type-toggle {
  min-height: 44px;
  margin-left: -.5rem;
  padding: 0 .5rem;
  border: 0;
  background: none;
  color: var(--muted);
  font-family: var(--mono);
  font-size: .8125rem;
  cursor: pointer;
  opacity: .6;
  transition: opacity .2s;
}
.type-toggle:hover { opacity: 1; color: var(--fg); }
html:not(.js) .type-toggle { display: none; }

/* ---------- Rows you tap open (Work, Projects, About) ---------- */

.rows { border-top: 1px solid var(--line); }
.row { border-bottom: 1px solid var(--line); }
.row summary {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  min-height: 3.5rem;
  padding: 1rem 0;
  cursor: pointer;
  list-style: none;
  transition: padding-left .4s var(--ease);
}
.row summary::-webkit-details-marker { display: none; }
.row summary:hover { padding-left: .4rem; }
.row .n { flex: 1; font-weight: 500; letter-spacing: -.01em; }
.row .y { font-family: var(--mono); font-size: .8125rem; color: var(--muted); }
/* A plus that turns into an x. */
.row summary::after {
  content: "";
  flex: none;
  align-self: center;
  width: .7rem;
  height: .7rem;
  background:
    linear-gradient(var(--muted), var(--muted)) center / 100% 1px no-repeat,
    linear-gradient(var(--muted), var(--muted)) center / 1px 100% no-repeat;
  transition: transform .45s var(--ease);
}
.row[open] > summary::after { transform: rotate(45deg); }
.row[open] > summary .n { color: var(--fg); }

.body {
  padding: 0 0 1.25rem;
  max-width: 36rem;
  color: var(--muted);
  animation: materialize .55s var(--ease) both;
}
.body p + p, .body p + ul, .body ul + p { margin-top: .5rem; }
.body ul { padding-left: 1.1rem; }
.body li { margin-top: .25rem; }
.meta { display: flex; gap: 1.25rem; font-family: var(--mono); font-size: .875rem; }
.meta a { display: inline-block; padding: .6rem 0; color: var(--fg); }

/* ---------- About ---------- */

.bio { margin-bottom: 2rem; font-size: clamp(1.25rem, 1.1rem + .6vw, 1.5rem); letter-spacing: -.01em; }

.quote-list { padding: 0; list-style: none; }
.quote-list blockquote { color: var(--fg); }
.who { margin-top: .4rem; font-family: var(--mono); font-size: .8125rem; }
/* With JS: one quote at a time. */
.js .quotes.deck .quote-list li { display: none; }
.js .quotes.deck .quote-list li.on { display: block; min-height: 6.5rem; animation: materialize .5s var(--ease) both; }
.deck-controls { margin-top: .25rem; font-family: var(--mono); font-size: .875rem; }
.deck-controls button {
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--fg);
  font: inherit;
  text-decoration: underline;
  text-decoration-color: var(--link);
  text-decoration-thickness: .16em;
  text-underline-offset: .25em;
  cursor: pointer;
}
.fine { margin-top: .5rem; font-size: .8125rem; }

/* ---------- Footer ---------- */

.foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0 1rem;
  width: 100%;
  max-width: 46rem;
  margin: 0 auto;
  padding: 1rem var(--gutter) calc(1.5rem + env(safe-area-inset-bottom));
  font-family: var(--mono);
  font-size: .8125rem;
  color: var(--muted);
}
.foot-links { display: flex; align-items: center; gap: 1rem; }
.foot-links a { display: inline-block; padding: .8rem 0; }

.theme {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: 0 -.8rem 0 -.5rem;
  border: 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
}
.theme:hover { color: var(--fg); }
.theme svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; transition: transform .6s var(--ease); }
.theme:hover svg { transform: rotate(45deg); }
.theme .moon { display: none; }
:root[data-theme="dark"] .theme .sun { display: none; }
:root[data-theme="dark"] .theme .moon { display: inline; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme .sun { display: none; }
  :root:not([data-theme="light"]) .theme .moon { display: inline; }
}

/* ---------- Phones ---------- */

@media (max-width: 40rem) {
  :root { --bar-h: 3.25rem; }
  .tabs { flex: 1; justify-content: space-between; gap: 0; }
  .hero { font-size: clamp(1.75rem, 8.4vw, 2.25rem); }
}

/* ---------- Motion preferences ----------
   Slides and blurs turn off. The typewriter still types: it changes text, it doesn't move. */
@media (prefers-reduced-motion: reduce) {
  .panel.entering > *, .body, .js .quotes.deck .quote-list li.on { animation: none !important; }
  .tabs .ink, .row summary, .row summary::after, .theme svg { transition: none !important; }
}

@media print {
  .bar, .deck-controls, .foot, .skip, .type-toggle { display: none !important; }
  .js .panel[hidden] { display: block !important; content-visibility: visible !important; }
  .panel + .panel { margin-top: 2rem !important; }
}

/* ---------- Projects: screenshot, facts, folders ---------- */
.folder > summary .n::before { content: "/ "; color: var(--muted); font-family: var(--mono); font-weight: 400; }
.sub { padding: 0 0 .5rem 1rem; border-left: 1px solid var(--line); animation: materialize .55s var(--ease) both; }
.sub .row:last-child { border-bottom: 0; }
.shot { display: block; margin-bottom: .75rem; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--line); }
.shot img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; transition: transform .6s var(--ease); }
.shot:hover img { transform: scale(1.02); }
.facts { margin: .6rem 0 0; font-size: .875rem; }
.facts div { display: flex; gap: .75rem; padding: .15rem 0; }
.facts dt { flex: none; width: 5.5rem; font-family: var(--mono); font-size: .8125rem; }
.facts dd { margin: 0; color: var(--fg); }
@media (prefers-reduced-motion: reduce) { .sub, .shot img { animation: none !important; transition: none !important; } }

/* ---------- Work: second group label (education) and course lists ---------- */
.group {
  margin: 3rem 0 1rem;
  font-family: var(--mono);
  font-size: .875rem;
  font-weight: 400;
  letter-spacing: .02em;
  color: var(--muted);
}
.body .courses {
  margin-top: .75rem;
  padding: 0;
  list-style: none;
  columns: 2 13rem;
  column-gap: 1.5rem;
  font-size: .875rem;
}
.body .courses li { margin: 0; padding: .2rem 0; break-inside: avoid; }

/* ---------- Georgia Tech yellow jacket ---------- */
.buzz {
  position: fixed;
  z-index: 50;
  width: 64px;
  height: 64px;
  margin: -32px 0 0 -32px;
  pointer-events: none;
  animation: buzz-up var(--dur, 2s) cubic-bezier(.3, .1, .3, 1) forwards;
}
.buzz img { display: block; width: 100%; height: 100%; object-fit: contain; animation: buzz-wobble .35s ease-in-out infinite alternate; }
@keyframes buzz-up {
  0% { opacity: 0; transform: translate(0, 10px) scale(.5); }
  12% { opacity: 1; transform: translate(0, -20px) scale(1.1); }
  100% { opacity: 0; transform: translate(var(--drift), -100vh) scale(.9) rotate(var(--spin)); }
}
@keyframes buzz-wobble { from { transform: rotate(-8deg); } to { transform: rotate(8deg); } }
.body b { color: var(--fg); font-weight: 600; }
