/* ============================================================
   Base: reset, type, nav, buttons, footer, cursor.
   Motion rules (Emil Kowalski / Apple): respond on press, ease-out
   for anything entering, nothing over ~300ms for UI, hover effects
   only on devices that really hover.
   ============================================================ */

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

html {
  scroll-behavior: auto;    /* Lenis handles smooth scroll */
  scrollbar-gutter: stable; /* no layout shift when a panel locks scrolling */
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.5;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; background: none; border: none; color: inherit; }
ul { list-style: none; margin: 0; padding: 0; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  font-style: normal;
  line-height: 1.08;
  letter-spacing: -0.022em;
  margin: 0;
  color: var(--text);
}

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

/* small label above a heading, written in sentence case */
.eyebrow {
  font-family: var(--font-body);
  font-size: var(--fs-small);
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--accent);
}

.container {
  width: min(100% - 2.75rem, var(--max-width));
  margin-inline: auto;
}

.section { padding-block: var(--space-6); }

/* ---------- Nav: translucent, content scrolls underneath ---------- */

.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 max(1.375rem, calc((100vw - var(--max-width)) / 2));
  font-size: var(--fs-micro);
  transition: transform 0.3s var(--ease-out);
}
.site-nav::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgb(var(--bg-rgb) / 0.72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
}

.site-nav.nav-hidden { transform: translateY(-100%); }

.nav-logo {
  font-size: 0.98rem;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.nav-links {
  display: flex;
  gap: clamp(1.25rem, 3vw, 2.25rem);
  font-size: var(--fs-micro);
}

.nav-links a {
  color: var(--text-2);
  transition: color var(--dur-fast) ease;
}
.nav-links a:hover,
.nav-links a.is-current { color: var(--text); }

.nav-toggle { display: none; }

@media (max-width: 720px) {
  .nav-links {
    position: fixed;
    inset: 52px 0 0 0;
    height: calc(100dvh - 52px);
    background: var(--bg);
    flex-direction: column;
    gap: 0;
    padding: var(--space-2) 1.375rem;
    font-size: 1.6rem;
    font-weight: 600;
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    transition: opacity 0.2s var(--ease-out), transform 0.2s var(--ease-out);
  }
  .nav-links li { border-bottom: 1px solid var(--line); }
  .nav-links a { display: block; padding: 0.85rem 0; color: var(--text); }
  .nav-links.is-open { opacity: 1; transform: none; pointer-events: auto; }
  .nav-toggle {
    display: block;
    width: 22px;
    height: 14px;
    position: relative;
  }
  .nav-toggle span {
    position: absolute; left: 0; right: 0; height: 1.5px;
    background: var(--text);
    border-radius: 2px;
    transition: transform 0.24s var(--ease-out), opacity 0.16s ease;
  }
  .nav-toggle span:nth-child(1) { top: 2px; }
  .nav-toggle span:nth-child(2) { top: 6.5px; opacity: 0; }
  .nav-toggle span:nth-child(3) { top: 11px; }
  .nav-toggle.is-open span:nth-child(1) { transform: translateY(4.5px) rotate(45deg); }
  .nav-toggle.is-open span:nth-child(3) { transform: translateY(-4.5px) rotate(-45deg); }
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.72rem 1.35rem;
  border-radius: 999px;
  font-size: var(--fs-small);
  font-weight: 500;
  transition: transform 0.16s var(--ease-out), background-color 0.2s ease, color 0.2s ease;
}
.btn:active { transform: scale(0.97); }

.btn-primary { background: var(--accent); color: #fff; }
.btn-ghost { color: var(--accent); }

@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover { background: var(--accent-strong); }
  .btn-ghost:hover { text-decoration: underline; text-underline-offset: 3px; }
}

/* text link with a chevron, the Apple "Learn more ›" pattern */
.more-link {
  color: var(--accent);
  font-size: var(--fs-body);
}
.more-link::after { content: " ›"; }
@media (hover: hover) and (pointer: fine) {
  .more-link:hover { text-decoration: underline; text-underline-offset: 3px; }
}

/* ---------- Reveal utility (paired with GSAP ScrollTrigger) ---------- */

.reveal { opacity: 0; }

/* ---------- Shared page head (About / Projects / Résumé / Contact) ---------- */

.page-hero {
  padding-top: 8.5rem;
  padding-bottom: var(--space-4);
}

.page-hero h1 {
  font-size: var(--fs-h1);
  margin-top: 0.6rem;
  max-width: 18ch;
}

.section-lede {
  margin-top: 0.8rem;
  font-size: var(--fs-body-lg);
  line-height: 1.45;
  color: var(--text-2);
  max-width: 56ch;
}

/* the previous design's gradient headline fill is not used here */
[data-fill-text] { color: var(--text); }

/* ---------- Placeholder marker ---------- */

.placeholder-note {
  display: inline-block;
  margin-top: 0.75rem;
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: var(--fs-micro);
  color: var(--text-2);
}

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

.site-footer {
  border-top: 1px solid var(--line);
  padding: var(--space-3) 0 var(--space-4);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
  justify-content: space-between;
  font-size: var(--fs-micro);
  color: var(--text-3);
}

.footer-links { display: flex; gap: var(--space-3); }
.footer-links a { color: var(--text-2); }
@media (hover: hover) and (pointer: fine) {
  .footer-links a:hover { color: var(--text); }
}

/* ---------- Cursor (desktop-with-mouse only, see js/cursor-fx.js) ----------
   A small dot in the text colour (dark on light, light on dark) that grows
   into a frosted-glass lens over anything clickable. Same glass material as
   the nav bar and the photo captions. */

.cursor-fx-active,
.cursor-fx-active * { cursor: none !important; }

.cursor-trail-canvas { display: none; }

.custom-cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border-radius: 50%;
  background: var(--text);
  border: 1px solid transparent;
  pointer-events: none;
  z-index: 999;
  opacity: 0;
  transition: width 0.3s var(--ease-out), height 0.3s var(--ease-out), margin 0.3s var(--ease-out),
    opacity 0.2s ease, background-color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease,
    backdrop-filter 0.3s var(--ease-out);
  will-change: transform;
}
.custom-cursor.is-active { opacity: 1; }

.custom-cursor.is-hover {
  width: 38px;
  height: 38px;
  margin: -19px 0 0 -19px;
  background: rgb(var(--fg) / 0.05);
  border-color: rgb(var(--fg) / 0.28);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.35), 0 4px 14px -6px rgb(0 0 0 / 0.3);
  backdrop-filter: blur(4px) saturate(170%);
  -webkit-backdrop-filter: blur(4px) saturate(170%);
}

/* ---------- Glare: not part of this design ---------- */

.glare-layer { display: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
