/* ─────────────────────────────────────────────
   John Lee — Portfolio
   Style: Editorial minimal + motion-driven
   Palette: Monochrome + electric blue accent
   Type:   Archivo (display) + Space Grotesk (body)
   ───────────────────────────────────────────── */

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

:root {
  --bg:        #FAFAFA;
  --surface:   #FFFFFF;
  --ink:       #09090B;
  --ink-2:     #18181B;
  --muted:     #52525B;
  --muted-2:   #5C5C66; /* AA: 5.6:1 on --bg */
  --line:      #E4E4E7;
  --line-2:    #D4D4D8;
  --accent:    #2563EB;
  --accent-ink:#1D4ED8;
  --accent-bg: rgba(37, 99, 235, 0.08);

  --max-w:     1180px;
  --radius:    16px;
  --radius-lg: 24px;

  --ease:      cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* ── Dark mode ── */
[data-theme="dark"] {
  --bg:        #09090B;
  --surface:   #18181B;
  --ink:       #FAFAFA;
  --ink-2:     #E4E4E7;
  --muted:     #A1A1AA;
  --muted-2:   #71717A;
  --line:      #27272A;
  --line-2:    #3F3F46;
  --accent:    #3B82F6;
  --accent-ink:#60A5FA;
  --accent-bg: rgba(59, 130, 246, 0.12);
  color-scheme: dark;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 6.5rem;
  color-scheme: light;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

::selection { background: var(--ink); color: var(--bg); }

/* ── Layout ── */
.container {
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: 1.75rem;
  width: 100%;
}

section { padding-block: 7rem; position: relative; }

/* ── Reveal ── */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  transition-delay: var(--reveal-delay, 0ms);
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }

/* ── Type ── */
h1, h2, h3 {
  font-family: 'Archivo', sans-serif;
  color: var(--ink);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.05;
}

.hero-title {
  font-size: clamp(2.75rem, 7vw, 5.5rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.045em;
}

h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  margin-bottom: 1rem;
}

h3 {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 1.5rem;
}

.eyebrow-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-bg);
  animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1);   opacity: 1; }
  50%      { transform: scale(0.7); opacity: 0.6; }
}

.hero .eyebrow-dot { animation: pulse 2.4s ease-in-out infinite; }
.eyebrow-dot { animation: none; }

/* ── Floating Nav ── */
header {
  position: fixed;
  top: 1rem;
  left: 1rem;
  right: 1rem;
  z-index: 100;
  display: flex;
  justify-content: center;
  pointer-events: none;
}

nav {
  pointer-events: auto;
  width: 100%;
  max-width: 720px;
  padding: 0.5rem 0.5rem 0.5rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 999px;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.04),
    0 8px 24px -10px rgba(0, 0, 0, 0.12);
  transition: box-shadow 0.3s var(--ease), background-color 0.3s var(--ease);
}

[data-theme="dark"] nav {
  background: rgba(24, 24, 27, 0.8);
  border-color: rgba(255, 255, 255, 0.08);
}

nav:hover {
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.06),
    0 12px 32px -10px rgba(0, 0, 0, 0.18);
}

/* ── Theme toggle ── */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  flex-shrink: 0;
  transition: color 0.2s var(--ease), background-color 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.15s var(--ease);
}

.theme-toggle:hover {
  background: var(--bg);
  border-color: var(--accent);
  color: var(--accent);
  transform: scale(1.08);
}

[data-theme="dark"] .theme-toggle {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.theme-toggle .icon-sun,
.theme-toggle .icon-moon { display: none; }

.theme-toggle.is-light .icon-sun { display: block; }
.theme-toggle.is-dark .icon-moon { display: block; }

.logo {
  font-family: 'Archivo', sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.02em;
  cursor: pointer;
  padding: 0.4rem 0;
}

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

.logo-dot { color: var(--accent); }

nav ul {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: auto;
  background: rgba(0, 0, 0, 0.035);
  padding: 0.25rem;
  border-radius: 999px;
}

[data-theme="dark"] nav ul {
  background: rgba(255, 255, 255, 0.06);
}

nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0.4rem 0.95rem;
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.2s var(--ease), background-color 0.2s var(--ease);
}

nav a:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.85);
}

[data-theme="dark"] nav a:hover {
  background: rgba(255, 255, 255, 0.1);
}

nav a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ── Hero ── */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-block: 8rem 5rem;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(900px circle at 85% 0%, rgba(37,99,235,0.08), transparent 55%),
    radial-gradient(700px circle at 0% 100%, rgba(37,99,235,0.05), transparent 55%);
  pointer-events: none;
  z-index: 0;
}

.hero .container { position: relative; z-index: 1; }

.hero-title {
  max-width: 16ch;
  margin-bottom: 1.5rem;
}

.hero-sub {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(1.05rem, 1.6vw, 1.35rem);
  font-weight: 400;
  line-height: 1.45;
  color: var(--muted);
  letter-spacing: -0.005em;
  max-width: 38ch;
  margin-bottom: 2.5rem;
}

.hero-cta {
  margin-bottom: 3rem;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}

.hero-meta > div {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.meta-label {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.meta-value {
  font-family: 'Archivo', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
}

/* ── Marquee ── */
.marquee {
  overflow: hidden;
  padding-block: 1.5rem;
  border-block: 1px solid var(--line);
  background: var(--surface);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.marquee-track {
  display: inline-flex;
  align-items: center;
  gap: 2rem;
  white-space: nowrap;
  animation: marquee 38s linear infinite;
  padding-right: 2rem;
}

.marquee-track span {
  font-family: 'Archivo', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.025em;
}

.marquee-track .dot { color: var(--accent); font-weight: 400; }

@keyframes marquee {
  to { transform: translateX(-50%); }
}

/* ── Section head ── */
.section-head {
  margin-bottom: 4rem;
  max-width: 40rem;
}

/* ── Work list ── */
.work-list {
  list-style: none;
  border-top: 1px solid var(--line);
}

.work-item {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 2rem;
  padding: 2.5rem 0;
  border-bottom: 1px solid var(--line);
  position: relative;
  transition: padding 0.4s var(--ease), transform 0.1s var(--ease);
  touch-action: manipulation;
}

.work-item::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--accent-bg), transparent 70%);
  opacity: 0;
  transition: opacity 0.4s var(--ease);
  pointer-events: none;
  z-index: -1;
}

.work-item:hover,
.work-item:focus-within { padding-inline: 1.25rem; }
.work-item:hover::before,
.work-item:focus-within::before { opacity: 1; }
.work-item:hover .work-num,
.work-item:focus-within .work-num { color: var(--accent); }
.work-item:active { transform: scale(0.99); transition: transform 0.1s var(--ease); }

.work-num {
  font-family: 'Archivo', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--muted-2);
  letter-spacing: 0.04em;
  padding-top: 0.35rem;
  transition: color 0.3s var(--ease);
}

.work-main {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.work-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}

.work-title-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.work-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}

.work-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.work-badge--green {
  color: #16a34a;
  background: #dcfce7;
}

.work-badge--blue {
  color: var(--accent);
  background: var(--accent-bg);
}

.work-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  padding-top: 0.4rem;
}

.work-tags span {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.22rem 0.55rem;
}

.work-item p {
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.65;
  max-width: 64ch;
}

.work-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-top: 0.35rem;
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  padding: 0.5rem 0;
  min-height: 44px;
  cursor: pointer;
  position: relative;
  transition: color 0.25s var(--ease), gap 0.25s var(--ease);
}

.link-arrow::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.4rem;
  height: 1.5px;
  background: currentColor;
  transition: background-color 0.25s var(--ease);
}

.link-arrow svg { transition: transform 0.3s var(--ease); }

.link-arrow:hover {
  color: var(--accent);
  gap: 0.6rem;
}

.link-arrow:hover svg { transform: translate(2px, -2px); }

.link-arrow--muted { color: var(--muted); }

.link-arrow:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 2px;
}

/* ── About ── */
#about { background: var(--surface); border-block: 1px solid var(--line); }

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 5rem;
  align-items: start;
}

.about-grid .section-head { margin-bottom: 0; }

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

.lead {
  font-family: 'Archivo', sans-serif;
  font-size: clamp(1.25rem, 2vw, 1.6rem);
  line-height: 1.35;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.about-body p { color: var(--muted); font-size: 1.05rem; line-height: 1.7; }

.about-facts {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--line);
}

.about-facts > div {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 1rem;
  padding-block: 1rem;
  border-bottom: 1px solid var(--line);
}

.about-facts dt {
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-2);
  padding-top: 0.15rem;
}

.about-facts dd {
  font-family: 'Archivo', sans-serif;
  font-size: 1rem;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.01em;
}

/* ── Contact ── */
.contact-card {
  background: var(--ink);
  color: var(--bg);
  border-radius: var(--radius-lg);
  padding: clamp(2.5rem, 5vw, 4.5rem);
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
}

.contact-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(600px circle at 100% 0%, rgba(37,99,235,0.35), transparent 55%),
    radial-gradient(500px circle at 0% 100%, rgba(37,99,235,0.18), transparent 55%);
  pointer-events: none;
}

.contact-card > * { position: relative; }

.contact-card .eyebrow { color: rgba(255,255,255,0.7); }
.contact-card .eyebrow-dot { background: #fff; box-shadow: 0 0 0 4px rgba(255,255,255,0.15); }

[data-theme="dark"] .contact-card {
  background: #0F172A;
  border-color: #1E293B;
}
[data-theme="dark"] .contact-card .eyebrow { color: rgba(255,255,255,0.5); }
[data-theme="dark"] .contact-title { color: #F8FAFC; }
[data-theme="dark"] .contact-sub { color: rgba(255,255,255,0.6); }
[data-theme="dark"] .btn--primary { background: #F8FAFC; color: #09090B; }
[data-theme="dark"] .btn--primary:hover { background: #93C5FD; }

.contact-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.04em;
  color: var(--bg);
  margin-bottom: 1.25rem;
  max-width: 18ch;
}

.contact-title em {
  font-family: 'Archivo', sans-serif;
  font-style: italic;
  font-weight: 500;
  color: #93C5FD;
}

.contact-sub {
  color: rgba(255,255,255,0.7);
  font-size: 1.1rem;
  line-height: 1.6;
  max-width: 50ch;
  margin-bottom: 2.5rem;
}

.contact-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.95rem 1.6rem;
  min-height: 44px;
  font-family: 'Archivo', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  border-radius: 999px;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.25s var(--ease), color 0.25s var(--ease), border-color 0.25s var(--ease), transform 0.2s var(--ease);
}

.btn--cta {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.btn--cta:hover {
  background: var(--accent-ink);
  border-color: var(--accent-ink);
  transform: translateY(-2px);
}

.btn--cta svg { transition: transform 0.3s var(--ease); }
.btn--cta:hover svg { transform: translateY(3px); }

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

.btn--primary:hover {
  background: #93C5FD;
  color: var(--ink);
  transform: translateY(-2px);
}

.btn--primary svg { transition: transform 0.3s var(--ease); }
.btn--primary:hover svg { transform: translateX(4px); }

.btn--ghost {
  background: transparent;
  color: #fff;
  border-color: rgba(255,255,255,0.2);
}

.btn--ghost:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.4);
  transform: translateY(-2px);
}

.btn:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

/* ── Footer ── */
footer {
  border-top: 1px solid var(--line);
  padding-block: 2rem;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

footer p {
  color: var(--muted-2);
  font-size: 0.85rem;
  letter-spacing: 0.005em;
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .about-grid { grid-template-columns: 1fr; gap: 2.5rem; }
}

@media (max-width: 768px) {
  section { padding-block: 5rem; }
  .hero { min-height: 80vh; padding-block: 6rem 3rem; }
  .hero-meta { gap: 1.75rem; }
  .work-item { grid-template-columns: 1fr; gap: 0.75rem; padding: 2rem 0; }
  .work-item:hover { padding-inline: 0; }
  .work-num { padding-top: 0; }
  .work-head { gap: 0.75rem; }
  .about-facts > div { grid-template-columns: 1fr; gap: 0.25rem; }
  .marquee-track span { font-size: 1.2rem; }
  header { top: 0.75rem; left: 0.75rem; right: 0.75rem; }
  nav { padding-left: 1rem; gap: 0.75rem; }
  nav a { font-size: 0.82rem; padding: 0.35rem 0.7rem; }
  .logo { font-size: 0.95rem; }
}

@media (max-width: 480px) {
  .container { padding-inline: 1.25rem; }
  .hero-meta > div { min-width: calc(50% - 1rem); }
  nav ul { display: none; }
  nav { justify-content: space-between; gap: 0; }
}

/* ── Motion preferences ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
  .marquee-track { animation: none; }
  .hero .eyebrow-dot { animation: none; }
}
