:root {
  --bg: #050505;
  --ink: #f2efe9;
  --muted: rgba(242, 239, 233, 0.55);
  --faint: rgba(242, 239, 233, 0.08);
  --serif: "Cormorant Garamond", "Times New Roman", serif;
  --sans: "Inter", system-ui, sans-serif;
  --pad: clamp(20px, 4vw, 56px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.is-loading { overflow: hidden; }
a { color: inherit; text-decoration: none; }
em { font-style: italic; font-weight: 300; }
::selection { background: var(--ink); color: var(--bg); }

/* ---------- Loader ---------- */
.loader {
  position: fixed; inset: 0; z-index: 100;
  background: var(--bg);
  display: grid; place-content: center; justify-items: center; gap: 18px;
  transition: opacity 0.9s ease, visibility 0.9s ease;
}
.loader.is-done { opacity: 0; visibility: hidden; }
.loader__name { font-family: var(--serif); font-size: 28px; letter-spacing: 0.04em; }
.loader__bar { width: 180px; height: 1px; background: var(--faint); overflow: hidden; }
.loader__bar span { display: block; height: 100%; width: 0; background: var(--ink); transition: width 0.2s linear; }
.loader__pct { font-size: 11px; letter-spacing: 0.2em; color: var(--muted); }

/* ---------- Scroll story (statue sticks only while this block is on screen) ---------- */
.story { position: relative; }
.story__stage {
  position: sticky; top: 0;
  height: 100vh;
  z-index: 0; overflow: hidden;
}
/* pull the first section up so it sits on top of the statue */
.story__stage + .panel { margin-top: -100vh; }
#statue { display: block; width: 100%; height: 100%; }
.vignette {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse at center, transparent 45%, rgba(0,0,0,0.65) 100%),
    linear-gradient(to bottom, rgba(0,0,0,0.5), transparent 18%, transparent 82%, rgba(0,0,0,0.6));
}

/* ---------- Grid lines ---------- */
.grid {
  position: fixed; inset: 0 var(--pad); z-index: 2; pointer-events: none;
  display: flex; justify-content: space-between;
}
.grid span { width: 1px; height: 100%; background: var(--faint); }

/* ---------- Nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 26px var(--pad) 40px;
  font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase;
  background: linear-gradient(to bottom, rgba(5,5,5,0.9) 30%, transparent);
}
.nav__logo { font-family: var(--serif); font-size: 24px; letter-spacing: 0.02em; text-transform: none; }
.nav__links { display: flex; gap: clamp(18px, 3vw, 44px); }
.nav__links a, .nav__cta { position: relative; color: var(--muted); transition: color 0.3s; }
.nav__links a:hover, .nav__cta:hover { color: var(--ink); }
.nav__links a::after {
  content: ""; position: absolute; left: 0; bottom: -6px; width: 0; height: 1px;
  background: var(--ink); transition: width 0.35s ease;
}
.nav__links a:hover::after { width: 100%; }
.nav__cta { border: 1px solid rgba(242,239,233,0.3); padding: 10px 18px; border-radius: 40px; color: var(--ink); }
.nav__cta:hover { background: var(--ink); color: var(--bg); }

/* ---------- Side progress ---------- */
.progress {
  position: fixed; left: var(--pad); top: 50%; z-index: 40;
  transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  font-size: 10px; letter-spacing: 0.15em; color: var(--muted);
}
.progress__track { width: 1px; height: 90px; background: var(--faint); position: relative; }
.progress__track span { position: absolute; top: 0; left: 0; width: 100%; height: 0; background: var(--ink); }

/* ---------- Shared type ---------- */
main > section, .story > section { position: relative; z-index: 3; }
.eyebrow { font-size: 11px; letter-spacing: 0.28em; text-transform: uppercase; color: var(--muted); margin-bottom: 22px; }
.display {
  font-family: var(--serif); font-weight: 300;
  font-size: clamp(64px, 10vw, 168px);
  line-height: 0.88; letter-spacing: -0.02em;
}
.headline {
  font-family: var(--serif); font-weight: 300;
  font-size: clamp(42px, 5.4vw, 88px);
  line-height: 0.95; letter-spacing: -0.01em;
}
p { line-height: 1.7; }

/* ---------- Scroll panels over the statue ---------- */
.panel {
  min-height: 140vh;
  padding: 0 calc(var(--pad) * 2);
  display: grid; grid-template-columns: 1fr 1fr; align-items: center;
  gap: 32vw;
}
.hero { min-height: 120vh; align-items: end; padding-bottom: 22vh; }
.hero__right { justify-self: end; max-width: 300px; font-size: 14px; color: var(--muted); }
.scroll-hint {
  display: inline-flex; align-items: center; gap: 12px; margin-top: 26px;
  font-size: 10px; letter-spacing: 0.25em; text-transform: uppercase; color: var(--ink);
}
.scroll-hint i { width: 40px; height: 1px; background: var(--ink); position: relative; overflow: hidden; }
.scroll-hint i::after {
  content: ""; position: absolute; inset: 0; background: var(--bg);
  animation: hint 2s ease-in-out infinite;
}
@keyframes hint { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }

.about__right { justify-self: end; max-width: 320px; font-size: 14px; color: var(--muted); }
.about__right p + p { margin-top: 16px; }

.stats {
  display: grid; grid-template-columns: 1fr 1fr; gap: 40px;
  padding: 26vh calc(var(--pad) * 2) 6vh;
  border-top: 1px solid rgba(242,239,233,0.12);
}
.stats__col { max-width: 320px; }
.stats__col--right { justify-self: end; text-align: right; }
.stat__title { font-family: var(--serif); font-weight: 400; font-size: 26px; margin-bottom: 8px; }
.stat__num { font-family: var(--serif); font-size: clamp(80px, 9vw, 140px); line-height: 1; font-weight: 300; }
.stat__num sup { font-size: 0.35em; vertical-align: top; position: relative; top: 0.4em; }
.stat__text { font-size: 13px; color: var(--muted); margin-top: 12px; }

/* ---------- Work ---------- */
.work { padding: 16vh calc(var(--pad) * 2) 16vh; }
.work__head { margin-bottom: 8vh; }
.work__list { list-style: none; border-top: 1px solid rgba(242,239,233,0.15); }
.work__item { border-bottom: 1px solid rgba(242,239,233,0.15); }
.work__link {
  display: grid; grid-template-columns: 80px 1fr auto 40px; align-items: center;
  padding: 34px 0; gap: 20px;
  transition: padding 0.4s ease, background 0.4s ease;
}
.work__no { font-family: var(--serif); font-style: italic; font-size: 20px; color: var(--muted); }
.work__name { font-family: var(--serif); font-size: clamp(32px, 4.2vw, 64px); line-height: 1; font-weight: 300; }
.work__meta { font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); }
.work__arrow { font-size: 22px; justify-self: end; transition: transform 0.4s ease; }
.work__item--soon .work__name { color: var(--muted); }
.work__item--soon .work__link:hover { padding-left: 0; background: none; }
.contact__intro { margin-top: 28px; font-size: 14px; color: var(--muted); }
a.work__link:hover { padding-left: 24px; background: linear-gradient(90deg, rgba(242,239,233,0.05), transparent); }
a.work__link:hover .work__arrow { transform: rotate(45deg); }

/* ---------- Skills ---------- */
.skills { padding: 10vh calc(var(--pad) * 2); text-align: center; }
.skills__list {
  list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 14px 14px;
  max-width: 900px; margin: 0 auto;
}
.skills__list li {
  font-family: var(--serif); font-size: clamp(20px, 2.2vw, 30px);
  border: 1px solid rgba(242,239,233,0.2); border-radius: 60px; padding: 10px 28px;
  transition: background 0.3s, color 0.3s;
}
.skills__list li:hover { background: var(--ink); color: var(--bg); }

/* ---------- Contact ---------- */
.contact {
  min-height: 100vh; padding: 24vh calc(var(--pad) * 2) 40px;
  display: flex; flex-direction: column; align-items: center; text-align: center;
}
.display--contact { font-size: clamp(54px, 8vw, 132px); }
.contact__mail {
  margin-top: 48px; font-family: var(--serif); font-size: clamp(24px, 3vw, 40px);
  border-bottom: 1px solid rgba(242,239,233,0.35); padding-bottom: 4px;
  transition: border-color 0.3s;
}
.contact__mail:hover { border-color: var(--ink); }
.contact__links {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 36px; margin-top: 40px;
  font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted);
}
.contact__links a:hover { color: var(--ink); }
.footer {
  margin-top: auto; padding-top: 18vh; width: 100%;
  display: flex; justify-content: space-between;
  font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted);
}

/* ---------- Back to top ---------- */
.footer { padding-right: 96px; } /* keep footer text clear of the round button */
.footer__top { color: var(--ink); transition: opacity 0.3s; }
.footer__top:hover { opacity: 0.6; }

.to-top {
  position: fixed; right: var(--pad); bottom: 32px; z-index: 60;
  width: 64px; height: 64px; border-radius: 50%;
  display: grid; place-content: center; justify-items: center; gap: 2px;
  background: rgba(5,5,5,0.6); color: var(--ink);
  border: 1px solid rgba(242,239,233,0.35);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  font: 400 9px/1 var(--sans); letter-spacing: 0.2em; text-transform: uppercase;
  cursor: pointer;
  opacity: 0; visibility: hidden; transform: translateY(20px);
  transition: opacity 0.4s ease, transform 0.4s ease, visibility 0.4s, background 0.3s, color 0.3s;
}
.to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { background: var(--ink); color: var(--bg); }
.to-top svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Typing text ---------- */
.ch { opacity: 0; }
.ch.on { opacity: 1; }
.ch.caret::after {
  content: ""; display: inline-block;
  width: 0.05em; height: 0.85em; margin-left: 0.04em;
  background: currentColor; vertical-align: -0.06em;
  animation: caret 0.9s steps(1) infinite;
}
@keyframes caret { 50% { opacity: 0; } }

/* words start small, low and blurry, then "upscale" into place */
.wd {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.5em) scale(0.6);
  filter: blur(8px);
  transform-origin: left bottom;
  transition: opacity 0.45s ease, transform 0.6s cubic-bezier(.2,.8,.2,1), filter 0.6s ease;
}
.wd.on { opacity: 1; transform: none; filter: blur(0); }

/* ---------- Reveal ---------- */
.reveal { opacity: 0; transform: translateY(40px); transition: opacity 1.1s ease, transform 1.1s cubic-bezier(.2,.7,.2,1); }
.reveal.is-in { opacity: 1; transform: none; }

/* ---------- Mobile ---------- */
/* Medium screens (small laptops, half-width windows, tablets): statue on top, text below */
@media (max-width: 1100px) {
  .panel {
    grid-template-columns: 1fr; gap: 20px; align-content: end;
    min-height: 130vh; padding: 0 calc(var(--pad) * 1.5) 8vh;
  }
  .panel > * { max-width: 560px; }
  .hero__right, .about__right { justify-self: start; max-width: 560px; }
  .about__left, .about__right, .hero__left, .hero__right {
    position: relative;
  }
  /* dark backing so text never fights the statue */
  .panel::before {
    content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 75vh;
    background: linear-gradient(to top, rgba(5,5,5,0.96) 45%, transparent);
    pointer-events: none; z-index: -1;
  }
  .headline { font-size: clamp(38px, 7vw, 64px); }
}

@media (max-width: 820px) {
  .nav__links { display: none; }
  .progress { display: none; }
  .grid span:nth-child(2), .grid span:nth-child(4) { display: none; }
  .panel { padding: 0 var(--pad) 8vh; }
  .stats { grid-template-columns: 1fr; padding-left: var(--pad); padding-right: var(--pad); }
  .stats__col--right { justify-self: start; text-align: left; }
  .display { font-size: clamp(56px, 16vw, 96px); }
  .headline { font-size: clamp(38px, 11vw, 60px); }
  .stat__num { font-size: 72px; }
  .work, .skills { padding-left: var(--pad); padding-right: var(--pad); }
  .work__link { grid-template-columns: 44px 1fr 24px; }
  .work__meta { display: none; }
  .footer { flex-direction: column; gap: 8px; align-items: center; padding-right: 0; padding-bottom: 80px; }
  .to-top { width: 54px; height: 54px; bottom: 20px; }

  /* Phone hero: name + intro fit on the first screen under the statue */
  .hero { min-height: 100vh; min-height: 100svh; padding-bottom: 5vh; gap: 14px; }
  .hero .eyebrow { margin-bottom: 10px; }
  .hero .display { font-size: clamp(50px, 14vw, 80px); }
  .hero__right { font-size: 13px; }
  .scroll-hint { margin-top: 14px; }

  /* Phone type sizes */
  .about__right { font-size: 13.5px; }
  .contact { padding-top: 18vh; }
  .contact__mail { font-size: clamp(18px, 5.6vw, 26px); word-break: break-all; }
  .contact__links { gap: 28px; }
  .work__head { margin-bottom: 5vh; }
  .work { padding-top: 12vh; }
}

/* Phones: keep the statue stage steady when the browser's address bar shows/hides */
@media (max-width: 820px) {
  .story__stage { height: 100vh; height: 100lvh; }
  .story__stage + .panel { margin-top: -100vh; margin-top: -100lvh; }
}

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .wd { transition: none; }
  html { scroll-behavior: auto; }
}
