/* ─────────────────────────────────────────
   Tokens — Light (default)
───────────────────────────────────────── */

:root {
  --color-bg:           #f5f2ee;
  --color-surface:      #edeae4;
  --color-border:       #d6d1c8;
  --color-text:         #1a1714;
  --color-text-muted:   #7a7570;
  --color-accent:       #3d3530;
  --color-highlight:    #e8e0d0;

  --font-mono:          'Fira Mono', 'Courier New', monospace;
  --font-size-base:     13px;
  --font-size-sm:       11px;
  --line-height:        1.6;
  --letter-tight:       -0.03em;
  --letter-wide:        0.08em;

  --space-xs:           0.5rem;
  --space-sm:           1rem;
  --space-md:           1.75rem;
  --space-lg:           3rem;
  --space-xl:           4.5rem;

  --measure:            65ch;
  --padding-x:          1.5rem;
}

/* ─────────────────────────────────────────
   Tokens — Dark
───────────────────────────────────────── */

[data-theme="dark"] {
  --color-bg:           #141414;
  --color-surface:      #1e1e1e;
  --color-border:       #2e2e2e;
  --color-text:         #e8e4de;
  --color-text-muted:   #7a7570;
  --color-accent:       #c9b99a;
  --color-highlight:    #252018;
}

/* ─────────────────────────────────────────
   Tokens — Accent / Amber
───────────────────────────────────────── */

[data-theme="amber"] {
  --color-bg:           #1c1509;
  --color-surface:      #261c0c;
  --color-border:       #3d2e14;
  --color-text:         #f0dfc0;
  --color-text-muted:   #a08850;
  --color-accent:       #f5b942;
  --color-highlight:    #2e2008;
}

/* ─────────────────────────────────────────
   Reset
───────────────────────────────────────── */

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

/* ─────────────────────────────────────────
   Base
───────────────────────────────────────── */

html {
  font-size: var(--font-size-base);
  background-color: var(--color-bg);
  color: var(--color-text);
  transition: background-color 0.2s ease, color 0.2s ease;
}

body {
  font-family: var(--font-mono);
  font-size: var(--font-size-base);
  font-feature-settings: "ss01" 1;
  line-height: var(--line-height);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}

/* ─────────────────────────────────────────
   Layout
───────────────────────────────────────── */

.page {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

.container {
  max-width: var(--measure);
  margin-inline: auto;
  padding-inline: var(--padding-x);
  width: 100%;
}

main.container {
  flex: 1;
  padding-block-end: 4rem;
}

/* ─────────────────────────────────────────
   Header
───────────────────────────────────────── */

.site-header {
  padding-block-start: var(--space-xl);
  padding-block-end: var(--space-lg);
}

.name {
  font-size: var(--font-size-base);
  letter-spacing: var(--letter-tight);
  color: var(--color-text);
  margin-block-end: var(--space-xs);
}

.role {
  color: var(--color-text-muted);
  margin-block-end: var(--space-sm);
}

.tagline {
  color: var(--color-text-muted);
  font-style: italic;
}

/* ─────────────────────────────────────────
   Sections
───────────────────────────────────────── */

.section {
  margin-block-end: var(--space-lg);
}

.section p + p {
  margin-block-start: var(--space-sm);
}

.label {
  font-size: var(--font-size-sm);
  letter-spacing: var(--letter-wide);
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-block-end: var(--space-sm);
}

/* ─────────────────────────────────────────
   Work list
───────────────────────────────────────── */

.work-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.work-item {
  padding-inline-start: 1.2em;
  position: relative;
}

.work-item::before {
  content: '–';
  position: absolute;
  left: 0;
  color: var(--color-text-muted);
}

.work-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-sm);
  margin-block-end: 0.3em;
}

.work-title {
  color: var(--color-text);
}

.work-meta {
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
  white-space: nowrap;
}

.work-desc {
  color: var(--color-text-muted);
}

.role-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4em;
  margin-block: 0.4em 0.6em;
}

.role-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-sm);
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
}

.role-name {
  color: var(--color-text);
}

/* ─────────────────────────────────────────
   Skills marquee
───────────────────────────────────────── */

.marquee-wrap {
  overflow: hidden;
  margin-block-start: var(--space-sm);
  margin-block-end: var(--space-xl);
}

.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee 90s linear infinite;
}

.marquee-track:hover {
  animation-play-state: paused;
}

.marquee-content {
  display: flex;
  gap: var(--space-md);
  padding-inline-end: var(--space-md);
  white-space: nowrap;
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

.marquee-content span::before {
  content: '·';
  margin-inline-end: var(--space-md);
  opacity: 0.4;
}

.marquee-content span:first-child::before {
  display: none;
}

@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ─────────────────────────────────────────
   Link list (contact)
───────────────────────────────────────── */

.link-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4em;
}

.link-list li {
  padding-inline-start: 1.2em;
  position: relative;
}

.link-list li::before {
  content: '–';
  position: absolute;
  left: 0;
  color: var(--color-text-muted);
}

/* ─────────────────────────────────────────
   Links
───────────────────────────────────────── */

a.link {
  color: var(--color-accent);
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 3px;
  border-radius: 2px;
  transition:
    text-decoration-color 0.15s ease,
    background-color 0.15s ease,
    color 0.15s ease;
}

a.link:hover {
  text-decoration-color: var(--color-accent);
  text-decoration-style: wavy;
  background-color: var(--color-highlight);
  color: var(--color-text);
}

/* ─────────────────────────────────────────
   Footer
───────────────────────────────────────── */

.site-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--color-bg);
  border-block-start: 1px solid var(--color-border);
  padding-block: var(--space-sm);
  transition: border-color 0.2s ease, background 0.2s ease;
  z-index: 10;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-sm);
}

.footer-copy {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

/* ─────────────────────────────────────────
   Theme toggle
───────────────────────────────────────── */

.theme-toggle {
  display: flex;
  gap: var(--space-sm);
}

.theme-toggle button {
  background: none;
  border: none;
  font-family: var(--font-mono);
  font-size: var(--font-size-sm);
  font-feature-settings: "ss01" 1;
  letter-spacing: var(--letter-wide);
  text-transform: uppercase;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 0;
  transition: color 0.15s ease;
}

.theme-toggle button:hover {
  color: var(--color-text);
}

.theme-toggle button[data-active="true"] {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ─────────────────────────────────────────
   Responsive
───────────────────────────────────────── */

@media (max-width: 480px) {
  :root {
    --space-xl: 3rem;
    --space-lg: 2rem;
  }

  .work-header {
    flex-direction: column;
    gap: 0.1em;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-xs);
  }
}

/* ─────────────────────────────────────────
   System preference fallback (no JS)
───────────────────────────────────────── */

@media (prefers-color-scheme: dark) {
  html:not([data-theme]) {
    --color-bg:           #141414;
    --color-surface:      #1e1e1e;
    --color-border:       #2e2e2e;
    --color-text:         #e8e4de;
    --color-text-muted:   #7a7570;
    --color-accent:       #c9b99a;
    --color-highlight:    #252018;
  }
}
