/* =========================================================
   Tim Van Engeland — personal site
   Restrained editorial layout. Identity carried by type,
   one accent, and the copy — not effects.
   ========================================================= */

/* ---------- Tokens: light (default) ---------- */
:root {
  --bg:          #f6f4f5;
  --surface:     #ffffff;
  --surface-2:   #efecee;
  --ink:         #191720;
  --ink-soft:    #423d4e;
  --muted:       #6c6875;
  --line:        rgba(25, 23, 32, 0.14);
  --line-soft:   rgba(25, 23, 32, 0.08);
  --accent:      #c81c6e;
  --accent-ink:  #ffffff;
  --accent-soft: rgba(200, 28, 110, 0.09);

  --font-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --font-body:    "IBM Plex Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono:    "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  --wrap:  1080px;
  --pad-x: clamp(20px, 6vw, 64px);
  --ease:  cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* ---------- Tokens: dark ---------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:          #0f0e13;
    --surface:     #17161d;
    --surface-2:   #1e1c26;
    --ink:         #ecebf1;
    --ink-soft:    #c7c4d2;
    --muted:       #9995a6;
    --line:        rgba(255, 255, 255, 0.13);
    --line-soft:   rgba(255, 255, 255, 0.07);
    --accent:      #ff5c9d;
    --accent-ink:  #16101a;
    --accent-soft: rgba(255, 92, 157, 0.12);
  }
}
:root[data-theme="dark"] {
  --bg:          #0f0e13;
  --surface:     #17161d;
  --surface-2:   #1e1c26;
  --ink:         #ecebf1;
  --ink-soft:    #c7c4d2;
  --muted:       #9995a6;
  --line:        rgba(255, 255, 255, 0.13);
  --line-soft:   rgba(255, 255, 255, 0.07);
  --accent:      #ff5c9d;
  --accent-ink:  #16101a;
  --accent-soft: rgba(255, 92, 157, 0.12);
}

/* ---------- Reset ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.015em;
  text-wrap: balance;
  color: var(--ink);
}

a { color: inherit; text-decoration: none; }
strong { font-weight: 600; color: var(--ink); }
img { max-width: 100%; display: block; }

::selection { background: var(--accent); color: var(--accent-ink); }

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

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  border-radius: 6px;
  transform: translateY(-160%);
  transition: transform 0.2s var(--ease);
}
.skip-link:focus-visible { transform: none; }

/* ---------- Layout helpers ---------- */
.wrap {
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--pad-x);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease);
}
.site-header.scrolled {
  border-bottom-color: var(--line-soft);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 68px;
}
.brand {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.98rem;
  letter-spacing: -0.01em;
}
.nav {
  display: flex;
  gap: 30px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.02em;
}
.nav a {
  color: var(--muted);
  padding: 4px 0;
  position: relative;
  transition: color 0.2s var(--ease);
}
.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s var(--ease);
}
.nav a:hover { color: var(--ink); }
.nav a:hover::after { transform: scaleX(1); }

.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  position: relative;
}
.nav-toggle span {
  position: absolute;
  left: 50%;
  width: 16px;
  height: 1.5px;
  background: var(--ink);
  transform: translateX(-50%);
  transition: transform 0.25s var(--ease), opacity 0.25s var(--ease);
}
.nav-toggle span:nth-child(1) { top: 15px; }
.nav-toggle span:nth-child(2) { bottom: 15px; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { top: 19px; transform: translateX(-50%) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { bottom: 19px; transform: translateX(-50%) rotate(-45deg); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  padding: 12px 22px;
  border-radius: 8px;
  border: 1px solid var(--line);
  transition: transform 0.2s var(--ease), background 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}
.btn-primary:hover { transform: translateY(-2px); }
.btn-quiet {
  background: transparent;
  color: var(--ink);
}
.btn-quiet:hover { border-color: var(--ink); transform: translateY(-2px); }

/* ---------- Intro ---------- */
.intro {
  padding-block: clamp(56px, 10vw, 104px) clamp(48px, 8vw, 88px);
  border-bottom: 1px solid var(--line-soft);
}
.intro-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 300px);
  gap: clamp(32px, 6vw, 72px);
  align-items: start;
}
.intro-lead h1 {
  font-size: clamp(2.4rem, 6vw, 3.7rem);
  font-weight: 700;
  margin: 14px 0 22px;
}
.lead {
  font-size: 1.12rem;
  color: var(--ink-soft);
  max-width: 54ch;
}
.lead + .lead { margin-top: 14px; }
.lead-muted { color: var(--muted); }
.intro-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.card-meta {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  padding: 22px 24px;
}
.card-meta dl { display: grid; gap: 16px; }
.card-meta dt {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 3px;
}
.card-meta dd {
  font-size: 0.95rem;
  color: var(--ink);
}

/* ---------- Sections ---------- */
.section {
  padding-block: clamp(64px, 11vw, 120px);
  border-bottom: 1px solid var(--line-soft);
}
.section:last-of-type { border-bottom: 0; }

.section-head { margin-bottom: 44px; max-width: 60ch; }
.section-head h2 {
  font-size: clamp(1.7rem, 4vw, 2.35rem);
  margin: 12px 0 0;
}
.section-head h2 + .section-lead { margin-top: 14px; }
.section-lead { color: var(--muted); font-size: 1.05rem; }

/* ---------- Work ---------- */
.work-list { list-style: none; border-top: 1px solid var(--line); }
.work-item {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr) minmax(0, 200px);
  gap: 24px 32px;
  padding: 26px 8px;
  border-bottom: 1px solid var(--line);
  position: relative;
  transition: background 0.25s var(--ease);
}
.work-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--accent);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.3s var(--ease);
}
.work-item:hover {
  background: var(--accent-soft);
}
.work-item:hover::before { transform: scaleY(1); }
.work-kind {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: 4px;
}
.work-body h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 8px;
  transition: color 0.2s var(--ease);
}
.work-item:hover .work-body h3 { color: var(--accent); }
.work-body p { color: var(--muted); font-size: 0.96rem; max-width: 52ch; }
.work-tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-content: flex-start;
  padding-top: 3px;
}
.work-tags li {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 3px 8px;
}

/* ---------- Skills ---------- */
.skills {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(232px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.skills > div {
  background: var(--bg);
  padding: 20px 22px;
}
.skills dt {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}
.skills dd {
  font-size: 0.95rem;
  color: var(--ink-soft);
  line-height: 1.5;
}

/* ---------- Sounds ---------- */
.sounds-panel {
  background: var(--accent-soft);
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  padding: clamp(28px, 5vw, 52px);
}
.sounds-panel .section-head { margin-bottom: 36px; }
.sounds-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: clamp(28px, 5vw, 56px);
  align-items: start;
}
.sounds-copy p { color: var(--ink-soft); }
.sounds-copy p + p { margin-top: 16px; }

.tracklist-block .eyebrow { color: var(--muted); }
.tracklist {
  list-style: none;
  counter-reset: t;
  margin-top: 16px;
}
.tracklist li {
  counter-increment: t;
  display: flex;
  flex-direction: column;
  padding: 11px 0 11px 34px;
  border-bottom: 1px solid var(--line-soft);
  position: relative;
}
.tracklist li:last-child { border-bottom: 0; }
.tracklist li::before {
  content: counter(t, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 13px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--accent);
}
.t-name { font-weight: 500; }
.t-artist {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
}

/* ---------- SoundCloud embed ---------- */
.sc { margin-top: clamp(28px, 4vw, 40px); }
.sc > .eyebrow { color: var(--muted); display: block; margin-bottom: 12px; }
.sc-switch {
  display: inline-flex;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 14px;
}
.sc-tab {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  padding: 6px 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}
.sc-tab:hover { color: var(--ink); }
.sc-tab.is-active {
  background: var(--accent);
  color: var(--accent-ink);
}
#scFrame {
  display: block;
  width: 100%;
  border-radius: 10px;
  background: var(--surface-2);
}
.sc-follow {
  display: flex;
  gap: 18px;
  margin-top: 12px;
  font-family: var(--font-mono);
  font-size: 0.76rem;
}
.sc-follow a {
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  padding-bottom: 1px;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.sc-follow a:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr);
  gap: clamp(28px, 5vw, 56px);
  align-items: start;
}
.portrait {
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.9rem;
  letter-spacing: 0.12em;
  color: var(--muted);
}
.about-copy p { color: var(--ink-soft); max-width: 58ch; }
.about-copy p + p { margin-top: 14px; }
.facts {
  margin-top: 30px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 0;
}
.facts > div {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 20px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line-soft);
}
.facts dt {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: 2px;
}
.facts dd { font-size: 0.96rem; }

/* ---------- Contact ---------- */
.contact-block { max-width: 52ch; }
.contact-block h2 {
  font-size: clamp(2rem, 5vw, 3rem);
  margin: 12px 0 16px;
}
.contact-block .btn { margin-top: 26px; }
.contact-links {
  list-style: none;
  display: flex;
  gap: 22px;
  margin-top: 26px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
}
.contact-links a {
  color: var(--muted);
  padding-bottom: 2px;
  border-bottom: 1px solid var(--line);
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.contact-links a:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line-soft);
  padding-block: 32px 40px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

/* ---------- Reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}
.reveal.in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .nav {
    position: fixed;
    inset: 68px 0 auto 0;
    flex-direction: column;
    gap: 4px;
    padding: 12px var(--pad-x) 20px;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    font-size: 1rem;
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
  }
  .nav a { padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
  .nav a::after { display: none; }
  .nav.open { transform: none; opacity: 1; pointer-events: auto; }
  .nav-toggle { display: block; }

  .intro-grid { grid-template-columns: 1fr; }

  .work-item {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 24px 8px;
  }
  .work-kind { padding-top: 0; }

  .sounds-grid { grid-template-columns: 1fr; }

  .about-grid { grid-template-columns: 1fr; }
  .portrait { width: 132px; }
}

@media (max-width: 460px) {
  .facts > div { grid-template-columns: 1fr; gap: 2px; }
  .sc-switch { display: flex; }
  .sc-tab { flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}
