/* Home page, built on tokens.css and base.css. Layout and spacing follow the Framer home page.
   Three sizes only: heading, body, sub. Weight and color carry the hierarchy. */

.page { display: flex; flex-direction: column; align-items: center; width: 100%; overflow: clip; }

/* Nav links: a regular copy at rest and a semibold copy that fades in on hover. The semibold copy sets the width. */
.roll { display: inline-grid; text-decoration: underline; font-size: var(--fs-sub); line-height: var(--lh-sub); }
.roll > span { grid-area: 1 / 1; white-space: nowrap; transition: opacity 0.3s var(--ease-link); }
.roll .rest { color: var(--secondary); font-weight: var(--w-regular); }
.roll .hover { color: var(--primary); font-weight: var(--w-semibold); opacity: 0; }
.roll:hover .rest, .roll:focus-visible .rest { opacity: 0; }
.roll:hover .hover, .roll:focus-visible .hover { opacity: 1; }
.roll-resume .hover { color: var(--accent); }
.nav-links { display: flex; gap: var(--s-12); }

/* Fixed bar, Desktop and Tablet. Opacity is set from scroll in script.js. */
.navbar { position: fixed; inset: 0 0 auto 0; height: 4rem; padding: 0 var(--pad-x); z-index: 5; display: flex; align-items: center; justify-content: space-between; opacity: 0; pointer-events: none; }
.navbar::before { content: ""; position: absolute; inset: 0; background: var(--bg); box-shadow: var(--shadow); z-index: -1; }
.navbar.is-on { pointer-events: auto; }
.menu { display: none; }

/* Hero */
.hero { width: 100%; max-width: var(--max); height: 100vh; padding: 4rem var(--pad-x) 5rem; display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start; overflow: clip; }
.hero-nav { display: flex; align-items: center; justify-content: space-between; width: 100%; }
.intro { display: flex; flex-direction: column; gap: var(--s-6); width: 100%; }
.name-row { display: flex; align-items: center; justify-content: flex-end; gap: var(--s-6); width: 100%; overflow: clip; }
.name { font-size: var(--fs-body); line-height: var(--lh-body); font-weight: var(--w-semibold); letter-spacing: 0.03em; text-transform: uppercase; color: var(--primary); }
.title { flex: 1; min-width: 0; font-size: var(--fs-sub); line-height: var(--lh-sub); }
.statement { font-size: var(--fs-heading); line-height: var(--lh-heading); font-weight: var(--w-semibold); color: var(--primary); }

/* Projects */
.projects, .contact { width: 100%; max-width: var(--max); display: flex; flex-direction: column; gap: var(--s-10); }
.projects { padding: 10rem var(--pad-x) 0; }
.project-list { display: flex; flex-direction: column; gap: 7.5rem; width: 100%; }
.project, .project-body { display: flex; flex-direction: column; gap: var(--s-10); width: 100%; }
.project-text { display: flex; flex-direction: column; gap: var(--s-3); width: 100%; }
.project-head { display: flex; align-items: center; gap: var(--s-4); }
.project-title { font-size: var(--fs-heading); line-height: var(--lh-heading); font-weight: var(--w-semibold); text-transform: lowercase; color: var(--primary); }
.dot { flex: none; width: 0.25rem; height: 0.25rem; border-radius: 50%; background: var(--secondary); }
.tags { font-size: var(--fs-sub); line-height: var(--lh-sub); text-transform: lowercase; }
.summary { max-width: 46rem; }
.button { align-self: flex-start; }
.button:active { transform: scale(0.97); }
.button svg { flex: none; }

/* Contact */
.contact { padding: 10rem var(--pad-x); }
.contact-links { display: flex; flex-wrap: wrap; gap: var(--s-6) 4rem; width: 100%; }
.contact-link { font-size: var(--fs-body); line-height: 3rem; text-transform: lowercase; }
.contact-link .rest { color: var(--primary); }

/* Intro animation: fade and rise */
@keyframes rise { from { opacity: 0; transform: translateY(var(--rise, 0.625rem)); } to { opacity: 1; transform: none; } }
.fx-statement { --rise: 0.625rem; animation: rise 2s var(--ease-out) 0.4s backwards; }
.fx-name { --rise: 0.375rem; animation: rise 2.4s var(--ease-out) 2s backwards; }
.fx-title { --rise: 0.375rem; animation: rise 2.4s var(--ease-out) 2.8s backwards; }
.fx-nav { --rise: -0.5rem; animation: rise 1.6s cubic-bezier(0.33, 1, 0.68, 1) 3.8s backwards; }

/* Tablet */
@media (max-width: 89.99rem) {
  .hero { height: auto; gap: 4.5rem; justify-content: flex-start; padding: 3rem var(--pad-x) 2.5rem; }
  .projects { padding-top: 7.5rem; }
  .project-list { gap: 6rem; }
  .summary { max-width: 85%; }
  .contact { padding: 6rem var(--pad-x) 7.5rem; gap: var(--s-6); }
  .contact-links { flex-direction: column; flex-wrap: nowrap; gap: var(--s-4); }
  .fx-projects { --rise: 0.625rem; animation: rise 2s var(--ease-out) 4.8s backwards; }
}

/* Phone */
@media (max-width: 50.56rem) {
  .navbar, .hero-nav { display: none; }
  .menu { display: block; position: fixed; inset: 0 0 auto 0; z-index: 10; background: var(--bg); box-shadow: var(--shadow); animation: rise 1.6s cubic-bezier(0.33, 1, 0.68, 1) 3.8s backwards; --rise: -0.5rem; }
  .menu-bar { display: flex; justify-content: flex-end; align-items: center; height: 4rem; padding: 0 var(--s-6); }
  .menu-button { display: grid; place-items: center; width: 3.5rem; height: 3.5rem; padding: 0; border: 0; border-radius: var(--radius); background: transparent; cursor: pointer; color: var(--primary); }
  .menu-button .icon-close { display: none; }
  .menu.is-open .menu-button .icon-open { display: none; }
  .menu.is-open .menu-button .icon-close { display: block; }
  .menu-panel { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.35s var(--ease-link); }
  .menu.is-open .menu-panel { grid-template-rows: 1fr; }
  .menu-items { overflow: hidden; display: flex; flex-direction: column; gap: var(--s-4); padding: 0 var(--s-6); visibility: hidden; transition: padding 0.35s var(--ease-link), visibility 0.35s; }
  .menu.is-open .menu-items { padding: var(--s-4) var(--s-6) var(--s-8); visibility: visible; }
  .mi { font-size: var(--fs-body); line-height: var(--lh-body); color: var(--secondary); }
  .mi-bold { font-weight: var(--w-semibold); color: var(--primary); }

  .hero { gap: var(--s-12); padding: 8rem var(--pad-x) var(--s-12); }
  .name-row { flex-direction: column; align-items: flex-start; justify-content: flex-end; gap: var(--s-2); }
  .title { flex: none; width: 100%; }
  .projects { padding-top: var(--s-20); gap: var(--s-6); }
  .project-list { gap: 4.5rem; }
  .project, .project-body { gap: var(--s-6); }
  .project-head { flex-direction: column; align-items: flex-start; gap: var(--s-2); }
  .dot { display: none; }
  .summary { max-width: 100%; }
  .button { align-self: stretch; justify-content: center; }
  .contact { padding: 4rem var(--pad-x) 6rem; gap: var(--s-4); }
  .contact-links { gap: var(--s-3); }
}

@media (prefers-reduced-motion: reduce) {
  html:not(.force-motion) :is(.fx-statement, .fx-name, .fx-title, .fx-nav, .fx-projects, .menu) { animation: none; }
}
