/* ============ Theme: beyond the little door, by moonlight ============ */
:root {
  --ink: #0d0e12;
  --ink-2: #15171d;
  --ink-3: #1f222b;
  --bone: #d9d2c3;
  --bone-soft: rgba(217, 210, 195, .68);
  --bone-faint: rgba(217, 210, 195, .16);
  --dusk: #6d7f99;         /* faded Coraline blue */
  --brass: #a8916a;        /* tarnished key */
  --wine: #7a2b33;
  --serif: "IM Fell English", Georgia, serif;
  --body: "Spectral", Georgia, serif;
  --type: "Courier Prime", ui-monospace, monospace;
  --max: 1040px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  background:
    radial-gradient(ellipse at 50% -20%, rgba(109,127,153,.22), transparent 55%),
    radial-gradient(ellipse at 50% 120%, rgba(122,43,51,.14), transparent 60%),
    var(--ink);
  background-attachment: fixed;
  color: var(--bone);
  font-family: var(--body);
  font-weight: 300;
  font-size: 18px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
/* vignette */
body::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 90;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,.55));
}
/* film grain */
.grain {
  position: fixed; inset: -50%; pointer-events: none; z-index: 91; opacity: .09;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1.2s steps(6) infinite;
}
@keyframes grain {
  0% { transform: translate(0,0); } 20% { transform: translate(-3%,2%); } 40% { transform: translate(2%,-3%); }
  60% { transform: translate(-2%,-1%); } 80% { transform: translate(3%,3%); } 100% { transform: translate(0,0); }
}
a { color: inherit; }
img { display: block; max-width: 100%; }
strong { font-weight: 600; }
::selection { background: var(--wine); color: var(--bone); }

/* ============ Nav ============ */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px clamp(16px, 4vw, 40px);
  background: rgba(13, 14, 18, .86);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.nav::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--bone-faint);
  opacity: 0; transition: opacity .3s; filter: url(#rough);
}
.nav.scrolled::after { opacity: 1; }
.nav-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--serif); font-size: 22px; font-style: italic; }
.nav-logo svg { width: 28px; height: 28px; transition: transform .8s cubic-bezier(.6,0,.2,1); }
.nav-logo .rim { fill: #08090b; stroke: var(--bone); stroke-width: 1.4; }
.nav-logo .hole { fill: var(--bone); }
.nav-logo .thread { stroke: var(--wine); stroke-width: 1.6; fill: none; }
.nav-logo:hover svg { transform: rotate(180deg); }
.nav-links { display: flex; gap: clamp(16px, 2.6vw, 32px); align-items: center; }
.nav-links a {
  text-decoration: none; font-family: var(--type); font-size: 13px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--bone-soft); padding: 4px 0; position: relative; transition: color .25s;
}
.nav-links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--bone);
  transform: scaleX(0); transform-origin: left; transition: transform .35s; filter: url(#rough);
}
.nav-links a:hover, .nav-links a.active { color: var(--bone); }
.nav-links a:hover::after, .nav-links a.active::after { transform: scaleX(1); }
.nav-cta { border: 1px solid var(--bone-soft); padding: 6px 14px !important; color: var(--bone) !important; }
.nav-cta::after { display: none; }
.nav-cta:hover { background: var(--bone); color: var(--ink) !important; }
.nav-toggle { display: none; background: none; border: 0; cursor: pointer; width: 32px; height: 24px; position: relative; }
.nav-toggle span { position: absolute; left: 4px; right: 4px; height: 1.5px; background: var(--bone); transition: transform .3s, top .3s; }
.nav-toggle span:first-child { top: 8px; } .nav-toggle span:last-child { top: 15px; }
.nav.open .nav-toggle span:first-child { top: 12px; transform: rotate(45deg); }
.nav.open .nav-toggle span:last-child { top: 12px; transform: rotate(-45deg); }

/* ============ Shared ============ */
section { padding: clamp(64px, 9vw, 104px) clamp(16px, 5vw, 40px); max-width: var(--max); margin: 0 auto; position: relative; }
.title {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(36px, 5vw, 54px); line-height: 1.1; margin-bottom: 40px;
  display: flex; align-items: baseline; gap: 16px;
}
.title span { font-size: .45em; color: var(--brass); font-style: italic; }
.title::after { content: ""; flex: 1; height: 1px; background: var(--bone-faint); filter: url(#rough); align-self: center; }
.mini { font-family: var(--type); font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: var(--brass); margin-bottom: 8px; }
.tags { color: var(--bone-soft); margin-bottom: 26px; }
mark { background: none; color: var(--bone); font-weight: 600; border-bottom: 1px solid var(--wine); }

/* Burton stripes divider */
.stripes {
  height: 10px; max-width: var(--max); margin: 0 auto; opacity: .22;
  background: repeating-linear-gradient(90deg, var(--bone) 0 14px, transparent 14px 28px);
  filter: url(#rough);
  -webkit-mask: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent);
          mask: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent);
}

.btn {
  display: inline-block; text-decoration: none; font-family: var(--type); font-size: 13px; letter-spacing: .14em; text-transform: uppercase;
  padding: 13px 24px; transition: background .25s, color .25s, border-color .25s;
}
.btn-solid { background: var(--bone); color: var(--ink); border: 1px solid var(--bone); }
.btn-solid:hover { background: transparent; color: var(--bone); }
.btn-line { border: 1px solid var(--bone-faint); }
.btn-line:hover { border-color: var(--bone); }

.reveal { opacity: 0; transform: translateY(16px); filter: blur(3px); transition: opacity 1s ease, transform 1s ease, filter 1s ease; }
.reveal.in { opacity: 1; transform: none; filter: none; }

/* ============ Hero ============ */
.hero {
  display: grid; grid-template-columns: 1.25fr 1fr; gap: clamp(32px, 6vw, 72px); align-items: center;
  min-height: calc(100vh - 70px); padding-top: clamp(40px, 6vw, 64px);
}
/* faint background spiral; script.js rotates it with scroll direction */
.spiral {
  position: fixed; left: 50%; top: 50%; width: min(1100px, 140vmax); aspect-ratio: 1; z-index: -1;
  translate: -50% -50%; opacity: .045; pointer-events: none; will-change: transform;
}
.spiral path { fill: none; stroke: var(--bone); stroke-width: .7; stroke-dasharray: 3000; stroke-dashoffset: 3000; animation: draw 5s ease forwards .3s; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.hero h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(50px, 8vw, 96px); line-height: .98; letter-spacing: -.01em; margin: 0 0 26px; }
.hero h1 em { display: block; color: var(--bone-soft); }
.hero-sub { max-width: 500px; color: var(--bone-soft); }
.hero-sub strong { color: var(--bone); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.hero-actions.center { justify-content: center; }

/* ============ The little door (Spotify) ============ */
.door {
  position: relative; padding: 12px;
  background: linear-gradient(170deg, #2a241f, #17130f);
  border-radius: 200px 200px 6px 6px;
  box-shadow: inset 0 0 0 1px rgba(217,210,195,.12), 0 30px 60px rgba(0,0,0,.6), 0 0 120px rgba(109,127,153,.12);
}
/* wood grain */
.door::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: .35;
  background: repeating-linear-gradient(90deg, transparent 0 22px, rgba(0,0,0,.35) 22px 23px);
}
.door-inner {
  position: relative; border-radius: 190px 190px 4px 4px; padding: 72px 24px 26px; background: rgba(8,9,11,.82);
}
.door-inner::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; border: 1px solid var(--bone-faint); filter: url(#rough); pointer-events: none;
}
.keyhole { position: absolute; right: 24px; top: 56%; width: 11px; height: 11px; border-radius: 50%; background: var(--brass); box-shadow: 0 0 0 4px rgba(168,145,106,.15); }
.keyhole::after { content: ""; position: absolute; left: 2.5px; top: 8px; border: 3px solid transparent; border-top: 11px solid var(--brass); border-bottom: 0; }
.spotify-head { display: flex; align-items: center; justify-content: center; gap: 8px; font-family: var(--type); font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--bone-soft); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: #555; flex: none; }
.dot.live { background: #8fae8b; animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(143,174,139,.5); } 70%,100% { box-shadow: 0 0 0 9px rgba(143,174,139,0); } }
.spotify-body { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px; text-decoration: none; margin: 18px 0 6px; }
.vinyl {
  width: 120px; height: 120px; border-radius: 50%; position: relative; display: grid; place-items: center;
  background: repeating-radial-gradient(circle, #16161a 0 2px, #060607 2px 4px);
  box-shadow: 0 0 0 1px var(--bone-faint);
}
.vinyl img { width: 54%; height: 54%; border-radius: 50%; object-fit: cover; background: var(--wine); filter: grayscale(.35) contrast(1.05); }
.vinyl img:not([src]) { visibility: hidden; }
.vinyl::after { content: ""; position: absolute; width: 7px; height: 7px; border-radius: 50%; background: var(--ink); }
.vinyl.spin { animation: spin 7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.spotify-meta { min-width: 0; max-width: 100%; }
.spotify-title { font-family: var(--serif); font-size: 22px; font-style: italic; line-height: 1.25; }
.spotify-artist { font-size: 15px; color: var(--bone-soft); }
.spotify-body:hover .spotify-title { color: var(--brass); }
.eq { display: flex; justify-content: center; gap: 3px; align-items: flex-end; height: 14px; margin-top: 8px; opacity: 0; transition: opacity .3s; }
.eq.on { opacity: 1; }
.eq i { width: 2px; background: var(--bone); animation: eq 1.1s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: .2s; } .eq i:nth-child(3) { animation-delay: .4s; } .eq i:nth-child(4) { animation-delay: .1s; }
@keyframes eq { 0%,100% { height: 3px; } 50% { height: 14px; } }

/* ============ About ============ */
.about-grid { display: grid; grid-template-columns: 1.7fr 1fr; gap: clamp(28px, 5vw, 56px); align-items: start; }
.about-grid > p { color: var(--bone-soft); }
.interests > ul { list-style: none; }
.interests > ul li { padding: 6px 0; border-bottom: 1px dashed var(--bone-faint); font-family: var(--serif); font-style: italic; font-size: 19px; }
.interests > ul li::before { content: "✕ "; font-style: normal; font-size: 11px; color: var(--wine); margin-right: 4px; }

/* stats: numbers with a sewn-on button */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 60px; border-top: 1px solid var(--bone-faint); }
.stat { padding: 28px 18px 8px; text-align: center; position: relative; }
.stat + .stat { border-left: 1px solid var(--bone-faint); }
.sewn {
  display: block; width: 26px; height: 26px; margin: 0 auto 12px; border-radius: 50%; position: relative;
  background:
    radial-gradient(circle at 35% 35%, var(--bone) 0 2px, transparent 2.5px),
    radial-gradient(circle at 65% 35%, var(--bone) 0 2px, transparent 2.5px),
    radial-gradient(circle at 35% 65%, var(--bone) 0 2px, transparent 2.5px),
    radial-gradient(circle at 65% 65%, var(--bone) 0 2px, transparent 2.5px),
    #050506;
  box-shadow: 0 0 0 1px var(--bone-soft);
  transition: transform .8s cubic-bezier(.6,0,.2,1);
}
.stat:hover .sewn { transform: rotate(180deg); }
.num { font-family: var(--serif); font-size: clamp(48px, 6vw, 68px); line-height: 1; }
.stat p:last-child { font-size: 15px; color: var(--bone-soft); max-width: 180px; margin: 10px auto 0; line-height: 1.45; }

/* ============ Experience ============ */
.jobs { display: grid; gap: 22px; }
.job, .edu { position: relative; background: rgba(21,23,29,.75); padding: clamp(22px, 3vw, 34px); }
.job::before, .edu::before {
  content: ""; position: absolute; inset: 0; border: 1px solid var(--bone-faint); filter: url(#rough); pointer-events: none; transition: border-color .4s;
}
.job:hover::before { border-color: var(--bone-soft); }
.job-top { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 16px; }
.job h3, .edu h3 { font-family: var(--serif); font-size: clamp(22px, 2.5vw, 27px); line-height: 1.2; font-weight: 400; }
.org { font-family: var(--type); color: var(--dusk); font-size: 14px; letter-spacing: .04em; margin-top: 4px; }
.date { flex: none; font-family: var(--type); font-size: 13px; color: var(--brass); white-space: nowrap; padding-top: 4px; }
.job ul, .projects { list-style: none; }
.job li, .projects li { position: relative; padding-left: 22px; margin-bottom: 9px; color: var(--bone-soft); }
.job li::before, .projects li::before { content: "✕"; position: absolute; left: 0; top: 2px; font-size: 11px; color: var(--wine); }
.job li strong, .projects li strong { color: var(--bone); }

/* ============ Education ============ */
.edu { display: flex; justify-content: space-between; gap: 16px; align-items: center; margin-bottom: 40px; }
.edu p { color: var(--bone-soft); }
.edu-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: clamp(28px, 5vw, 56px); }

/* ============ Sky moon (hangs over the door) ============ */
.hero-visual { position: relative; padding-top: 100px; }
.hero-visual .door { z-index: 1; }
.sky-moon { position: absolute; top: 0; right: -34px; z-index: 0; outline: none; }
.moon-big {
  display: block; width: 116px; height: 116px; overflow: visible;
  filter: drop-shadow(0 0 30px rgba(217,210,195,.22));
  animation: float 9s ease-in-out infinite;
}
@keyframes float { 50% { transform: translateY(-6px); } }
/* caption sits to the left of the moon, above the arch */
.moon-cap { position: absolute; right: 128px; top: 2px; text-align: right; white-space: nowrap; }
.moon-name { font-family: var(--serif); font-style: italic; font-size: 19px; line-height: 1.2; }
.moon-meta { font-family: var(--type); font-size: 11px; letter-spacing: .06em; color: var(--bone-soft); }
/* the week ahead appears on hover / focus */
.moon-week {
  list-style: none; display: flex; gap: 7px; justify-content: flex-end; margin-top: 8px;
  opacity: 0; transform: translateY(-4px); transition: opacity .4s, transform .4s; pointer-events: none;
}
.sky-moon:hover .moon-week, .sky-moon:focus-visible .moon-week { opacity: 1; transform: none; }
.moon-week li { text-align: center; }
.moon-week svg { width: 18px; height: 18px; display: block; margin: 0 auto 2px; }
.moon-week span { font-family: var(--type); font-size: 9px; color: var(--bone-soft); }
.moon-week li.today span { color: var(--bone); border-bottom: 1px solid var(--wine); }

/* ============ Contact ============ */
.contact { text-align: center; min-height: 60vh; display: flex; flex-direction: column; justify-content: center; }
.contact h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(44px, 6vw, 70px); line-height: 1.1; }
.contact h2 em { color: var(--bone-soft); }
.contact > p { color: var(--bone-soft); margin-top: 10px; }
.footer { text-align: center; font-family: var(--type); font-size: 12px; color: var(--bone-soft); padding: 0 16px 32px; letter-spacing: .06em; }

/* ============ Responsive ============ */
@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; gap: 0;
    background: var(--ink); max-height: 0; overflow: hidden; transition: max-height .4s ease;
  }
  .nav.open .nav-links { max-height: 360px; border-bottom: 1px solid var(--bone-faint); }
  .nav-links a { padding: 14px 16px; width: 100%; text-align: center; }
  .nav-links a::after { display: none; }
  .nav-cta { border: 0; padding: 14px 16px 18px !important; }
  .hero, .about-grid, .edu-grid { grid-template-columns: 1fr; }
  .hero { min-height: auto; }
  .door { max-width: 380px; width: 100%; margin: 0 auto; }
  .hero-visual { max-width: 380px; width: 100%; margin: 0 auto; padding-top: 108px; }
  .sky-moon { right: -6px; }
  .moon-big { width: 92px; height: 92px; }
  .moon-cap { right: 100px; top: 8px; }
  .moon-week { opacity: 1; transform: none; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(3) { border-left: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--bone-faint); }
}
@media (max-width: 560px) {
  body { font-size: 17px; }
  .job-top, .edu { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; filter: none; }
  .spiral path { stroke-dashoffset: 0; }
  .moon-week { opacity: 1; transform: none; }
}
