/* ============================================================
   ISAACPEREZ.CO — Apple-style motion redesign
   Monochrome + one restrained accent. Light & dark. Vanilla.
   ============================================================ */

:root {
  --bg: #fbfbfd;
  --bg-alt: #f5f5f7;
  --card: #ffffff;
  --text: #1d1d1f;
  --text-2: #6e6e73;
  --text-3: #86868b;
  --line: #d2d2d7;
  --line-soft: #e8e8ed;
  --accent: #1d1d1f;
  --accent-hover: #000000;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.06), 0 1px 4px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 24px 70px rgba(0, 0, 0, 0.12);
  --nav-bg: rgba(251, 251, 253, 0.72);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft: cubic-bezier(0.4, 0, 0.2, 1);
  --maxw: 1120px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Segoe UI", system-ui, sans-serif;
}

:root[data-theme="dark"] {
  --bg: #000000;
  --bg-alt: #0a0a0a;
  --card: #161617;
  --text: #f5f5f7;
  --text-2: #a1a1a6;
  --text-3: #6e6e73;
  --line: #2a2a2c;
  --line-soft: #1c1c1e;
  --accent: #f5f5f7;
  --accent-hover: #ffffff;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 30px 80px rgba(0, 0, 0, 0.6);
  --nav-bg: rgba(0, 0, 0, 0.72);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000; --bg-alt: #0a0a0a; --card: #161617;
    --text: #f5f5f7; --text-2: #a1a1a6; --text-3: #6e6e73;
    --line: #2a2a2c; --line-soft: #1c1c1e;
    --accent: #f5f5f7; --accent-hover: #ffffff;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.4); --shadow-lg: 0 30px 80px rgba(0, 0, 0, 0.6);
    --nav-bg: rgba(0, 0, 0, 0.72);
  }
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background 0.5s var(--ease-soft), color 0.5s var(--ease-soft);
}

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

a { color: inherit; text-decoration: none; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ============ NAV ============ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: 52px;
  background: var(--nav-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid transparent;
  transition: transform 0.4s var(--ease), border-color 0.4s var(--ease-soft), background 0.5s var(--ease-soft);
}
.nav.scrolled { border-bottom-color: var(--line-soft); }
.nav.hide { transform: translateY(-100%); }
.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  height: 100%;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-brand { font-size: 17px; font-weight: 600; letter-spacing: -0.02em; }
.nav-links { display: flex; align-items: center; gap: 28px; list-style: none; }
.nav-links a {
  font-size: 13px; color: var(--text-2);
  transition: color 0.2s;
  position: relative;
}
.nav-links a::after {
  content: ''; position: absolute; left: 0; bottom: -4px; height: 1px; width: 0;
  background: var(--text); transition: width 0.3s var(--ease);
}
.nav-links a:hover { color: var(--text); }
.nav-links a:hover::after { width: 100%; }
.theme-btn {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border: none; background: transparent; color: var(--text-2);
  cursor: pointer; border-radius: 50%;
  transition: color 0.2s, background 0.2s;
}
.theme-btn:hover { color: var(--text); background: var(--bg-alt); }
.theme-btn svg { width: 18px; height: 18px; }
:root[data-theme="dark"] .icon-sun, :root:not([data-theme="light"]) .icon-sun { display: block; }
:root[data-theme="dark"] .icon-moon, :root:not([data-theme="light"]) .icon-moon { display: none; }
.icon-sun { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .icon-sun { display: block; } :root:not([data-theme="light"]) .icon-moon { display: none; } }
:root[data-theme="light"] .icon-sun { display: none; }
:root[data-theme="light"] .icon-moon { display: block; }

@media (max-width: 640px) { .nav-links a:not(.nav-cta) { display: none; } }

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 16px; font-weight: 400;
  cursor: pointer; border: none;
  transition: transform 0.3s var(--ease), background 0.2s, color 0.2s, opacity 0.2s;
}
.btn-pill {
  padding: 12px 24px; border-radius: 980px;
  background: var(--accent); color: var(--bg);
}
.btn-pill:hover { background: var(--accent-hover); transform: scale(1.04); }
.btn-pill:active { transform: scale(0.98); }
.btn-text { color: var(--accent); }
.btn-text .arrow { transition: transform 0.3s var(--ease); }
.btn-text:hover .arrow { transform: translateX(4px); }

/* ============ REVEAL MOTION ============ */
[data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  filter: blur(6px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease), filter 0.9s var(--ease);
  transition-delay: var(--d, 0ms);
}
[data-reveal].in { opacity: 1; transform: none; filter: none; }

/* ============ HERO ============ */
.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 24px 40px;
  position: relative;
}
.hero-bg {
  position: absolute; inset: 0; z-index: -1; overflow: hidden;
  pointer-events: none;
}
.hero-bg span {
  position: absolute; border-radius: 50%;
  filter: blur(70px); opacity: 0.5;
  background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
}
.hero-bg .b1 { width: 50vw; height: 50vw; top: -10%; left: -10%; opacity: 0.10; animation: drift1 22s var(--ease-soft) infinite alternate; }
.hero-bg .b2 { width: 40vw; height: 40vw; bottom: -15%; right: -5%; opacity: 0.08; background: radial-gradient(circle, var(--text-2) 0%, transparent 70%); animation: drift2 26s var(--ease-soft) infinite alternate; }
@keyframes drift1 { to { transform: translate(8vw, 6vh) scale(1.15); } }
@keyframes drift2 { to { transform: translate(-6vw, -8vh) scale(1.1); } }

.hero-inner { max-width: 920px; will-change: transform, opacity, filter; }
.hero-eyebrow {
  font-size: 13px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 22px;
}
.hero-title {
  font-size: clamp(3rem, 11vw, 8rem);
  font-weight: 700; letter-spacing: -0.04em; line-height: 0.98;
  margin-bottom: 24px;
}
.hero-sub {
  font-size: clamp(1.1rem, 2.4vw, 1.6rem);
  color: var(--text-2); font-weight: 400; line-height: 1.45;
  max-width: 620px; margin: 0 auto 36px;
}
.hero-actions { display: flex; gap: 18px; justify-content: center; align-items: center; flex-wrap: wrap; }
.scroll-cue {
  position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%);
  color: var(--text-3); font-size: 12px; letter-spacing: 0.1em;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  animation: bob 2.4s var(--ease-soft) infinite;
}
@keyframes bob { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, 6px); } }
.scroll-cue svg { width: 16px; height: 16px; }

/* word-stagger title */
.hero-title .w { display: inline-block; opacity: 0; transform: translateY(40px); filter: blur(8px); }
.hero-title.go .w { animation: wordIn 1s var(--ease) forwards; }
@keyframes wordIn { to { opacity: 1; transform: none; filter: none; } }

/* ============ SECTION SCAFFOLD ============ */
section { position: relative; }
section[id], main[id] { scroll-margin-top: 64px; }
.sec-pad { padding: clamp(80px, 14vh, 180px) 0; }
.eyebrow {
  font-size: 13px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-3); margin-bottom: 16px;
}
.sec-head { margin-bottom: 56px; }
.sec-title {
  font-size: clamp(2rem, 5vw, 3.4rem); font-weight: 700; letter-spacing: -0.03em; line-height: 1.05;
}
.sec-title.center { text-align: center; }

/* ============ STATEMENT ============ */
.statement { padding: clamp(100px, 20vh, 240px) 0; }
.statement p {
  font-size: clamp(1.9rem, 6vw, 4.4rem);
  font-weight: 600; letter-spacing: -0.03em; line-height: 1.12;
  max-width: 16ch;
}
.statement .muted { color: var(--text-3); }
.statement .word {
  display: inline-block;
  opacity: 0.16;
  transition: opacity 0.4s var(--ease-soft);
}

/* ============ WORK ============ */
.work-list { display: flex; flex-direction: column; gap: 28px; }
.work-card {
  position: relative;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 40px;
  align-items: center;
  padding: 48px;
  border-radius: 28px;
  background: var(--card);
  box-shadow: var(--shadow);
  border: 1px solid var(--line-soft);
  overflow: hidden;
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease);
}
.work-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.work-card::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(120% 120% at 80% 0%, var(--wc, var(--accent)) 0%, transparent 45%);
  opacity: 0.06; pointer-events: none;
  transition: opacity 0.5s var(--ease);
}
.work-card:hover::before { opacity: 0.12; }
.work-status {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12px; color: var(--text-3); margin-bottom: 14px;
}
.work-status .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--wc, var(--accent)); }
.work-name { font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 700; letter-spacing: -0.03em; margin-bottom: 14px; }
.work-desc { font-size: 1.05rem; color: var(--text-2); line-height: 1.55; margin-bottom: 22px; max-width: 46ch; }
.work-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 26px; }
.work-tag {
  font-size: 12px; padding: 5px 12px; border-radius: 980px;
  background: var(--bg-alt); color: var(--text-2); border: 1px solid var(--line-soft);
}
.work-visual {
  aspect-ratio: 4 / 3; border-radius: 20px; overflow: hidden;
  background: var(--bg-alt);
  display: grid; place-items: center;
}
.work-visual {
  background:
    radial-gradient(120% 120% at 30% 20%, color-mix(in srgb, var(--wc, var(--accent)) 22%, var(--bg-alt)) 0%, var(--bg-alt) 70%);
}
.work-visual .app-icon {
  width: 44%; max-width: 152px; aspect-ratio: 1; height: auto;
  border-radius: 23%; object-fit: cover;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.22), 0 2px 6px rgba(0, 0, 0, 0.12);
  transition: transform 0.7s var(--ease);
}
.work-card:hover .work-visual .app-icon { transform: scale(1.06) rotate(-1.5deg); }
.work-visual .glyph { font-size: 64px; filter: drop-shadow(0 10px 20px rgba(0,0,0,0.2)); }
@media (max-width: 820px) {
  .work-card { grid-template-columns: 1fr; padding: 32px; gap: 28px; }
  .work-visual { order: -1; }
}

/* ============ EXPERIENCE ============ */
.exp-list { max-width: 820px; }
.exp-item {
  display: grid; grid-template-columns: auto 1fr auto; gap: 10px 22px;
  padding: 36px 0; border-top: 1px solid var(--line);
  align-items: center;
}
.exp-item:last-child { border-bottom: 1px solid var(--line); }
.exp-logo {
  width: 58px; height: 58px; border-radius: 16px; overflow: hidden;
  background: #fff; display: grid; place-items: center;
  box-shadow: var(--shadow); border: 1px solid var(--line-soft);
}
.exp-logo img { display: block; object-fit: contain; }
/* per-logo sizing: each source frames its mark differently */
.exp-logo.l-tinder img { width: 30px; height: 30px; }      /* tall flame — size by its own box, centered */
.exp-logo.l-nd img { width: 56px; height: 56px; transform: scale(1.32); } /* house sits in big margins — scale up, tile clips */
.exp-co { font-size: clamp(1.5rem, 3.5vw, 2.2rem); font-weight: 700; letter-spacing: -0.02em; }
.exp-role { font-size: 1rem; color: var(--accent); margin-top: 4px; }
.exp-date { font-size: 14px; color: var(--text-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.exp-desc { grid-column: 1 / -1; color: var(--text-2); font-size: 1rem; line-height: 1.6; max-width: 58ch; margin-top: 4px; }
.exp-tags { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

/* ============ MARQUEE ============ */
.marquee {
  border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft);
  padding: 28px 0; overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.marquee-track { display: flex; gap: 0; width: max-content; animation: marquee 30s linear infinite; }
.marquee-track span { font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 600; letter-spacing: -0.02em; color: var(--text-3); padding: 0 28px; }
.marquee-track span::after { content: '·'; margin-left: 56px; color: var(--accent); }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ============ ABOUT ============ */
.about-grid { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: 56px; align-items: center; }
.about-photo-wrap { border-radius: 28px; overflow: hidden; box-shadow: var(--shadow-lg); }
.about-photo { width: 100%; aspect-ratio: 4/5; object-fit: cover; display: block; will-change: transform; }
.about-text p { font-size: clamp(1.1rem, 1.8vw, 1.35rem); color: var(--text-2); line-height: 1.6; margin-bottom: 20px; }
.about-text p strong { color: var(--text); font-weight: 600; }
.about-attrs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; margin-top: 30px; background: var(--line-soft); border-radius: 16px; overflow: hidden; }
.about-attr { background: var(--bg); padding: 16px 18px; }
.about-attr dt { font-size: 12px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.06em; }
.about-attr dd { font-size: 1rem; font-weight: 600; margin-top: 4px; }
@media (max-width: 820px) { .about-grid { grid-template-columns: 1fr; gap: 32px; } .about-photo-wrap { max-width: 360px; } }

/* ============ CONTACT ============ */
.contact { text-align: center; padding: clamp(100px, 18vh, 220px) 0; }
.contact h2 { font-size: clamp(2.4rem, 7vw, 5rem); font-weight: 700; letter-spacing: -0.04em; line-height: 1.02; margin-bottom: 24px; }
.contact p { font-size: clamp(1.1rem, 2vw, 1.4rem); color: var(--text-2); max-width: 520px; margin: 0 auto 40px; }
.contact-links { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 20px; border-radius: 980px;
  background: var(--bg-alt); border: 1px solid var(--line-soft);
  font-size: 15px; color: var(--text);
  transition: transform 0.3s var(--ease), background 0.2s, border-color 0.2s;
}
.chip:hover { transform: translateY(-3px); border-color: var(--line); background: var(--card); }
.chip svg { width: 17px; height: 17px; }

/* ============ FOOTER ============ */
.foot {
  border-top: 1px solid var(--line-soft);
  padding: 40px 0;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.foot small { color: var(--text-3); font-size: 13px; }
.foot-links { display: flex; gap: 22px; }
.foot-links a, .office-link { font-size: 13px; color: var(--text-3); transition: color 0.2s; }
.foot-links a:hover, .office-link:hover { color: var(--text); }
.office-link { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; background: none; border: none; font-family: inherit; }
.office-link .arrow { transition: transform 0.3s var(--ease); }
.office-link:hover .arrow { transform: translateX(3px); }

/* ============ REDUCED MOTION ============ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  [data-reveal] { opacity: 1 !important; transform: none !important; filter: none !important; }
  .hero-title .w { opacity: 1 !important; transform: none !important; filter: none !important; }
  .statement .word { opacity: 1 !important; }
  .hero-bg { display: none; }
}
