/* ============================================================
   VARIABLES & RESET
   ============================================================ */
:root {
  --bg:       #F8F6F1;
  --ink:      #0F0F0E;
  --ink-2:    #716F6A;
  --accent:   #E84B2D;
  --surface:  #EFEDE8;
  --border:   rgba(15, 15, 14, 0.11);

  --font-display: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --font-ui:      'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  --max-w:  1380px;
  --pad-x:  clamp(1.5rem, 5.5vw, 5rem);
  --pad-y:  clamp(4rem, 9vh, 7rem);

  --ease:    cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-weight: 400;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

a  { color: inherit; text-decoration: none; }
canvas, img { display: block; max-width: 100%; }


/* ============================================================
   CUSTOM CURSOR
   ============================================================ */
.cursor {
  position: fixed;
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: width 0.25s var(--ease), height 0.25s var(--ease), opacity 0.2s;
  mix-blend-mode: multiply;
  will-change: left, top;
}

@media (hover: none) {
  .cursor { display: none; }
}


/* ============================================================
   NAVIGATION
   ============================================================ */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem var(--pad-x);
  transition: transform 0.45s var(--ease), background 0.3s, border-color 0.3s;
}

.nav.scrolled {
  background: rgba(248, 246, 241, 0.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

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

.nav-logo {
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink);
}

.nav-links {
  display: flex;
  gap: 2.25rem;
}

.nav-links a {
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-2);
  position: relative;
  transition: color 0.2s;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--ink);
  transition: width 0.3s var(--ease);
}

.nav-links a:hover { color: var(--ink); }
.nav-links a:hover::after { width: 100%; }


/* ============================================================
   HERO
   ============================================================ */
.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: calc(var(--pad-y) + 3.5rem);
  padding-bottom: var(--pad-y);
  padding-left: var(--pad-x);
  padding-right: var(--pad-x);
  max-width: var(--max-w);
  margin: 0 auto;
}

.hero-content {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: clamp(3rem, 6vw, 7rem);
  align-items: center;
  flex: 1;
}

.hero-eyebrow {
  font-size: 0.6875rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-2);
  margin-bottom: 1.75rem;
}

.hero-headline {
  font-family: var(--font-display);
  font-size: 7rem;
  font-weight: 300;
  line-height: 0.92;
  letter-spacing: -0.03em;
  color: var(--ink);
  margin-bottom: 2.5rem;
}

.hero-headline em {
  font-style: italic;
  color: var(--accent);
  font-weight: 300;
}

.hero-sub {
  font-size: clamp(0.9rem, 1.15vw, 1.05rem);
  font-weight: 300;
  color: var(--ink-2);
  line-height: 1.8;
  max-width: 38ch;
}

/* ── Avatar: circular ring with orbiting text + portrait ── */
.hero-avatar-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Scene bounds the SVG ring + circle frame */
.avatar-scene {
  position: relative;
  width: 320px;
  height: 320px;
  flex-shrink: 0;
}

/* Spinning text ring */
.avatar-ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform-box: fill-box;
  transform-origin: center;
  animation: ring-spin 28s linear infinite;
  overflow: visible;
}

@keyframes ring-spin {
  to { transform: rotate(360deg); }
}

.ring-text {
  font-family: var(--font-ui);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 1.8px;
  fill: var(--ink);
}

/* Circle frame — centered at (30,30) within 320px scene */
.pixel-frame {
  position: absolute;
  width: 260px;
  height: 260px;
  top: 30px;
  left: 30px;
  border-radius: 50%;
  border: 2.5px solid var(--ink);
  box-shadow: 0 8px 40px rgba(15, 15, 14, 0.13);
  overflow: hidden;
  flex-shrink: 0;
}

.pixel-frame::after { display: none; }

#pixel-avatar {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* ── Scroll indicator ── */
.hero-footer {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 3.5rem;
}

.scroll-hint {
  font-size: 0.625rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-2);
  opacity: 0.6;
}

.scroll-line {
  width: 56px;
  height: 1px;
  background: var(--ink-2);
  opacity: 0.35;
  transform-origin: left;
  animation: pulse-line 2.4s ease-in-out infinite;
}

@keyframes pulse-line {
  0%, 100% { transform: scaleX(0.25); opacity: 0.15; }
  50%       { transform: scaleX(1);    opacity: 0.4;  }
}


/* ============================================================
   SECTION HEADER (shared)
   ============================================================ */
.section-header {
  display: flex;
  align-items: baseline;
  gap: 1.25rem;
  margin-bottom: clamp(2.5rem, 5vw, 4.5rem);
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.section-num {
  font-size: 0.625rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  color: var(--ink-2);
}

.section-title {
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
}


/* ============================================================
   WORKED WITH (brand marquee)
   ============================================================ */
.brands {
  border-top: 1px solid var(--border);
  padding: clamp(3rem, 6vh, 5rem) 0;
  max-width: var(--max-w);
  margin: 0 auto;
}

.brands-header {
  max-width: var(--max-w);
  margin: 0 auto clamp(1.75rem, 3vw, 2.5rem);
  padding: 0 var(--pad-x);
}

.brands-eyebrow {
  display: inline-block;
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.brands-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: clamp(1.5rem, 3vw, 2.5rem) clamp(1.5rem, 3vw, 3rem);
  padding: 0 var(--pad-x);
  align-items: center;
  justify-items: center;
}

@media (max-width: 900px) {
  .brands-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 560px) {
  .brands-grid { grid-template-columns: repeat(3, 1fr); }
}

.brand-cell {
  width: 100%;
  height: clamp(39px, 4.9vw, 56px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-logo {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  filter: grayscale(1) contrast(1.05) brightness(0.35);
  mix-blend-mode: multiply;
  opacity: 0.65;
  transition: opacity 0.3s var(--ease), filter 0.3s var(--ease);
}

.brand-logo:hover {
  opacity: 1;
  filter: grayscale(0) contrast(1) brightness(1);
}


/* ============================================================
   SELECTED WORK
   ============================================================ */
.work {
  border-top: 1px solid var(--border);
  padding: var(--pad-y) var(--pad-x);
  max-width: var(--max-w);
  margin: 0 auto;
}

.work-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--border);
}

.work-card {
  background: var(--bg);
  cursor: pointer;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.work-card-img {
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  transition: transform 0.7s var(--ease);
}

.work-card:hover .work-card-img {
  transform: scale(1.03);
}

/* Editorial case-study illustrations — workshop diagrams, not stock */
.work-card-img--1,
.work-card-img--2,
.work-card-img--3 {
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
}
.work-card-img--1 {
  background-color: #0066FF;
  background-image: url("../img/case-design-system.svg");
}
.work-card-img--2 {
  background-color: #1A0F00;
  background-image: url("../img/case-omnichannel.svg");
}
.work-card-img--3 {
  background-color: #050B1A;
  background-image: url("../img/case-nexon.svg");
}

.work-card-meta {
  padding: 1.75rem 2rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  border-top: 1px solid var(--border);
  flex: 1;
}

.work-tag {
  font-size: 0.625rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.work-title {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 2vw, 1.7rem);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin-top: 0.25rem;
  transition: color 0.2s;
}

.work-card:hover .work-title { color: var(--accent); }

.work-role {
  font-size: 0.8125rem;
  color: var(--ink-2);
  margin-top: 0.5rem;
}

/* Third card spans full width, cinematic crop */
.work-card--wide {
  grid-column: 1 / -1;
}

.work-card--wide .work-card-img {
  aspect-ratio: 21 / 9;
}


/* ============================================================
   ABOUT
   ============================================================ */
.about {
  border-top: 1px solid var(--border);
  padding: var(--pad-y) var(--pad-x);
  max-width: var(--max-w);
  margin: 0 auto;
}

.about-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(3rem, 7vw, 9rem);
  align-items: start;
}

.about-pull {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.6rem);
  font-weight: 300;
  font-style: italic;
  line-height: 1.18;
  letter-spacing: -0.02em;
  color: var(--ink);
  white-space: pre-line;
  position: sticky;
  top: 5.5rem;
}

.about-bio {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.about-bio-lead {
  font-size: clamp(1rem, 1.3vw, 1.125rem);
  line-height: 1.75;
  color: var(--ink);
  font-weight: 400;
}

.about-bio p:not(.about-bio-lead) {
  font-size: clamp(0.9375rem, 1.1vw, 1.0625rem);
  line-height: 1.8;
  color: var(--ink-2);
  font-weight: 300;
}

.about-skills {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 1.125rem;
}

.skill-row {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 1.5rem;
  font-size: 0.875rem;
  line-height: 1.55;
  align-items: baseline;
}

.skill-label {
  font-size: 0.625rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-2);
  padding-top: 0.15rem;
}

.skill-value {
  color: var(--ink);
}


/* ============================================================
   CONTACT
   ============================================================ */
.contact {
  background: var(--ink);
  color: var(--bg);
}

.contact-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: var(--pad-y) var(--pad-x);
}

.contact-num {
  color: rgba(248, 246, 241, 0.35);
}

.contact-headline {
  font-family: var(--font-display);
  font-size: clamp(3.25rem, 8vw, 8rem);
  font-weight: 300;
  line-height: 0.93;
  letter-spacing: -0.03em;
  color: var(--bg);
  margin: 1.5rem 0 3.5rem;
}

.contact-headline em {
  font-style: italic;
  color: var(--accent);
}

.contact-email {
  display: inline-block;
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 2.5vw, 2.25rem);
  font-weight: 300;
  font-style: italic;
  color: var(--bg);
  border-bottom: 1px solid rgba(248, 246, 241, 0.25);
  padding-bottom: 0.2rem;
  transition: color 0.2s, border-color 0.2s;
}

.contact-email:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.contact-links {
  display: flex;
  gap: 2rem;
  margin-top: 3.5rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(248, 246, 241, 0.1);
}

.contact-links a {
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(248, 246, 241, 0.4);
  transition: color 0.2s;
}

.contact-links a:hover { color: var(--bg); }


/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  background: var(--ink);
  border-top: 1px solid rgba(248, 246, 241, 0.08);
  padding: 1.25rem var(--pad-x);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.625rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(248, 246, 241, 0.25);
}


/* ============================================================
   REVEAL ANIMATIONS
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.85s var(--ease), transform 0.85s var(--ease);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.12s; }
.reveal-delay-2 { transition-delay: 0.24s; }
.reveal-delay-3 { transition-delay: 0.36s; }


/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 960px) {
  .hero-content {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .hero-avatar-wrap {
    justify-content: flex-start;
  }

  /* Scale scene down so ring still orbits just outside the smaller frame.
     Frame 200px → scene 246px (ring visual radius ≈ 103px, frame radius 100px). */
  .avatar-scene {
    width: 246px;
    height: 246px;
  }

  .pixel-frame {
    width: 200px;
    height: 200px;
    top: 23px;
    left: 23px;
  }

  #pixel-avatar { inset: 0; width: 100%; height: 100%; top: 0; clip-path: none; }

  .work-grid {
    grid-template-columns: 1fr;
  }

  .work-card--wide {
    grid-column: auto;
  }

  .work-card--wide .work-card-img {
    aspect-ratio: 4 / 3;
  }

  .about-body {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .about-pull {
    position: static;
    font-size: clamp(1.5rem, 5vw, 2.25rem);
  }
}

@media (max-width: 600px) {
  .nav-links {
    gap: 1.5rem;
  }

  /* Frame 170px → scene 204px */
  .avatar-scene { width: 204px; height: 204px; }
  .pixel-frame { width: 170px; height: 170px; top: 17px; left: 17px; }
  #pixel-avatar { inset: 0; width: 100%; height: 100%; top: 0; clip-path: none; }

  .hero-headline {
    font-size: clamp(2.75rem, 12vw, 4.5rem);
  }

  .contact-headline {
    font-size: clamp(2.25rem, 10vw, 4rem);
  }

  .work-card-meta {
    padding: 1.25rem 1.25rem 1.5rem;
  }

  .contact-links {
    flex-wrap: wrap;
    gap: 1.25rem;
  }
}
