/* =========================================================================
   austinwilkins.dev — design system
   Everything themeable lives in :root. Change a token, the site follows.
   ========================================================================= */

:root {
  /* dark is the default theme */
  --bg:        #121418;
  --bg-alt:    #181b20;
  --surface:   #1c2026;
  --text:      #ecedef;
  --muted:     #8b909a;
  --accent:    #e5643c;
  --accent-dim:#f08a68;
  --line:      rgba(255,255,255,.09);
  --line-soft: rgba(255,255,255,.05);
  --art-line:  rgba(255,255,255,.24);
  --art-arc:   rgba(255,255,255,.55);
  --shadow:    0 1px 2px rgba(0,0,0,.4), 0 12px 32px rgba(0,0,0,.28);

  --font-display: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --font-body:    "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --wrap: 1120px;
  --radius: 14px;
  --ease: cubic-bezier(.22,.61,.36,1);
  --dur: .45s;
}

[data-theme="light"] {
  --bg:        #faf9f7;
  --bg-alt:    #f2f0ec;
  --surface:   #ffffff;
  --text:      #14161a;
  --muted:     #5c626c;
  --accent:    #c84a26;
  --accent-dim:#a83c1d;
  --line:      rgba(0,0,0,.11);
  --line-soft: rgba(0,0,0,.06);
  --art-line:  rgba(0,0,0,.24);
  --art-arc:   rgba(0,0,0,.55);
  --shadow:    0 1px 2px rgba(0,0,0,.05), 0 12px 32px rgba(0,0,0,.07);
}

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

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background-color .3s var(--ease), color .3s var(--ease);
}

h1, h2, h3 { font-family: var(--font-display); line-height: 1.08; margin: 0; letter-spacing: -.02em; }
p { margin: 0 0 1.1em; }
a { color: inherit; }
svg { width: 100%; height: 100%; fill: currentColor; display: block; }
ul { list-style: none; margin: 0; padding: 0; }

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
.mono { font-family: var(--font-mono); font-size: .82em; letter-spacing: .02em; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--accent); color: #fff; padding: .7rem 1.1rem; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

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

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease), background-color .3s var(--ease);
}
.nav.is-stuck { border-bottom-color: var(--line); }
.nav__inner { display: flex; align-items: center; gap: 1.5rem; height: 66px; }

.wordmark { display: flex; align-items: baseline; gap: .6rem; text-decoration: none; margin-right: auto; }
.wordmark__mark {
  font-family: var(--font-display); font-weight: 700; font-size: 1.05rem;
  letter-spacing: -.03em; color: var(--accent);
}
.wordmark__name { font-size: .95rem; font-weight: 500; }

.nav__links { display: flex; gap: 1.6rem; }
.nav__links a {
  text-decoration: none; font-size: .93rem; color: var(--muted);
  transition: color .2s var(--ease); position: relative;
}
.nav__links a:hover, .nav__links a.is-active { color: var(--text); }
.nav__links a.is-active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -6px;
  height: 1.5px; background: var(--accent);
}

.nav__actions { display: flex; align-items: center; gap: .3rem; }
.iconbtn {
  width: 34px; height: 34px; padding: 8px; border-radius: 8px;
  color: var(--muted); background: none; border: 0; cursor: pointer;
  display: grid; place-items: center;
  transition: color .2s var(--ease), background-color .2s var(--ease);
}
.iconbtn:hover { color: var(--text); background: var(--line-soft); }
.iconbtn--toggle .icon-sun { display: none; }
[data-theme="light"] .iconbtn--toggle .icon-sun { display: block; }
[data-theme="light"] .iconbtn--toggle .icon-moon { display: none; }

/* On small screens keep the section links — navigation matters more than the
   social icons, which repeat in the contact section and the footer anyway. */
@media (max-width: 720px) {
  .wordmark__name { display: none; }
  .nav__inner { gap: .75rem; }
  .nav__links { gap: 1rem; margin-left: auto; }
  .nav__links a { font-size: .85rem; }
  .nav__actions .iconbtn:not(.iconbtn--toggle) { display: none; }
}
@media (max-width: 380px) {
  .nav__links { gap: .8rem; }
  .nav__links a { font-size: .8rem; }
}

/* ---------- hero ---------- */
.hero { position: relative; padding: clamp(4rem, 13vh, 8rem) 0 clamp(4rem, 11vh, 7rem); overflow: hidden; }

/* the one ambient effect: a slow-drifting dot grid, pure CSS */
.hero__grid {
  position: absolute; inset: -50% -10% auto -10%; height: 200%;
  background-image: radial-gradient(circle, var(--line) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: radial-gradient(ellipse 70% 55% at 65% 30%, #000 0%, transparent 72%);
  -webkit-mask-image: radial-gradient(ellipse 70% 55% at 65% 30%, #000 0%, transparent 72%);
  animation: drift 34s linear infinite;
  pointer-events: none;
}
@keyframes drift { to { transform: translate3d(34px, 34px, 0); } }
@media (prefers-reduced-motion: reduce) { .hero__grid { animation: none; } }

.hero__inner { position: relative; }

/* ---------- hero signature graphic ---------- */
.hero__art {
  position: absolute; top: 50%;
  /* align the art's right edge to the content column, never off-screen */
  right: max(1.5rem, calc((100vw - var(--wrap)) / 2));
  width: min(36vw, 470px); aspect-ratio: 1;
  translate: 0 -50%;
  pointer-events: none;
  opacity: .95;
}
.hero__art svg { width: 100%; height: 100%; overflow: visible; }

.art-ring, .art-arc, .art-pulse, .art-core-ring {
  fill: none;
  vector-effect: non-scaling-stroke;
}
.art-ring      { stroke: var(--art-line); stroke-width: 1; }
.art-ticks     { fill: none; stroke: var(--art-line); stroke-width: 7; stroke-dasharray: 1.5 20; }
.art-core-ring { stroke: var(--art-line); stroke-width: 1; }

.art-arc { stroke-width: 2; stroke-linecap: round; }
.art-arc--accent { stroke: var(--accent); }
.art-arc--dim    { stroke: var(--art-arc); }

.art-node { fill: var(--accent); }
.art-core { fill: var(--accent); }

/* a short dash that travels around the outer ring — circumference ≈ 1570.8 */
.art-pulse {
  stroke: var(--accent); stroke-width: 2; stroke-linecap: round;
  stroke-dasharray: 26 1544.8;
  animation: art-travel 7s linear infinite;
}
@keyframes art-travel { to { stroke-dashoffset: -1570.8; } }

/* rotating groups — transform-box keeps the origin on the viewBox centre */
.art-spin { transform-origin: 300px 300px; transform-box: view-box; }
.art-spin--slow { animation: art-spin 54s linear infinite; }
.art-spin--rev  { animation: art-spin 38s linear infinite reverse; }
.art-spin--fast { animation: art-spin 24s linear infinite; }
@keyframes art-spin { to { transform: rotate(360deg); } }

/* Motion is decorative: hold the composition still rather than remove it. */
@media (prefers-reduced-motion: reduce) {
  .art-spin, .art-pulse { animation: none; }
}

/* Hide below the width where the art would crowd the headline and blurb.
   Measured: at 1000px the art box overlaps the blurb; at 1100px it clears it. */
@media (max-width: 1100px) {
  .hero__art { display: none; }
}

.eyebrow {
  font-family: var(--font-mono); font-size: .78rem; text-transform: uppercase;
  letter-spacing: .16em; color: var(--accent); margin: 0 0 1.4rem;
}

.hero__title {
  font-size: clamp(3.4rem, 12vw, 8.5rem);
  font-weight: 700; letter-spacing: -.045em; margin-bottom: 1.6rem;
}

.hero__line { display: flex; align-items: center; gap: .55rem; margin-bottom: 1.8rem; color: var(--muted); }
.hero__prompt { color: var(--accent); }
.caret {
  display: inline-block; width: 9px; height: 1.05em; background: var(--accent);
  animation: blink 1.1s steps(2, start) infinite; translate: 0 .16em;
}
@keyframes blink { to { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .caret { animation: none; } }

.hero__blurb { max-width: 60ch; color: var(--muted); font-size: 1.06rem; }

.hero__cta { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 2.2rem; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: .78rem 1.5rem; border-radius: 10px; text-decoration: none;
  font-size: .95rem; font-weight: 500; border: 1px solid transparent;
  transition: transform .3s var(--ease), background-color .3s var(--ease),
              border-color .3s var(--ease), color .3s var(--ease);
}
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-dim); transform: translateY(-2px); }
.btn--ghost { border-color: var(--line); color: var(--text); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }
.btn--lg { padding: .95rem 1.9rem; font-size: 1rem; font-family: var(--font-mono); }
@media (prefers-reduced-motion: reduce) { .btn:hover { transform: none; } }

/* ---------- sections ---------- */
.section { padding: clamp(4.5rem, 10vh, 7.5rem) 0; border-top: 1px solid var(--line-soft); }
.section--alt { background: var(--bg-alt); }

.section__label {
  font-family: var(--font-mono); font-size: .78rem; text-transform: uppercase;
  letter-spacing: .16em; color: var(--muted); margin: 0 0 1.6rem;
  display: flex; align-items: center; gap: .8rem;
}
.section__label .mono { color: var(--accent); font-size: 1em; }
.section__label::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.section__title {
  font-size: clamp(1.85rem, 4vw, 2.85rem); font-weight: 600;
  max-width: 20ch; margin-bottom: 2.2rem;
}

/* ---------- about ---------- */
/* Panel carries more rows now, so it gets more of the column. */
.about { display: grid; grid-template-columns: 1.15fr 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: start; }
.about__body p { color: var(--muted); max-width: 62ch; }
.about__body .section__title { max-width: 24ch; }

.about__facts {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.6rem; background: var(--surface); box-shadow: var(--shadow);
}
.about__facts dl { margin: 0; display: grid; gap: 0; }
.about__facts dl > div { padding: .8rem 0; border-bottom: 1px solid var(--line-soft); }
.about__facts dl > div:first-child { padding-top: 0; }
.about__facts dl > div:last-child { padding-bottom: 0; border-bottom: 0; }
.about__facts dt {
  font-size: .69rem; text-transform: uppercase; letter-spacing: .14em;
  color: var(--muted); margin-bottom: .3rem;
}
.about__facts dd { margin: 0; font-size: .92rem; line-height: 1.45; }
.dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: #3fb950; margin-right: .5rem; translate: 0 -1px;
}

@media (max-width: 860px) { .about { grid-template-columns: 1fr; } }

/* ---------- capabilities ---------- */
.caps { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 2.5rem; }
.cap { border-top: 2px solid var(--accent); padding-top: 1.3rem; }
.cap__num { color: var(--accent); font-size: .78rem; margin: 0 0 .7rem; letter-spacing: .12em; }
.cap__title { font-size: 1.28rem; font-weight: 600; margin-bottom: .7rem; }
.cap__desc { color: var(--muted); font-size: .95rem; margin: 0; }

.cred {
  margin: 3.2rem 0 0; padding-top: 1.6rem; border-top: 1px solid var(--line);
  color: var(--muted); font-size: .92rem;
}
.cred strong { color: var(--text); font-weight: 500; }

/* ---------- project cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1.3rem; }

.card {
  position: relative; display: flex; flex-direction: column;
  padding: 1.7rem; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface);
  transition: transform .35s var(--ease), border-color .35s var(--ease), box-shadow .35s var(--ease);
}
.card:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); box-shadow: var(--shadow); }
@media (prefers-reduced-motion: reduce) { .card:hover { transform: none; } }

.card__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.1rem; }
.card__year { color: var(--muted); font-size: .78rem; }

.status {
  display: inline-flex; align-items: center; gap: .45rem;
  font-family: var(--font-mono); font-size: .72rem; text-transform: uppercase;
  letter-spacing: .1em; padding: .3rem .6rem; border-radius: 100px;
  border: 1px solid var(--line);
}
.status__dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.is-live     { color: #3fb950; }
.is-progress { color: var(--accent); }
.is-planned  { color: var(--muted); }

.card__title { font-size: 1.3rem; font-weight: 600; margin-bottom: .7rem; }
.card__desc { color: var(--muted); font-size: .95rem; margin-bottom: 1.2rem; }

.tags { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1.2rem; }
.tags li {
  font-family: var(--font-mono); font-size: .72rem; color: var(--muted);
  padding: .25rem .55rem; border: 1px solid var(--line); border-radius: 6px;
}

.card__links { margin-top: auto; display: flex; gap: 1.2rem; }
.card__link {
  font-family: var(--font-mono); font-size: .82rem; color: var(--accent);
  text-decoration: none; transition: opacity .2s var(--ease);
}
.card__link:hover { opacity: .7; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- stack ---------- */
.stack { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 2.5rem; }
.stack__head {
  font-size: .75rem; text-transform: uppercase; letter-spacing: .16em;
  color: var(--accent); margin: 0 0 1rem; padding-bottom: .7rem;
  border-bottom: 1px solid var(--line);
}
.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chips li {
  font-size: .88rem; padding: .4rem .8rem; border-radius: 8px;
  background: var(--surface); border: 1px solid var(--line);
  transition: border-color .25s var(--ease), color .25s var(--ease);
}
.chips li:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- contact ---------- */
.contact { max-width: 46ch; }
.contact__title { margin-bottom: 1.2rem; }
.contact__blurb { color: var(--muted); margin-bottom: 2rem; }
.contact__links { display: flex; flex-wrap: wrap; gap: 1.4rem; margin-top: 1.8rem; }
.contact__links a {
  font-family: var(--font-mono); font-size: .84rem; color: var(--muted);
  text-decoration: none; transition: color .2s var(--ease);
}
.contact__links a:hover { color: var(--accent); }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--line); padding: 2.2rem 0; }
.footer__inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.footer__copy { color: var(--muted); margin: 0; font-size: .8rem; }
.footer__top { color: var(--muted); text-decoration: none; font-size: .8rem; transition: color .2s var(--ease); }
.footer__top:hover { color: var(--accent); }

/* ---------- scroll reveal ----------
   Opt-in by design: the hidden state only applies once JS has added .js to <html>.
   If the script fails, is blocked, or never runs, every section renders normally.  */
.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}
.js .reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
}
