/* ==========================================================================
   Jason Guo — Portfolio Front Page
   Design language: adapted from MotionSites "Mossary" framed-video-hero system
   Stack: static HTML/CSS/JS (no build step). Chivo Mono, hairline frame,
   video-driven callout labels, cubic-bezier(0.76,0,0.24,1) house easing.
   ========================================================================== */

:root {
  --bg: #010101;
  --white: #ffffff;
  --line: rgba(255, 255, 255, 0.10);
  --line-soft: rgba(255, 255, 255, 0.06);
  --muted: rgba(255, 255, 255, 0.55);
  --pill-text: #07141B;
  --ease: cubic-bezier(0.76, 0, 0.24, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

html, body { overflow-x: hidden; }

body {
  background: var(--bg);
  color: var(--white);
  font-family: 'Chivo Mono', 'SF Mono', 'Courier New', monospace;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
img, video { display: block; max-width: 100%; }

/* ==========================================================================
   HERO
   ========================================================================== */

.hero {
  position: relative;
  height: 100dvh;
  width: 100%;
  overflow: hidden;
  background: var(--bg);
}

.hero-video {
  position: absolute;
  inset: 0;
  height: 100%;
  width: 100%;
  object-fit: cover;
}

/* Layer A — outer gutter between viewport edge and the hairline frame */
.gutter {
  position: relative;
  z-index: 10;
  margin: 0 auto;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 8px;
}

/* Layer B — content padding inside the frame */
.content-pad { padding: 12px; }

/* The hairline frame */
.frame {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1;
  border: 1px solid var(--line);
}

/* Corner brackets + center ticks */
.bracket {
  position: absolute;
  height: 10px;
  width: 10px;
  pointer-events: none;
}
.bracket.tl { left: -1px; top: -1px; border-left: 2px solid var(--white); border-top: 2px solid var(--white); }
.bracket.tr { right: -1px; top: -1px; border-right: 2px solid var(--white); border-top: 2px solid var(--white); }
.bracket.bl { left: -1px; bottom: -1px; border-left: 2px solid var(--white); border-bottom: 2px solid var(--white); }
.bracket.br { right: -1px; bottom: -1px; border-right: 2px solid var(--white); border-bottom: 2px solid var(--white); }

.tick {
  position: absolute;
  left: 50%;
  height: 1px;
  width: 12px;
  transform: translateX(-50%);
  background: var(--white);
}
.tick.top { top: -1px; }
.tick.bottom { bottom: -1px; }

/* ==========================================================================
   HEADER / NAV
   ========================================================================== */

.site-header {
  display: flex;
  align-items: stretch;
  width: 100%;
  border-bottom: 1px solid var(--line);
}

.brand-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  border-right: 1px solid var(--line);
  padding: 12px;
}
.brand-logo {
  width: 32px;
  height: 32px;
  flex: none;
}
.brand-word {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--white);
  white-space: nowrap;
}

.center-nav {
  display: none;
  flex: 1;
  align-items: center;
  justify-content: center;
  gap: 32px;
  padding: 0 24px;
}
.center-nav a {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--white);
  transition: opacity 0.2s ease;
}
.center-nav a:hover { opacity: 0.7; }

.right-cell {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  border-left: 1px solid var(--line);
  padding: 12px;
}
.right-link {
  display: none;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--white);
  transition: opacity 0.2s ease;
}
.right-link:hover { opacity: 0.7; }

/* Hamburger */
.hamburger {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 44px;
  width: 44px;
  flex: none;
}
.hamburger .bar {
  position: absolute;
  height: 1.5px;
  width: 20px;
  background: var(--white);
  transition: transform 300ms var(--ease), opacity 300ms var(--ease);
}
.hamburger .bar.top { transform: translateY(-6px); }
.hamburger .bar.mid { opacity: 1; }
.hamburger .bar.bot { transform: translateY(6px); }

.hamburger[aria-expanded="true"] .bar.top { transform: translateY(0) rotate(45deg); }
.hamburger[aria-expanded="true"] .bar.mid { opacity: 0; transform: scaleX(0); }
.hamburger[aria-expanded="true"] .bar.bot { transform: translateY(0) rotate(-45deg); }

/* ==========================================================================
   CONTENT (headline + description)
   ========================================================================== */

.content {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1;
  justify-content: space-between;
}

.row-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.row-bottom {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.word {
  font-size: clamp(2rem, 9.5vw, 9.5rem);
  font-weight: 400;
  line-height: 0.9;
  text-transform: uppercase;
  color: var(--white);
}

/* Bottom-left description block */
.description {
  max-width: 140px;
}
.atom {
  width: 40px;
  height: 40px;
}
.description p {
  margin-top: 8px;
  font-size: 10px;
  line-height: 1.3;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--white);
}

/* ==========================================================================
   VIDEO-DRIVEN CALLOUT LABELS
   ========================================================================== */

.labels {
  position: absolute;
  inset: 0;
  padding: 12px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 700ms ease-in-out;
}
.labels.visible { opacity: 1; }

.label {
  position: absolute;
  pointer-events: auto;
}
.label .label-inner {
  position: relative;
  padding: 8px;
}
.label .mini-bracket {
  position: absolute;
  height: 8px;
  width: 8px;
}
.label .mini-bracket.tl { left: 0; top: 0; border-left: 1px solid var(--white); border-top: 1px solid var(--white); }
.label .mini-bracket.tr { right: 0; top: 0; border-right: 1px solid var(--white); border-top: 1px solid var(--white); }
.label .mini-bracket.bl { left: 0; bottom: 0; border-left: 1px solid var(--white); border-bottom: 1px solid var(--white); }
.label .mini-bracket.br { right: 0; bottom: 0; border-right: 1px solid var(--white); border-bottom: 1px solid var(--white); }
.label .mini-tick {
  position: absolute;
  left: 50%;
  height: 1px;
  width: 8px;
  transform: translateX(-50%);
  background: var(--white);
}
.label .mini-tick.top { top: -4px; }
.label .mini-tick.bottom { bottom: -4px; }

.label .pill {
  display: inline-block;
  white-space: nowrap;
  background: var(--white);
  color: var(--pill-text);
  font-size: 11px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 4px 8px;
}

.label-a { right: 12%; top: 32%; }
.label-b { bottom: 32%; left: 5%; }

.leader { display: block; }
.leader.bl { margin-top: 4px; height: 32px; width: 64px; }
.leader.tr { position: absolute; top: -40px; left: 40%; height: 32px; width: 64px; }

/* ==========================================================================
   MOBILE MENU OVERLAY
   ========================================================================== */

.menu-overlay {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  pointer-events: none;
  opacity: 0;
  transition: opacity 500ms var(--ease);
}
.menu-overlay.open { pointer-events: auto; opacity: 1; }

.menu-scrim {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: opacity 500ms var(--ease);
  opacity: 0;
}
.menu-overlay.open .menu-scrim { opacity: 1; }

.menu-close {
  position: absolute;
  right: 16px;
  top: 16px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  width: 48px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: transform 400ms var(--ease), opacity 400ms var(--ease), border-color 200ms ease, background 200ms ease;
  transform: scale(0.75);
  opacity: 0;
}
.menu-overlay.open .menu-close { transform: scale(1); opacity: 1; transition-delay: 150ms; }
.menu-close:hover { border-color: rgba(255, 255, 255, 0.5); background: rgba(255, 255, 255, 0.1); }
.menu-close svg { color: var(--white); }

.menu-links {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex: 1;
  transition: transform 500ms var(--ease), opacity 500ms var(--ease);
  transform: translateY(-24px);
  opacity: 0;
}
.menu-overlay.open .menu-links { transform: translateY(0); opacity: 1; }

.menu-link {
  position: relative;
  display: block;
  padding: 16px 24px;
  font-size: 24px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--white);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 300ms ease, transform 300ms ease;
}
.menu-overlay.open .menu-link { opacity: 1; transform: translateY(0); }
.menu-link .link-text { position: relative; z-index: 10; transition: opacity 200ms ease; }
.menu-link:hover .link-text { opacity: 0.6; }
.menu-link .underline {
  position: absolute;
  bottom: 12px;
  left: 24px;
  right: 24px;
  height: 1px;
  background: rgba(255, 255, 255, 0.4);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 300ms ease;
}
.menu-link:hover .underline { transform: scaleX(1); }

.menu-footer {
  margin-top: 32px;
  display: flex;
  align-items: center;
  gap: 12px;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 500ms ease, transform 500ms ease;
}
.menu-overlay.open .menu-footer { opacity: 1; transform: translateY(0); transition-delay: 400ms; }
.menu-footer .brand-logo { width: 24px; height: 24px; }
.menu-footer .foot-word {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.24em;
  color: rgba(255, 255, 255, 0.5);
}

/* ==========================================================================
   SECTIONS (Work / About / Footer)
   ========================================================================== */

.section {
  position: relative;
  padding: 96px 20px;
  border-bottom: 1px solid var(--line);
}
.section-inner { max-width: 1280px; margin: 0 auto; }

.eyebrow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--muted);
  margin-bottom: 28px;
}
.eyebrow .tick-mark { color: var(--white); }

.section-title {
  font-size: clamp(28px, 5vw, 64px);
  font-weight: 400;
  line-height: 1.0;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  margin-bottom: 56px;
}

/* Work grid */
.work-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
}
.work-card {
  position: relative;
  display: block;
}
.work-card .card-media {
  position: relative;
  overflow: hidden;
  background: #0a0a0a;
  border: 1px solid var(--line);
}
.work-card .card-media img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  transition: transform 0.7s var(--ease), filter 0.7s var(--ease);
}
.work-card:hover .card-media img { transform: scale(1.03); filter: brightness(1.08); }
.work-card .card-index {
  position: absolute;
  top: 14px;
  left: 14px;
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--white);
  background: rgba(1,1,1,0.7);
  padding: 6px 10px;
  border: 1px solid var(--line);
}
.work-card .card-meta { margin-top: 20px; }
.work-card .card-type {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--muted);
  margin-bottom: 8px;
}
.work-card .card-title {
  font-size: clamp(22px, 3vw, 34px);
  font-weight: 400;
  text-transform: uppercase;
  color: var(--white);
  margin-bottom: 8px;
}
.work-card .card-summary {
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
}

/* About */
.about-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  align-items: start;
}
.about-portrait {
  width: 100%;
  max-width: 320px;
  border: 1px solid var(--line);
  filter: grayscale(1);
}
.about-copy p {
  font-size: 15px;
  line-height: 1.7;
  color: var(--muted);
  margin-bottom: 18px;
  max-width: 640px;
}
.about-copy p strong { color: var(--white); font-weight: 500; }
.tag-row {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  margin-top: 8px;
}
.tag-row li {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  padding: 8px 12px;
  border: 1px solid var(--line);
  color: var(--muted);
}

/* Footer */
.footer {
  display: flex;
  flex-direction: column;
  gap: 16px;
  justify-content: space-between;
  padding: 30px 20px;
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.footer a:hover { color: var(--white); }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (min-width: 640px) {
  .gutter { padding: 12px; }
  .content-pad { padding: 16px; }
  .bracket { height: 14px; width: 14px; }
  .brand-cell { gap: 16px; padding: 16px 20px; }
  .brand-logo { width: 40px; height: 40px; }
  .brand-word { font-size: 18px; }
  .right-cell { padding: 16px 20px; }
  .hamburger { height: 48px; width: 48px; }
  .description { max-width: 196px; }
  .atom { width: 48px; height: 48px; }
  .description p { margin-top: 12px; font-size: 12px; }
  .labels { padding: 16px; }
  .label .label-inner { padding: 12px; }
  .label .mini-bracket { height: 10px; width: 10px; }
  .label .pill { font-size: 14px; padding: 6px 12px; }
  .label-a { right: 22%; top: 35%; }
  .label-b { bottom: 35%; left: 12%; }
  .leader { height: auto; width: auto; }
  .leader.tr { top: -60px; }
  .menu-close { right: 24px; top: 24px; }
  .menu-link { font-size: 30px; }
  .section { padding: 110px 32px; }
  .footer { padding: 30px 32px; }
}

@media (min-width: 768px) {
  .gutter { padding: 16px; }
  .content-pad { padding: 24px; }
  .brand-cell { padding: 16px 24px; }
  .brand-logo { width: 44px; height: 44px; }
  .right-cell { padding: 16px 24px; }
  .right-link { display: inline-block; }
  .description p { font-size: 14px; }
  .atom { width: 64px; height: 64px; }
  .labels { padding: 24px; }
  .label-a { right: 25%; }
  .label-b { left: 16%; }
  .work-grid { grid-template-columns: 1fr 1fr; }
  .work-card:first-child { grid-column: 1 / -1; }
  .work-card:first-child .card-media img { aspect-ratio: 2.2; }
  .about-grid { grid-template-columns: 300px 1fr; gap: 64px; }
}

@media (min-width: 1024px) {
  .gutter { padding: 20px; }
  .content-pad { padding: 32px; }
  .center-nav { display: flex; }
  .brand-word { font-size: 20px; }
  .right-link { font-size: 16px; }
  .center-nav a { font-size: 16px; }
  .center-nav { gap: 64px; }
  .description p { font-size: 16px; }
  .atom { width: 80px; height: 80px; }
  .label .pill { font-size: 18px; }
  .label-a { right: 28%; }
  .label-b { left: 18%; }
}

@media (min-width: 1280px) {
  .center-nav { gap: 64px; }
  .center-nav a { font-size: 16px; }
  .right-link { font-size: 16px; }
  .description p { font-size: 20px; line-height: 1.2; }
  .label .pill { font-size: 20px; }
}

/* ==========================================================================
   INTERACTIVITY (cursor halo, parallax targets, scroll reveal, card tilt)
   ========================================================================== */

.cursor-halo {
  position: fixed;
  top: 0;
  left: 0;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate3d(-100px, -100px, 0) translate(-50%, -50%);
  transition: width 0.3s var(--ease), height 0.3s var(--ease),
              border-color 0.3s var(--ease), background 0.3s var(--ease);
  mix-blend-mode: difference;
}
.cursor-halo.is-active {
  width: 64px;
  height: 64px;
  border-color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.08);
}
@media (pointer: coarse) {
  .cursor-halo { display: none; }
}

/* parallax targets get a will-change hint; transform applied by JS */
.hero-video { will-change: transform; }
.word, .labels { will-change: transform; }

/* scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
.reveal.in-view { opacity: 1; transform: none; }

/* card tilt (transform applied by JS) */
.work-card {
  transform-style: preserve-3d;
  transition: transform 0.35s var(--ease);
}
.work-card .card-media img { will-change: transform, filter; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
