/* ===== Custom Properties ===== */
:root {
  --bg: #faf9f6;
  --bg-warm: #f3f0ea;
  --fg: #1a1917;
  --fg-muted: #6b6860;
  --fg-faint: #a8a49c;
  --accent: #e21219;
  --accent-light: #f28a8d;
  --serif: "Instrument Serif", "Georgia", serif;
  --sans: "General Sans", "Helvetica Neue", sans-serif;
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--sans);
  font-weight: 400;
  color: var(--fg);
  background: var(--bg);
  line-height: 1.6;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  display: block;
}

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

/* ===== Grain Overlay ===== */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.3;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  background-size: 200px;
}

/* ===== Navigation ===== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 40px;
  mix-blend-mode: difference;
  color: #fff;
}

.nav-logo {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

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

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.nav-links a {
  position: relative;
  transition: opacity 0.3s;
}

.nav-links a::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: currentColor;
  transition: width 0.4s var(--ease-out-expo);
}

.nav-links a:hover::after {
  width: 100%;
}

.nav-contact {
  padding: 8px 20px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 100px;
  transition: background 0.3s, border-color 0.3s;
}

.nav-contact::after {
  display: none;
}

.nav-contact:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.7);
}

/* ===== Hero ===== */
.hero {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 120px 40px 60px;
  position: relative;
}

.hero-content {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

.hero-label {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.8125rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--fg-muted);
  margin-bottom: 32px;
  opacity: 0;
  animation: fadeUp 0.8s var(--ease-out-expo) 0.2s forwards;
}

.hero-label-line {
  display: block;
  width: 48px;
  height: 1px;
  background: var(--fg-faint);
}

.hero-name {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(4rem, 12vw, 9rem);
  line-height: 0.95;
  letter-spacing: -0.03em;
  margin-bottom: 48px;
}

.hero-line {
  display: block;
  overflow: hidden;
}

.hero-word {
  display: inline-block;
  opacity: 0;
  transform: translateY(100%);
  animation: heroReveal 1s var(--ease-out-expo) forwards;
}

.hero-line:nth-child(1) .hero-word {
  animation-delay: 0.4s;
}

.hero-line:nth-child(2) .hero-word {
  animation-delay: 0.55s;
}

.hero-line:nth-child(2) {
  padding-left: clamp(40px, 8vw, 120px);
}

.hero-name .accent-dot {
  font-size: 1.2em;
}

.hero-bottom {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 40px;
  opacity: 0;
  animation: fadeUp 0.8s var(--ease-out-expo) 0.9s forwards;
}

.hero-tagline {
  max-width: 400px;
  font-size: 1.0625rem;
  color: var(--fg-muted);
  line-height: 1.65;
}

.hero-cta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 500;
  font-size: 0.875rem;
  letter-spacing: 0.02em;
  color: var(--fg-muted);
  flex-shrink: 0;
  transition: color 0.3s;
}

.hero-cta:hover {
  color: var(--fg);
}

.hero-cta-arrow {
  transition: transform 0.3s var(--ease-out-expo);
}

.hero-cta:hover .hero-cta-arrow {
  transform: translateY(4px);
}

.hero-scroll-hint {
  position: absolute;
  bottom: 40px;
  left: 40px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--fg-faint);
  opacity: 0;
  animation: fadeUp 0.6s var(--ease-out-expo) 1.3s forwards;
}

.hero-scroll-track {
  width: 1px;
  height: 48px;
  background: var(--fg-faint);
  border-radius: 1px;
  overflow: hidden;
  position: relative;
}

.hero-scroll-thumb {
  width: 100%;
  height: 16px;
  background: var(--fg);
  border-radius: 1px;
  animation: scrollPulse 2s ease-in-out infinite;
}

/* ===== Section Header ===== */
.section-header {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 40px;
  margin-bottom: 72px;
  position: relative;
}

.section-number {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--fg-faint);
  display: block;
  margin-bottom: 12px;
}

.section-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.section-title em {
  font-style: italic;
  color: var(--accent);
}

/* ===== Case Studies ===== */
.work {
  padding: 140px 0;
}

.case-studies {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 40px;
  display: flex;
  flex-direction: column;
  gap: 120px;
}

.case-study-inner {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 48px;
  align-items: center;
  cursor: pointer;
}

.case-study:nth-child(even) .case-study-inner {
  grid-template-columns: 1fr 1.2fr;
}

.case-study:nth-child(even) .case-study-image {
  order: 2;
}

.case-study:nth-child(even) .case-study-content {
  order: 1;
}

.case-study-image {
  position: relative;
}

.case-study-image-wrap {
  overflow: hidden;
  border-radius: 4px;
}

.case-study-image-wrap img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  transition: transform 0.7s var(--ease-out-expo);
}

.case-study-inner:hover .case-study-image-wrap img {
  transform: scale(1.04);
}

.case-study-number {
  position: absolute;
  top: -20px;
  left: -20px;
  font-family: var(--serif);
  font-size: 6rem;
  line-height: 1;
  color: var(--bg);
  opacity: 0.7;
  z-index: -1;
  letter-spacing: -0.04em;
  -webkit-text-stroke: 1px var(--fg-faint);
  text-stroke: 1px var(--fg-faint);
  color: transparent;
}

.case-study-tag {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 12px;
  padding: 4px 12px;
  border: 1px solid var(--accent-light);
  border-radius: 100px;
}

.case-study-content h3 {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 400;
  line-height: 1.2;
  margin-bottom: 16px;
  letter-spacing: -0.01em;
}

.case-study-content h3 em {
  font-style: italic;
}

.case-study-content p {
  color: var(--fg-muted);
  font-size: 0.9375rem;
  margin-bottom: 24px;
  max-width: 420px;
}

.case-study-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
  font-size: 0.875rem;
  color: var(--fg);
  position: relative;
}

.case-study-link::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 1px;
  background: var(--fg);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.4s var(--ease-out-expo);
}

.case-study-inner:hover .case-study-link::after {
  transform: scaleX(1);
  transform-origin: left;
}

.case-study-link svg {
  transition: transform 0.3s var(--ease-out-expo);
}

.case-study-inner:hover .case-study-link svg {
  transform: translate(3px, -3px);
}

/* ===== About ===== */
.about {
  padding: 140px 0;
  background: var(--fg);
  color: var(--bg);
  position: relative;
}

.about .section-number {
  color: var(--fg-faint);
}

.about .section-title em {
  color: var(--accent-light);
}

.about-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 40px;
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 80px;
  align-items: start;
}

.about-photo {
  overflow: hidden;
  border-radius: 4px;
}

.about-photo img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}

.about-links {
  display: flex;
  gap: 16px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.about-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 8px 16px;
  border: 1px solid rgba(250, 249, 246, 0.2);
  border-radius: 100px;
  transition: border-color 0.3s, background 0.3s;
}

.about-link:hover {
  border-color: rgba(250, 249, 246, 0.5);
  background: rgba(250, 249, 246, 0.06);
}

.about-link svg {
  opacity: 0.5;
  transition: opacity 0.3s, transform 0.3s var(--ease-out-expo);
}

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

.about-text {
  padding-top: 24px;
}

.about-lead {
  font-family: var(--serif);
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin-bottom: 32px;
  color: var(--bg);
}

.about-text p {
  color: rgba(250, 249, 246, 0.6);
  font-size: 1rem;
  line-height: 1.75;
  margin-bottom: 20px;
}

.about-text p.about-lead {
  color: var(--bg);
}

/* ===== Footer ===== */
.footer {
  padding: 80px 40px 40px;
  background: var(--bg);
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
}

.footer-cta {
  margin-bottom: 80px;
}

.footer-label {
  font-size: 0.8125rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--fg-muted);
  margin-bottom: 16px;
}

.footer-email {
  font-family: var(--serif);
  font-size: clamp(2rem, 5vw, 3.5rem);
  letter-spacing: -0.02em;
  position: relative;
  display: inline-block;
}

.footer-email::after {
  content: "";
  position: absolute;
  bottom: 2px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.5s var(--ease-out-expo);
}

.footer-email:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  padding-top: 24px;
  border-top: 1px solid rgba(26, 25, 23, 0.1);
  font-size: 0.75rem;
  color: var(--fg-faint);
  letter-spacing: 0.02em;
}

/* ===== Reveal Animations ===== */
@keyframes heroReveal {
  from {
    opacity: 0;
    transform: translateY(100%);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scrollPulse {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(32px); }
}

[data-reveal] {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.9s var(--ease-out-quart), transform 0.9s var(--ease-out-quart);
}

[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .nav {
    padding: 20px 24px;
  }

  .hero {
    padding: 100px 24px 48px;
  }

  .hero-line:nth-child(2) {
    padding-left: 32px;
  }

  .hero-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 32px;
  }

  .hero-scroll-hint {
    display: none;
  }

  .section-header {
    padding: 0 24px;
    margin-bottom: 48px;
  }

  .case-studies {
    padding: 0 24px;
    gap: 80px;
  }

  .case-study-inner {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .case-study:nth-child(even) .case-study-inner {
    grid-template-columns: 1fr;
  }

  .case-study:nth-child(even) .case-study-image {
    order: 0;
  }

  .case-study:nth-child(even) .case-study-content {
    order: 0;
  }

  .case-study-number {
    font-size: 4rem;
    top: -12px;
    left: -8px;
  }

  .about-content {
    grid-template-columns: 1fr;
    padding: 0 24px;
    gap: 40px;
  }

  .about-photo img {
    aspect-ratio: 4 / 3;
  }

  .work {
    padding: 100px 0;
  }

  .about {
    padding: 100px 0;
  }

  .footer {
    padding: 60px 24px 32px;
  }
}

@media (max-width: 480px) {
  .nav-links {
    gap: 20px;
  }

  .hero-name {
    margin-bottom: 32px;
  }

  .case-study-content p {
    font-size: 0.875rem;
  }
}
