@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('../fonts/inter-var.woff2') format('woff2-variations');
}

:root {
  --slate-900: 15 23 42;
  --slate-800: 30 41 59;
  --slate-700: 51 65 85;
  --slate-600: 71 85 105;
  --slate-500: 100 116 139;
  --slate-400: 148 163 184;
  --slate-300: 203 213 225;
  --slate-200: 226 232 240;
  --teal-300: 94 234 212;
  --teal-400: 45 212 191;
  --teal-900: 19 78 74;

  --bg: rgb(var(--slate-900));
  --text: rgb(var(--slate-400));
  --text-strong: rgb(var(--slate-200));
  --accent: rgb(var(--teal-300));
  --rule: rgb(var(--slate-600));

  --shell-max: 1280px;
  --pad-x: 1.5rem;
  --pad-y: 3rem;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  --arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill='black' fill-rule='evenodd' d='M5.22 14.78a.75.75 0 0 0 1.06 0l7.22-7.22v5.69a.75.75 0 0 0 1.5 0v-7.5a.75.75 0 0 0-.75-.75h-7.5a.75.75 0 0 0 0 1.5h5.69l-7.22 7.22a.75.75 0 0 0 0 1.06Z' clip-rule='evenodd'/%3E%3C/svg%3E");
}

@media (min-width: 768px) {
  :root { --pad-x: 3rem; --pad-y: 4rem; }
}

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

html {
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.625;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

::selection {
  background-color: rgb(var(--teal-300));
  color: rgb(var(--teal-900));
}

h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.skip-link {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 60;
  transform: translateY(-120%);
  background-color: #eab308;
  color: rgb(var(--slate-900));
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-radius: 0.25rem;
  transition: transform 0.15s var(--ease);
}
.skip-link:focus-visible { transform: translateY(0); }

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

.spotlight {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 30;
  transition: background 300ms linear;
  background: radial-gradient(
    600px circle at var(--spot-x, 0px) var(--spot-y, 0px),
    rgba(29, 78, 216, 0.15),
    transparent 80%
  );
}

.shell {
  position: relative;
  margin: 0 auto;
  min-height: 100vh;
  max-width: var(--shell-max);
  padding: var(--pad-y) var(--pad-x);
}

.layout {
  animation: fade-up 0.8s var(--ease) both;
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

/* ---------- Masthead ---------- */

.masthead .name {
  font-size: 2.25rem;
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text-strong);
}
.masthead .name a { color: inherit; }

.masthead .role {
  margin-top: 0.75rem;
  font-size: 1.125rem;
  font-weight: 500;
  letter-spacing: -0.025em;
  color: var(--text-strong);
}

.masthead .tagline {
  margin-top: 1rem;
  max-width: 20rem;
  line-height: 1.5;
}

.section-nav { display: none; }
.section-nav ul { margin-top: 4rem; width: max-content; }
.nav-link {
  display: flex;
  align-items: center;
  padding: 0.75rem 0;
}
.nav-indicator {
  margin-right: 1rem;
  display: block;
  height: 1px;
  width: 2rem;
  background-color: rgb(var(--slate-600));
  transition: width 0.2s var(--ease), background-color 0.2s var(--ease);
}
.nav-text {
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgb(var(--slate-500));
  transition: color 0.2s var(--ease);
}
.nav-link:hover .nav-indicator,
.nav-link:focus-visible .nav-indicator {
  width: 4rem;
  background-color: rgb(var(--slate-200));
}
.nav-link:hover .nav-text,
.nav-link:focus-visible .nav-text { color: var(--text-strong); }

.nav-link.is-active .nav-indicator {
  width: 4rem;
  background-color: rgb(var(--slate-200));
}
.nav-link.is-active .nav-text { color: var(--text-strong); }

.socials {
  margin-top: 2rem;
  margin-left: 0.25rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0 1.25rem;
}
.socials li { flex-shrink: 0; }
.socials a {
  display: block;
  color: rgb(var(--slate-400));
  transition: color 0.2s var(--ease), transform 0.2s var(--ease);
}
.socials a:hover { color: var(--text-strong); transform: translateY(-2px); }
.socials svg { height: 1.5rem; width: 1.5rem; }

/* ---------- Content ---------- */

.content { padding-top: 6rem; }

.section {
  margin-bottom: 4rem;
  scroll-margin-top: 4rem;
}
.section:last-of-type { margin-bottom: 0; }

.section-head {
  position: sticky;
  top: 0;
  z-index: 20;
  margin: 0 calc(var(--pad-x) * -1) 1rem;
  width: 100vw;
  padding: 1.25rem var(--pad-x);
  background-color: rgba(var(--slate-900), 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.section-head h2 {
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.25rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-strong);
}

.prose p { margin-bottom: 1rem; }
.prose p:last-child { margin-bottom: 0; }
.prose a {
  font-weight: 500;
  color: var(--text-strong);
  transition: color 0.2s var(--ease);
}
.prose a:hover { color: var(--accent); }

/* ---------- Experience / Projects ---------- */

.entry-list > li { margin-bottom: 3rem; }
.entry-list > li:last-child { margin-bottom: 0; }

.entry,
.project,
.note {
  position: relative;
  transition: opacity 0.2s var(--ease);
}

.entry::before,
.project::before,
.note::before {
  content: "";
  position: absolute;
  inset: -1rem -1.5rem;
  z-index: 0;
  display: none;
  border-radius: 0.375rem;
  transition: background-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
  pointer-events: none;
}

.entry { display: grid; gap: 0.5rem; padding-bottom: 0.25rem; }

.entry-date {
  z-index: 10;
  margin: 0.25rem 0 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  color: rgb(var(--slate-500));
}

.entry-body { z-index: 10; }

.entry-link {
  display: inline-flex;
  align-items: baseline;
  font-weight: 500;
  line-height: 1.25;
  color: var(--text-strong);
}
.entry-link .entry-title { transition: color 0.2s var(--ease); }
.entry-link .entry-org { display: inline-block; }

.entry-link::after {
  content: "";
  display: inline-block;
  height: 0.72em;
  width: 0.72em;
  margin-left: 0.4rem;
  background-color: rgb(var(--slate-500));
  -webkit-mask: var(--arrow) center / contain no-repeat;
  mask: var(--arrow) center / contain no-repeat;
  transform: translateY(-0.05em);
  transition: transform 0.2s var(--ease), background-color 0.2s var(--ease);
}
.entry-link:hover::after,
.entry-link:focus-visible::after {
  transform: translate(-2px, -0.28em);
  background-color: var(--accent);
}

.entry-body h3,
.project-body h3,
.note-body h3 {
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.375;
}
.entry-body > p { margin-top: 0.5rem; font-size: 0.875rem; line-height: 1.5; }

.pills {
  margin-top: 0.5rem;
  display: flex;
  flex-wrap: wrap;
}
.pills li {
  margin-right: 0.375rem;
  margin-top: 0.5rem;
  display: flex;
  align-items: center;
  border-radius: 9999px;
  background-color: rgba(var(--teal-400), 0.1);
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.25rem;
  color: var(--accent);
}

.inline-link {
  position: relative;
  margin-top: 2rem;
  display: inline-flex;
  align-items: center;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-strong);
}
.inline-link span { display: inline-block; }
.inline-link svg {
  margin-left: 0.35rem;
  height: 0.875rem;
  width: 0.875rem;
  transition: transform 0.2s var(--ease);
}
.inline-link:hover { color: var(--accent); }
.inline-link:hover svg { transform: translate(2px, -2px); }

/* ---------- Projects ---------- */

.project { display: grid; gap: 1rem; padding-bottom: 0.25rem; }

.project-body { z-index: 10; }
.project-body p { margin-top: 0.5rem; font-size: 0.875rem; line-height: 1.5; }

.project-thumb {
  z-index: 10;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 0.25rem;
  border: 2px solid rgba(var(--slate-200), 0.1);
  transition: border-color 0.2s var(--ease), transform 0.3s var(--ease);
}

.project:hover .project-thumb { border-color: rgba(var(--slate-200), 0.3); }

/* ---------- Notes ---------- */

.note { display: grid; grid-template-columns: 2fr 6fr; gap: 1rem; align-items: center; transition: opacity 0.2s var(--ease); }
.note-thumb {
  z-index: 10;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 0.25rem;
  border: 2px solid rgba(var(--slate-200), 0.1);
  transition: border-color 0.2s var(--ease);
}
.note:hover .note-thumb { border-color: rgba(var(--slate-200), 0.3); }
.note-body { z-index: 10; }
.note-year {
  margin-top: -0.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.5rem;
}
.note-body h3 { margin-top: -0.25rem; }

/* ---------- Hover group dimming (pointer only) ---------- */

@media (min-width: 1024px) and (hover: hover) {
  .entry::before,
  .project::before,
  .note::before { display: block; }

  .entry-list:hover > li > .entry,
  .entry-list:hover > li > .project,
  .entry-list:hover > li > .note { opacity: 0.5; }

  .entry-list > li:hover > .entry,
  .entry-list > li:hover > .project,
  .entry-list > li:hover > .note { opacity: 1; }

  .entry-list > li:hover > .entry::before,
  .entry-list > li:hover > .project::before,
  .entry-list > li:hover > .note::before {
    background-color: rgba(var(--slate-800), 0.5);
    box-shadow: inset 0 1px 0 0 rgba(148, 163, 184, 0.1);
    filter: drop-shadow(0 10px 8px rgba(0, 0, 0, 0.04)) drop-shadow(0 4px 3px rgba(0, 0, 0, 0.1));
  }
}

/* ---------- Footer ---------- */

.site-footer {
  max-width: 28rem;
  margin-top: 4rem;
  padding-bottom: 4rem;
  font-size: 0.875rem;
  line-height: 1.6;
  color: rgb(var(--slate-500));
}
.site-footer a {
  font-weight: 500;
  color: rgb(var(--slate-400));
  transition: color 0.2s var(--ease);
}
.site-footer a:hover { color: var(--accent); }

.footer-status {
  margin-top: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgb(var(--slate-600));
}
.status-dot {
  height: 0.45rem;
  width: 0.45rem;
  border-radius: 9999px;
  background-color: rgb(var(--teal-400));
  box-shadow: 0 0 0 4px rgba(var(--teal-400), 0.15);
  animation: pulse 2.8s var(--ease) infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(var(--teal-400), 0.16); }
  50% { box-shadow: 0 0 0 7px rgba(var(--teal-400), 0.03); }
}

/* ---------- Time travel ---------- */

.timetravel { position: fixed; right: 0.5rem; bottom: 0.5rem; z-index: 40; }

.timetravel-btn {
  display: inline-flex;
  align-items: center;
  padding: 1rem 0.5rem;
  color: rgb(var(--slate-400));
  transition: color 0.2s var(--ease), transform 0.3s var(--ease);
}
.timetravel-btn:hover { color: var(--accent); transform: translateY(-8px); }
.timetravel-orb {
  height: 2.6rem;
  width: 2.6rem;
  color: rgb(var(--teal-400));
  filter: drop-shadow(0 0 12px rgba(var(--teal-400), 0.45));
  animation: orbit 14s linear infinite;
}
@keyframes orbit { to { transform: rotate(360deg); } }

.dialog {
  width: min(34rem, calc(100vw - 2rem));
  padding: 0;
  border: 1px solid rgba(var(--slate-200), 0.12);
  border-radius: 0.75rem;
  background-color: rgba(2, 6, 23, 0.92);
  color: var(--text);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.8);
  opacity: 0;
  transform: translateY(12px) scale(0.98);
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
}
.dialog[open] { opacity: 1; transform: translateY(0) scale(1); }
.dialog::backdrop {
  background-color: rgba(2, 6, 23, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.dialog-inner { position: relative; padding: 2rem; }
.dialog-close {
  position: absolute;
  right: 1rem;
  top: 1rem;
  padding: 0.25rem;
  border-radius: 0.375rem;
  color: rgb(var(--slate-500));
  transition: color 0.2s var(--ease), background-color 0.2s var(--ease);
}
.dialog-close:hover { color: var(--text-strong); background-color: rgba(var(--slate-800), 0.8); }
.dialog-close svg { height: 1.25rem; width: 1.25rem; }

.dialog-eyebrow {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--accent);
}
.dialog h2 {
  margin-top: 0.5rem;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-strong);
}
.dialog-copy { margin-top: 0.75rem; font-size: 0.9rem; }

.timeline { margin-top: 1.5rem; border-left: 1px solid rgba(var(--slate-700), 0.9); }
.timeline li {
  position: relative;
  padding: 0 0 1rem 1.25rem;
  font-size: 0.875rem;
}
.timeline li::before {
  content: "";
  position: absolute;
  left: -3px;
  top: 0.55rem;
  height: 5px;
  width: 5px;
  border-radius: 9999px;
  background-color: rgb(var(--slate-600));
}
.timeline li:last-child { padding-bottom: 0; }
.timeline li:last-child::before { background-color: var(--accent); }
.timeline span {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: rgb(var(--slate-500));
}
.timeline p { margin-top: 0.15rem; }
.timeline code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.8em;
  color: var(--accent);
}

.dialog-actions { margin-top: 1.75rem; display: flex; flex-wrap: wrap; gap: 0.75rem; }
.btn {
  border-radius: 0.375rem;
  padding: 0.5rem 0.9rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.btn-primary {
  background-color: rgba(var(--teal-400), 0.12);
  color: var(--accent);
  border: 1px solid rgba(var(--teal-400), 0.35);
}
.btn-primary:hover { background-color: rgba(var(--teal-400), 0.22); }
.btn-primary[aria-pressed="true"] {
  background-color: rgb(var(--teal-300));
  color: rgb(var(--teal-900));
  border-color: rgb(var(--teal-300));
}
.btn-ghost {
  border: 1px solid rgba(var(--slate-600), 0.7);
  color: rgb(var(--slate-300));
}
.btn-ghost:hover { border-color: rgb(var(--slate-400)); color: var(--text-strong); }

/* ---------- CRT retro mode ---------- */

body.retro {
  --bg: #04150f;
  --text: #7dffb2;
  --text-strong: #c7ffdd;
  --accent: #7dffb2;
}
body.retro .shell,
body.retro .timetravel {
  text-shadow: 0 0 6px rgba(125, 255, 178, 0.45);
}
body.retro::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.22) 0px,
    rgba(0, 0, 0, 0.22) 1px,
    transparent 1px,
    transparent 3px
  );
  mix-blend-mode: multiply;
}
body.retro .spotlight { background: radial-gradient(700px circle at 50% 0%, rgba(45, 212, 191, 0.12), transparent 70%); }
body.retro .pills li { background-color: rgba(125, 255, 178, 0.12); }

/* ---------- Responsive ---------- */

@media (min-width: 640px) {
  .masthead .name { font-size: 3rem; }
  .masthead .role { font-size: 1.25rem; }
  .section { margin-bottom: 6rem; }
  .entry { grid-template-columns: repeat(8, minmax(0, 1fr)); column-gap: 2rem; }
  .entry-date { grid-column: span 2; }
  .entry-body { grid-column: span 6; }
  .project { grid-template-columns: repeat(8, minmax(0, 1fr)); column-gap: 2rem; }
  .project-body { order: 2; grid-column: span 6; }
  .project-thumb { order: 1; grid-column: span 2; transform: translateY(0.25rem); }
  .site-footer { padding-bottom: 0; }
}

@media (min-width: 768px) {
  .section { margin-bottom: 6rem; }
  .project, .entry { column-gap: 1rem; }
}

@media (min-width: 1024px) {
  .shell { padding-top: 0; padding-bottom: 0; }
  .layout {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
  }

  .masthead {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    max-height: 100vh;
    width: 48%;
    padding: 6rem 0;
    flex-shrink: 0;
  }
  .section-nav { display: block; }

  .spotlight { position: absolute; }

  .content {
    width: 52%;
    padding: 6rem 0;
  }

  .section { margin-bottom: 9rem; scroll-margin-top: 6rem; }
  .section-head {
    position: relative;
    top: auto;
    margin: 0;
    width: 100%;
    padding: 0;
    background: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    opacity: 0;
    height: 0;
    overflow: hidden;
  }

  .entry::before,
  .project::before,
  .note::before { inset: -1rem -1.5rem; }

  .timetravel { right: 0; bottom: 0; }
}

@media (min-width: 1280px) {
  .section-head { opacity: 0; }
}

@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;
  }
}

/* ---------- Story entries (no thumbnail) ---------- */

.note.no-thumb { grid-template-columns: 1fr; }
.note-body p:not(.note-year) { margin-top: 0.5rem; font-size: 0.875rem; line-height: 1.5; }

/* Logo thumbnails sit straight on the page, no frame */
.project-thumb.logo-thumb { object-fit: contain; border-color: transparent; }
.project:hover .project-thumb.logo-thumb { border-color: transparent; }
