/* =========================================================================
   Andrew Angus — portfolio
   Dark, console-room palette. One warm accent, one signal green.
   ========================================================================= */

:root {
  --bg:        #0b0c0e;
  --bg-raised: #131519;
  --bg-sunk:   #08090a;
  --line:      #22262c;
  --line-soft: #191c21;
  --text:      #e9e7e4;
  --muted:     #8d939c;
  --dim:       #5e646d;
  --accent:    #ff9548;
  --accent-dk: #c96a26;
  --signal:    #6ee7a0;

  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;

  --wrap: 1120px;
  --r: 12px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; }

a { color: inherit; }

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

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 99;
  background: var(--accent); color: #12100d; padding: 10px 16px;
  font: 500 14px var(--mono); border-radius: 0 0 var(--r) 0;
}
.skip:focus { left: 0; }

/* ---------- shared type ---------------------------------------------- */

.eyebrow {
  font: 500 11.5px/1 var(--mono);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 18px;
}

h1, h2, h3 { letter-spacing: -.025em; line-height: 1.08; margin: 0; }

h2 {
  font-size: clamp(2rem, 5vw, 3.1rem);
  font-weight: 600;
}

.sec-sub {
  color: var(--muted);
  max-width: 58ch;
  margin: 18px 0 0;
  font-size: 1.0625rem;
}

/* ---------- nav ------------------------------------------------------- */

.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid transparent;
  transition: border-color .25s ease, background .25s ease;
}
.nav.stuck { border-bottom-color: var(--line); }

.nav-inner {
  max-width: var(--wrap);
  margin-inline: auto;
  padding: 14px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}

.brand {
  display: inline-flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--text);
  font-weight: 600; letter-spacing: -.01em;
}
.brand-mark { width: 28px; height: 18px; color: var(--accent); flex: none; }
.brand:hover .brand-mark { color: var(--signal); }
.brand-mark, .brand-text { transition: color .2s ease; }

.nav-links {
  display: flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 13px;
}
.nav-links a {
  text-decoration: none; color: var(--muted);
  padding: 7px 11px; border-radius: 7px;
  transition: color .18s ease, background .18s ease;
}
.nav-links a:hover, .nav-links a:focus-visible { color: var(--text); background: var(--bg-raised); }
.nav-links a.active { color: var(--accent); }

.nav-icon { display: inline-flex; padding: 7px !important; }
.nav-icon svg { width: 17px; height: 17px; display: block; }

@media (max-width: 720px) {
  .brand-text { display: none; }
  .nav-links a:not(.nav-icon) { padding: 7px 8px; font-size: 12.5px; }
}

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

.hero {
  position: relative;
  padding: clamp(72px, 13vw, 150px) 0 0;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.hero-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--line-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(120% 90% at 20% 0%, #000 0%, transparent 72%);
  -webkit-mask-image: radial-gradient(120% 90% at 20% 0%, #000 0%, transparent 72%);
  pointer-events: none;
}

.hero-inner { position: relative; padding-bottom: clamp(40px, 7vw, 80px); }

.hero-name {
  font-size: clamp(3.4rem, 12.5vw, 8.5rem);
  font-weight: 700;
  letter-spacing: -.045em;
  margin: 0 0 26px;
  background: linear-gradient(168deg, #fffdfb 10%, #cfcac4 62%, #a9a39c 100%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}

.lede {
  max-width: 62ch;
  font-size: clamp(1.0625rem, 1.8vw, 1.25rem);
  color: #c6c3bf;
  margin: 0 0 34px;
}

.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 52px; }

.btn {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 12px 20px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-raised);
  color: var(--text);
  font: 500 14px var(--sans);
  text-decoration: none;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, transform .18s ease, color .18s ease;
}
.btn svg { width: 16px; height: 16px; flex: none; }
.btn:hover { border-color: var(--dim); transform: translateY(-1px); }
.btn-primary {
  background: var(--accent); border-color: var(--accent); color: #17110a; font-weight: 600;
}
.btn-primary:hover { background: #ffa661; border-color: #ffa661; }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--text); }

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 22px 28px;
  margin: 0;
  padding-top: 32px;
  border-top: 1px solid var(--line);
}
.facts dt {
  font: 500 11px var(--mono);
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--dim); margin-bottom: 6px;
}
.facts dd { margin: 0; font-size: .95rem; color: #cfccc8; }

.hero-viz {
  display: block;
  width: 100%;
  height: 150px;
  opacity: .9;
}
@media (max-width: 700px) { .hero-viz { height: 100px; } }

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

.section { padding-block: clamp(72px, 10vw, 128px); }
.section + .section { border-top: 1px solid var(--line); }
.sec-head { margin-bottom: clamp(36px, 5vw, 60px); }

/* ---------- tracks ---------------------------------------------------- */

.tracks { display: grid; gap: 20px; }

.track {
  background: linear-gradient(180deg, var(--bg-raised), #101216);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 22px;
  transition: border-color .22s ease;
}
.track:hover { border-color: #2f343b; }
.track.playing { border-color: var(--accent-dk); }

.track-head { display: flex; align-items: center; gap: 16px; }

.play {
  width: 50px; height: 50px; flex: none;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--bg-sunk);
  color: var(--accent);
  display: grid; place-items: center;
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease, color .18s ease, transform .12s ease;
}
.play svg { width: 18px; height: 18px; }
.play:hover { background: var(--accent); border-color: var(--accent); color: #17110a; }
.play:active { transform: scale(.94); }
.track.playing .play { background: var(--accent); border-color: var(--accent); color: #17110a; }

.track-meta { flex: 1 1 auto; min-width: 0; }
.track-meta h3 { font-size: 1.2rem; font-weight: 600; }
.track-credit {
  margin: 4px 0 0;
  font: 400 12.5px var(--mono);
  color: var(--muted);
}
.track-credit .sep { color: var(--dim); margin-inline: 7px; }
.track-credit .role { color: var(--signal); }

.vol { display: flex; align-items: center; gap: 6px; flex: none; }
.vol-btn {
  width: 30px; height: 30px; padding: 0;
  display: grid; place-items: center;
  background: none; border: 0; border-radius: 6px;
  color: var(--muted); cursor: pointer;
  transition: color .18s ease, background .18s ease;
}
.vol-btn svg { width: 18px; height: 18px; }
.vol-btn:hover { color: var(--text); background: var(--bg-sunk); }

.vol-range {
  -webkit-appearance: none; appearance: none;
  width: 92px; height: 18px; margin: 0;
  background: transparent; cursor: pointer;
}
.vol-range::-webkit-slider-runnable-track {
  height: 4px; border-radius: 2px;
  background: linear-gradient(90deg, var(--accent) var(--v, 100%), #2b3037 var(--v, 100%));
}
.vol-range::-moz-range-track { height: 4px; border-radius: 2px; background: #2b3037; }
.vol-range::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--accent); }
.vol-range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 12px; height: 12px; margin-top: -4px;
  border-radius: 50%; border: 0; background: #f3efea;
}
.vol-range::-moz-range-thumb {
  width: 12px; height: 12px; border-radius: 50%; border: 0; background: #f3efea;
}

.track-time {
  font: 400 12.5px var(--mono); color: var(--dim);
  flex: none; font-variant-numeric: tabular-nums;
}
.track-time .cur { color: var(--text); }

.wave-wrap {
  position: relative;
  margin: 18px 0 0;
  height: 84px;
  cursor: pointer;
  border-radius: 6px;
}
.wave-wrap:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.wave { display: block; width: 100%; height: 100%; }



@media (max-width: 560px) {
  .track { padding: 18px 16px; }
  .track-time { display: none; }
  .vol { display: none; }
  .wave-wrap { height: 64px; }
}

/* ---------- projects -------------------------------------------------- */

.projects { display: grid; gap: 20px; }
@media (min-width: 900px) {
  .projects { grid-template-columns: 1fr 1fr; }
  /* An odd one out takes the full row rather than leaving a hole beside it. */
  .project:last-child:nth-child(odd) { grid-column: 1 / -1; }
}

.project {
  display: flex; flex-direction: column;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 28px;
  position: relative;
  overflow: hidden;
  transition: border-color .22s ease, transform .22s ease;
}
.project::before {
  content: ""; position: absolute; inset: 0 0 auto; height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent 70%);
  opacity: .5; transition: opacity .22s ease;
}
.project:hover { border-color: #2f343b; transform: translateY(-2px); }
.project:hover::before { opacity: 1; }

.project-top {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 14px; margin-bottom: 14px;
}
.project h3 { font-size: 1.45rem; font-weight: 600; }
.project-year { font: 400 12px var(--mono); color: var(--dim); flex: none; }
.project-tag {
  font: 500 11px var(--mono); letter-spacing: .12em; text-transform: uppercase;
  color: var(--signal); margin: 0 0 14px;
}
.project-blurb { color: var(--muted); margin: 0 0 20px; font-size: .95rem; }

.stack { list-style: none; display: flex; flex-wrap: wrap; gap: 7px; margin: 0 0 20px; padding: 0; }
.stack li {
  font: 400 11px var(--mono); color: var(--dim);
  border: 1px solid var(--line-soft); background: var(--bg-sunk);
  border-radius: 5px; padding: 3px 9px;
}

.project-links { margin-top: auto; display: flex; flex-wrap: wrap; gap: 16px; }
.project-links a {
  font: 500 13.5px var(--sans); color: var(--accent); text-decoration: none;
  display: inline-flex; align-items: center; gap: 6px;
}
.project-links a:hover { text-decoration: underline; text-underline-offset: 3px; }
.project-links .private { color: var(--dim); font: 400 12.5px var(--mono); }

/* ---------- about ----------------------------------------------------- */

.about-copy > p {
  color: var(--muted);
  max-width: 62ch;
  margin: 0 0 20px;
  font-size: 1.0625rem;
}
.about-copy > p:last-child { margin-bottom: 0; }

/* ---------- resume ---------------------------------------------------- */

.resume-card {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--bg-raised);
  overflow: hidden;
}
.resume-tabs {
  display: flex; gap: 6px; padding: 14px 22px 0;
  border-bottom: 1px solid var(--line);
}
.resume-tab {
  font: 500 13px var(--mono);
  color: var(--muted);
  background: none; border: 0; cursor: pointer;
  padding: 10px 14px;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color .18s ease, border-color .18s ease;
}
.resume-tab:hover { color: var(--text); }
.resume-tab[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }

#footer-resumes { display: contents; }

.resume-actions {
  display: flex; flex-wrap: wrap; gap: 12px;
  padding: 22px;
  border-bottom: 1px solid var(--line);
}
.resume-embed {
  display: block; width: 100%; height: min(78vh, 900px);
  border: 0; background: var(--bg-sunk);
}
.resume-fallback { padding: 40px 24px; text-align: center; color: var(--muted); }
.resume-fallback a { color: var(--accent); }
@media (max-width: 700px) { .resume-embed { height: 60vh; } }

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

.footer { border-top: 1px solid var(--line); background: var(--bg-sunk); padding-top: 64px; }
.listening {
  display: flex; align-items: center; gap: 16px;
  max-width: 460px;
  margin: 0 0 48px;
  padding: 12px 16px 12px 12px;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--r);
  text-decoration: none; color: var(--text);
  transition: border-color .2s ease;
}
.listening[hidden] { display: none; }
.listening:hover { border-color: #2f343b; }
.listening-art {
  width: 56px; height: 56px; flex: none;
  border-radius: 8px; background: var(--bg-sunk) center / cover no-repeat;
  border: 1px solid var(--line-soft);
}
.listening-body { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.listening-status {
  display: flex; align-items: center; gap: 8px;
  font: 500 11px var(--mono); letter-spacing: .14em; text-transform: uppercase;
  color: var(--dim);
}
.listening.live .listening-status { color: var(--signal); }
.listening-title, .listening-artist {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.listening-title { font-weight: 600; font-size: .98rem; }
.listening-artist { color: var(--muted); font-size: .88rem; }

.eq { display: none; gap: 2px; align-items: flex-end; height: 11px; }
.listening.live .eq { display: inline-flex; }
.eq i {
  width: 2px; height: 100%; background: currentColor; border-radius: 1px;
  transform-origin: bottom; animation: eq 1s ease-in-out infinite;
}
.eq i:nth-child(2) { animation-delay: -.35s; }
.eq i:nth-child(3) { animation-delay: -.7s; }
@keyframes eq { 0%, 100% { transform: scaleY(.3); } 50% { transform: scaleY(1); } }

.footer-inner {
  display: flex; flex-wrap: wrap; gap: 32px;
  justify-content: space-between; align-items: flex-start;
  padding-bottom: 52px;
}
.footer-mail {
  display: inline-block;
  font-size: clamp(1.25rem, 3.4vw, 2rem);
  font-weight: 600; letter-spacing: -.02em;
  color: var(--text); text-decoration: none;
  border-bottom: 1px solid var(--line-soft);
  transition: color .2s ease, border-color .2s ease;
  overflow-wrap: anywhere;
}
.footer-mail:hover { color: var(--accent); border-color: var(--accent); }
.footer-loc { color: var(--dim); font: 400 13px var(--mono); margin: 10px 0 0; }

.footer-links { display: flex; flex-direction: column; gap: 10px; }
.footer-links a {
  font: 400 14px var(--mono); color: var(--muted); text-decoration: none;
  transition: color .18s ease;
}
.footer-links a:hover { color: var(--accent); }

.footer-base {
  display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between;
  border-top: 1px solid var(--line-soft);
  padding-block: 22px 30px;
  font: 400 12px var(--mono); color: var(--dim);
}
.footer-base p { margin: 0; }

/* ---------- motion ---------------------------------------------------- */

.reveal { opacity: 0; transform: translateY(18px); }
.reveal.in { opacity: 1; transform: none; transition: opacity .6s ease, transform .6s cubic-bezier(.2,.7,.3,1); }

@media (prefers-reduced-motion: reduce) {
  .eq i { animation: none; transform: scaleY(.7); }
  .reveal, .reveal.in { opacity: 1; transform: none; transition: none; }
  .btn:hover, .project:hover { transform: none; }
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

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