:root {
  --accent: #F0874F;
  --on-accent: #000000;
  --mono: 'DM Mono', ui-monospace, monospace;
  --sans: 'Bricolage Grotesque', system-ui, sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #000000;
  --fg: #ECE8E1;
  --muted: #8F8B84;
  --line: #2A2A2A;
  --panel: #000000;
  --star-1: #EDE3CC;
  --star-2: #A59A82;
  --star-3: #3A362E;
  --meteor-head: #D6DEEC;
  --meteor-tail: #6E7B93;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #EFEBE3;
  --fg: #161514;
  --muted: #5F5B54;
  --line: #CDC7BB;
  --panel: #F8F6F1;
  --star-1: #6F6553;
  --star-2: #A39985;
  --star-3: #D2CABB;
  --meteor-head: #2E3646;
  --meteor-tail: #7F8899;
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--fg); }
p { margin: 0; }

.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.small { font-size: 12px; }

/* Sky */
.sky {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  user-select: none;
  font-family: var(--mono), 'Segoe UI Symbol', 'Noto Sans Symbols 2', sans-serif;
}
.star { position: absolute; line-height: 1; }
.star.l1 { color: var(--star-1); }
.star.l2 { color: var(--star-2); }
.star.l3 { color: var(--star-3); }
.trail { position: absolute; font-size: 13px; line-height: 1; color: var(--meteor-tail); }
.trail.head { color: var(--meteor-head); }

/* Layout */
.page {
  position: relative;
  max-width: 1040px;
  margin: 0 auto;
  padding: 24px clamp(16px, 4vw, 48px) 0;
  display: flex;
  flex-direction: column;
}

.panel {
  border: 1px solid var(--line);
  background: var(--panel);
}

.bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
}

header.bar {
  padding: 6px 8px 6px 16px;
  font-family: var(--mono);
  font-size: 13px;
}
.home { text-decoration: none; padding: 12px 0; }

.nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 20px;
}
.nav > a:not(.resume-btn) { color: var(--muted); text-decoration: none; padding: 12px 0; }
.nav > a:not(.resume-btn):hover { color: var(--fg); }

.resume-btn {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--accent);
  color: var(--accent);
  text-decoration: none;
}
.resume-btn:hover { background: var(--accent); color: var(--on-accent); }

.theme-btn {
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--fg);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}
.theme-btn:hover { border-color: var(--fg); }
:root[data-theme="dark"] .icon-moon,
:root[data-theme="light"] .icon-sun { display: none; }

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

/* Hero */
.hero {
  padding: clamp(110px, 16vw, 220px) 0 clamp(48px, 6vw, 72px);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
}
.prompt {
  font-family: var(--mono);
  font-size: 13px;
  padding: 4px 10px;
  color: var(--muted);
}
.name {
  margin: 0;
  font-size: clamp(60px, 11vw, 168px);
  line-height: 0.95;
  font-weight: 800;
  font-stretch: 75%;
  letter-spacing: -0.035em;
}
.name span {
  background: var(--accent);
  color: var(--on-accent);
  padding: 0 0.08em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

/* Boxed sections */
.box {
  position: relative;
  padding: 40px clamp(20px, 3.5vw, 44px) 36px;
  margin-top: 56px;
  scroll-margin-top: 24px;
}
.about { margin-top: 0; display: flex; flex-wrap: wrap; gap: 24px 56px; }
.label {
  position: absolute;
  top: -11px;
  left: 20px;
  margin: 0;
  padding: 0 8px;
  background: var(--panel);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 400;
  line-height: 20px;
  color: var(--muted);
}

.lead {
  flex: 1 1 340px;
  min-width: 0;
  font-size: clamp(22px, 2.3vw, 30px);
  line-height: 1.3;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.about-body {
  flex: 1 1 320px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-size: 17px;
  line-height: 1.65;
}

/* Projects */
.projects {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 36px 24px;
}
.project {
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-decoration: none;
  font-size: 15px;
  line-height: 1.5;
}
.thumb {
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line);
  display: flex;
  align-items: flex-end;
  padding: 12px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.project:hover .thumb { border-color: var(--fg); }
.project-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.project-head .mono { font-size: 12px; }
.project-title { font-size: 21px; font-weight: 700; }

/* Resume */
.resume { display: flex; flex-wrap: wrap; gap: 32px 56px; }
.jobs { flex: 2 1 420px; min-width: 0; display: flex; flex-direction: column; }
.job {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 24px;
  padding: 18px 0;
  border-bottom: 1px dashed var(--line);
}
.job:first-child { padding-top: 0; }
.job:last-child { border-bottom: 0; padding-bottom: 0; }
.job > div { flex: 1 1 240px; min-width: 0; }
.job p { margin-top: 4px; font-size: 15px; line-height: 1.55; }
.when { flex: 0 0 116px; font-size: 13px; padding-top: 3px; }
.job-title { font-size: 18px; font-weight: 700; }
.aside {
  flex: 1 1 220px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 28px;
  font-size: 15px;
  line-height: 1.7;
}
.aside > div { display: flex; flex-direction: column; gap: 4px; }
.outline-btn {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--fg);
  text-decoration: none;
  font-family: var(--mono);
  font-size: 13px;
}
.outline-btn:hover { background: var(--fg); color: var(--bg); }

/* Contact */
#contact { display: flex; flex-direction: column; gap: 20px; }
.contact-line {
  font-size: clamp(28px, 3.6vw, 46px);
  line-height: 1.15;
  font-weight: 700;
  font-stretch: 85%;
  letter-spacing: -0.02em;
}
.contact-line a { text-underline-offset: 6px; text-decoration-thickness: 2px; overflow-wrap: anywhere; }
.contact-line a:hover { color: var(--accent); }
.links { display: flex; flex-wrap: wrap; gap: 0 24px; font-size: 13px; }
.links a { padding: 12px 0; }

/* Footer */
.foot {
  margin: 56px 0 32px;
  padding: 10px 16px;
  font-size: 12px;
  color: var(--muted);
}
