@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Inter+Tight:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg: #0a0a0a;
  --bg-warm: #f5f1ea;
  --bg-card: #141414;
  --bg-soft: #1a1a1a;
  --text: #f5f1ea;
  --text-dark: #0a0a0a;
  --text-dim: rgba(245,241,234,0.6);
  --text-dim-dark: rgba(10,10,10,0.6);
  --accent: #ff5b1f;
  --accent-soft: rgba(255,91,31,0.1);
  --green: #00d97e;
  --blue: #5b8def;
  --yellow: #ffd60a;
  --border: rgba(245,241,234,0.1);
  --border-dark: rgba(10,10,10,0.1);
  --serif: 'Instrument Serif', serif;
  --sans: 'Inter Tight', sans-serif;
  --mono: 'JetBrains Mono', monospace;
  --ease: cubic-bezier(0.65, 0, 0.35, 1);
  --transition: all 0.6s cubic-bezier(0.65, 0, 0.35, 1);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

.container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 60px;
}

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

/* ==== PAGE TRANSITION OVERLAY ==== */
.page-transition {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100vh;
  background: var(--accent);
  z-index: 9999;
  transform: translateY(100%);
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
.page-transition.active {
  animation: slideUp 1.2s var(--ease) forwards;
}
.page-transition.exit {
  animation: slideDown 1.2s var(--ease) forwards;
}
.page-transition-text {
  font-family: var(--serif);
  font-size: 8rem;
  font-style: italic;
  color: white;
  opacity: 0;
  animation: fadeIn 0.4s 0.4s var(--ease) forwards;
}
@keyframes slideUp {
  0% { transform: translateY(100%); }
  50% { transform: translateY(0); }
  100% { transform: translateY(-100%); }
}
@keyframes slideDown {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(100%); }
}
@keyframes fadeIn {
  to { opacity: 1; }
}

/* ==== NAVIGATION ==== */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 24px 0;
  mix-blend-mode: difference;
  transition: var(--transition);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 60px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.05em;
  color: white;
  z-index: 101;
}
.logo-mark {
  width: 28px;
  height: 28px;
  background: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: white;
}
.nav {
  display: flex;
  gap: 48px;
  align-items: center;
}
.nav a {
  font-size: 0.85rem;
  font-weight: 400;
  color: white;
  letter-spacing: 0.02em;
  position: relative;
  transition: var(--transition);
}
.nav a::before {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 0.4s var(--ease);
}
.nav a:hover::before,
.nav a.active::before {
  width: 100%;
}
.nav a .num {
  font-family: var(--mono);
  font-size: 0.65rem;
  opacity: 0.5;
  margin-right: 6px;
}

.menu-btn {
  display: none;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  z-index: 101;
}
.menu-btn span {
  display: block;
  width: 28px;
  height: 1px;
  background: white;
  transition: var(--transition);
}

/* ==== SECTION TITLES ==== */
.section {
  padding: 160px 0;
  position: relative;
}
.section-num {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  color: var(--accent);
  margin-bottom: 32px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.section-num::before {
  content: '';
  width: 40px;
  height: 1px;
  background: var(--accent);
}
.section-title {
  font-family: var(--serif);
  font-size: clamp(2.5rem, 6vw, 5.5rem);
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: -0.03em;
  margin-bottom: 32px;
}
.section-title em {
  font-style: italic;
  color: var(--accent);
}
.section-desc {
  font-size: 1.1rem;
  color: var(--text-dim);
  max-width: 600px;
  line-height: 1.6;
}

/* ==== HERO ==== */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 140px 0 80px;
  position: relative;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
}
.hero-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background: 
    radial-gradient(ellipse 80% 50% at 20% 40%, rgba(255,91,31,0.15), transparent),
    radial-gradient(ellipse 60% 40% at 80% 60%, rgba(91,141,239,0.1), transparent);
}
.hero-grid {
  position: absolute;
  inset: 0;
  background: 
    linear-gradient(rgba(245,241,234,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(245,241,234,0.02) 1px, transparent 1px);
  background-size: 80px 80px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, black 0%, transparent 80%);
}
.hero-content {
  position: relative;
  z-index: 1;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 60px;
  width: 100%;
}
.hero-label {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  color: var(--accent);
  margin-bottom: 40px;
  display: flex;
  align-items: center;
  gap: 16px;
  animation: slideUp 1s 0.2s var(--ease) backwards;
}
.hero-label::before {
  content: '';
  width: 40px;
  height: 1px;
  background: var(--accent);
}
.hero-title {
  font-family: var(--serif);
  font-size: clamp(3rem, 10vw, 9rem);
  font-weight: 400;
  line-height: 0.9;
  letter-spacing: -0.04em;
  margin-bottom: 48px;
}
.hero-title .line {
  display: block;
  overflow: hidden;
}
.hero-title .line span {
  display: inline-block;
  animation: textUp 1.2s var(--ease) backwards;
}
.hero-title .line:nth-child(1) span { animation-delay: 0.3s; }
.hero-title .line:nth-child(2) span { animation-delay: 0.45s; }
.hero-title .line:nth-child(3) span { animation-delay: 0.6s; }
.hero-title em {
  font-style: italic;
  color: var(--accent);
  position: relative;
}
.hero-title em::after {
  content: '';
  position: absolute;
  bottom: 0.1em;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--accent);
  opacity: 0.3;
}
@keyframes textUp {
  from { transform: translateY(110%); }
  to { transform: translateY(0); }
}
@keyframes slideUp {
  from { transform: translateY(40px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.hero-bottom {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 80px;
  align-items: end;
  margin-top: 80px;
  padding-top: 60px;
  border-top: 1px solid var(--border);
  animation: slideUp 1s 0.9s var(--ease) backwards;
}
.hero-desc {
  font-size: 1.1rem;
  line-height: 1.6;
  color: var(--text-dim);
  max-width: 500px;
}
.hero-cta {
  display: inline-flex;
  align-items: stretch;
  gap: 24px;
  justify-self: start;
  flex-wrap: wrap;
  margin-top: 4px;
}

/* ==== BUTTONS ==== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 32px;
  min-height: 64px;
  font-family: var(--sans);
  font-size: 0.92rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  cursor: pointer;
  border: 1.5px solid currentColor;
  background: transparent;
  color: var(--text);
  border-radius: 0;
  transition: color 0.45s var(--ease), background 0.45s var(--ease), border-color 0.45s var(--ease), box-shadow 0.45s var(--ease), transform 0.35s var(--ease);
  position: relative;
  text-transform: none;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  overflow: hidden;
  isolation: isolate;
  /* Magnetic pull via CSS variables - coexists with hover state */
  transform: translate(var(--mx, 0px), var(--my, 0px));
  will-change: transform;
}
.btn::before {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 0;
  background: var(--text);
  z-index: -1;
  transition: height 0.45s var(--ease);
}
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 1.5px solid var(--accent);
  transform: translate(6px, 6px);
  transition: transform 0.45s var(--ease), opacity 0.45s var(--ease);
  pointer-events: none;
  z-index: -1;
  opacity: 0.85;
}
.btn:hover {
  background: transparent;
  color: var(--bg);
  border-color: var(--text);
  box-shadow: 6px 6px 0 0 var(--accent);
}
.btn:hover::before { height: 100%; }
.btn:hover::after {
  transform: translate(2px, 2px);
  opacity: 1;
  border-color: var(--accent);
}
.btn:hover svg { transform: translateX(4px) rotate(0deg); }
.btn svg {
  width: 20px;
  height: 20px;
  transition: transform 0.45s var(--ease);
  flex-shrink: 0;
}
.btn .btn-label {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.btn .btn-num {
  font-family: var(--mono);
  font-size: 0.7rem;
  opacity: 0.55;
  letter-spacing: 0.15em;
  transition: opacity 0.45s var(--ease), transform 0.45s var(--ease);
  font-weight: 400;
}
.btn:hover .btn-num { opacity: 1; transform: translateX(2px); }

/* === Primary Button: solid filled with offset shadow === */
.btn-primary {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
  font-weight: 600;
  padding: 24px 36px;
  min-height: 64px;
}
.btn-primary::after {
  border-color: var(--accent);
  transform: translate(8px, 8px);
  opacity: 1;
}
.btn-primary::before {
  background: var(--accent);
  height: 0;
}
.btn-primary:hover {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
  box-shadow: 8px 8px 0 0 var(--text);
}
.btn-primary:hover::after {
  transform: translate(3px, 3px);
  border-color: var(--text);
}
.btn-primary:hover::before { height: 100%; }

/* Hero button group - refined layout */
.hero-cta .btn { flex: 0 0 auto; }

/* ==== MARQUEE ==== */
.marquee {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 32px 0;
  overflow: hidden;
  position: relative;
  background: var(--bg);
}
.marquee-track {
  display: flex;
  gap: 80px;
  animation: marquee 30s linear infinite;
  white-space: nowrap;
  font-family: var(--serif);
  font-size: 2.5rem;
  font-style: italic;
  align-items: center;
}
.marquee-track > * {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 80px;
}
.marquee-track span {
  color: var(--text);
}
.marquee-track .accent {
  color: var(--accent);
}
.marquee-track .dot {
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  display: inline-block;
}
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ==== FOOTER ==== */
.footer {
  background: var(--bg-warm);
  color: var(--text-dark);
  padding: 120px 0 40px;
  position: relative;
}
.footer-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 60px;
}
.footer-top {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  padding-bottom: 100px;
  border-bottom: 1px solid var(--border-dark);
}
.footer-cta h2 {
  font-family: var(--serif);
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  font-weight: 400;
  line-height: 1;
  margin-bottom: 32px;
}
.footer-cta h2 em { font-style: italic; color: var(--accent); }
.footer-cta p {
  font-size: 1.1rem;
  color: var(--text-dim-dark);
  margin-bottom: 40px;
  max-width: 480px;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 60px;
  padding: 60px 0;
  border-bottom: 1px solid var(--border-dark);
}
.footer-col h4 {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 24px;
  color: var(--accent);
}
.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.footer-col a {
  color: var(--text-dim-dark);
  font-size: 0.95rem;
  transition: var(--transition);
}
.footer-col a:hover { color: var(--accent); }
.footer-col li {
  color: var(--text-dim-dark);
  font-size: 0.95rem;
}
.footer-bottom {
  padding-top: 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-dim-dark);
  letter-spacing: 0.05em;
}

/* ==== SCROLL ANIMATIONS ==== */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 1s var(--ease), transform 1s var(--ease);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

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

/* Tablet & Small Desktop (≤1024px) */
@media (max-width: 1024px) {
  .container { padding: 0 32px; }
  .header-inner, .footer-inner { padding: 0 32px; }
  .section { padding: 100px 0; }
  .footer-grid { grid-template-columns: repeat(2, 1fr); gap: 40px; }
  .hero-content { padding: 0 32px; }
  .hero-title { font-size: clamp(2.75rem, 9vw, 5rem); }
  .hero-bottom { gap: 40px; }
}

/* Tablet Portrait (≤768px) */
@media (max-width: 768px) {
  html { font-size: 15px; }
  .container { padding: 0 20px; }
  .header-inner, .footer-inner { padding: 0 20px; }

  /* === MOBILE NAVIGATION === */
  .nav { display: none; }
  .menu-btn { display: flex; }
  .header { padding: 18px 0; }
  .logo { font-size: 0.85rem; }
  .logo-mark { width: 26px; height: 26px; }

  /* === MOBILE MENU OVERLAY === */
  .mobile-menu {
    position: fixed;
    inset: 0;
    background: var(--bg);
    z-index: 99;
    display: flex;
    flex-direction: column;
    padding: 100px 32px 40px;
    transform: translateY(-100%);
    transition: transform 0.6s var(--ease);
    overflow-y: auto;
  }
  .mobile-menu.open { transform: translateY(0); }
  .mobile-menu::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 100%;
    background: radial-gradient(ellipse 60% 50% at 50% 0%, rgba(255,91,31,0.1), transparent);
    pointer-events: none;
  }
  .mobile-menu-nav {
    display: flex;
    flex-direction: column;
    gap: 0;
    position: relative;
    z-index: 1;
  }
  .mobile-menu-nav a {
    font-family: var(--serif);
    font-size: 2.5rem;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: baseline;
    gap: 16px;
    transition: var(--transition);
    -webkit-tap-highlight-color: transparent;
  }
  .mobile-menu-nav a:active {
    color: var(--accent);
    padding-left: 8px;
  }
  .mobile-menu-nav a .num {
    font-family: var(--mono);
    font-size: 0.7rem;
    color: var(--accent);
    letter-spacing: 0.1em;
    flex-shrink: 0;
  }
  .mobile-menu-footer {
    margin-top: auto;
    padding-top: 40px;
    position: relative;
    z-index: 1;
  }
  .mobile-menu-footer-label {
    font-family: var(--mono);
    font-size: 0.7rem;
    letter-spacing: 0.15em;
    color: var(--accent);
    margin-bottom: 16px;
  }
  .mobile-menu-contact {
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: var(--text-dim);
    font-size: 0.95rem;
  }
  .mobile-menu-contact a {
    color: var(--text);
    font-family: var(--serif);
    font-size: 1.4rem;
    padding: 4px 0;
  }

  /* Hamburger animation */
  .menu-btn.active span:nth-child(1) {
    transform: translateY(3.5px) rotate(45deg);
  }
  .menu-btn.active span:nth-child(2) {
    opacity: 0;
  }
  .menu-btn.active span:nth-child(3) {
    transform: translateY(-3.5px) rotate(-45deg);
  }

  /* === HERO === */
  .hero { padding: 110px 0 60px; }
  .hero-label {
    font-size: 0.65rem;
    margin-bottom: 24px;
    gap: 12px;
  }
  .hero-label::before { width: 24px; }
  .hero-title {
    font-size: clamp(2.5rem, 12vw, 4rem);
    margin-bottom: 32px;
  }
  .hero-title em::after { height: 3px; bottom: 0.05em; }
  .hero-bottom {
    grid-template-columns: 1fr;
    gap: 32px;
    margin-top: 40px;
    padding-top: 32px;
  }
  .hero-desc { font-size: 1rem; }
  .hero-cta {
    justify-self: stretch;
    flex-direction: column;
    width: 100%;
  }
  .hero-cta .btn {
    width: 100%;
    justify-content: center;
    padding: 16px 24px;
  }

  /* === SECTIONS === */
  .section { padding: 80px 0; }
  .section-num {
    font-size: 0.65rem;
    margin-bottom: 20px;
    gap: 12px;
  }
  .section-num::before { width: 24px; }
  .section-title {
    font-size: clamp(2rem, 8vw, 3rem);
    margin-bottom: 20px;
  }
  .section-desc { font-size: 1rem; }

  /* === MARQUEE === */
  .marquee { padding: 24px 0; }
  .marquee-track { font-size: 1.5rem; gap: 32px; }
  .marquee-track > * { gap: 32px; }

  /* === FOOTER === */
  .footer { padding: 60px 0 32px; }
  .footer-top {
    grid-template-columns: 1fr;
    gap: 40px;
    padding-bottom: 60px;
  }
  .footer-cta h2 { font-size: clamp(2rem, 8vw, 3rem); }
  .footer-cta p { font-size: 1rem; }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 40px 0;
  }
  .footer-col h4 { margin-bottom: 16px; }
  .footer-bottom {
    flex-direction: column;
    gap: 12px;
    text-align: center;
    padding-top: 24px;
  }

  /* === BUTTONS === */
  .btn {
    padding: 14px 24px;
    font-size: 0.85rem;
    -webkit-tap-highlight-color: transparent;
  }
  .btn:active { transform: scale(0.97); }
}

/* Mobile (≤480px) - extra small screens */
@media (max-width: 480px) {
  html { font-size: 14px; }
  .container { padding: 0 16px; }
  .header-inner, .footer-inner { padding: 0 16px; }
  .hero { padding: 100px 0 50px; }
  .hero-title { font-size: clamp(2.25rem, 13vw, 3.25rem); }
  .section { padding: 60px 0; }
  .marquee-track { font-size: 1.25rem; gap: 24px; }
  .marquee-track > * { gap: 24px; }
}

/* === TOUCH DEVICE OPTIMIZATIONS === */
@media (hover: none) and (pointer: coarse) {
  /* Disable hover-only effects on touch */
  .btn::before { display: none; }
  .btn:hover::before { transform: translateY(100%); }
  .work-item:hover { background: var(--bg); }
  .work-item:hover .work-visual-bg { transform: none; }
  .service-row:hover { padding-left: 0; }
  .service-row:hover::before { width: 0; }
  .reveal { transform: translateY(20px); }
}

/* === REDUCED MOTION === */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .hero-model { animation: none; }
  .hero-model-grid-bg { animation: none; }
  .hero-model-scan { animation: none; opacity: 0.5; }
}

/* === MOBILE FLOATING CTA === */
.mobile-floating-cta {
  display: none;
}

@media (max-width: 768px) {
  .mobile-floating-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 14px 20px;
    background: var(--accent);
    color: white;
    border-radius: 100px;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 8px 24px rgba(255, 91, 31, 0.4);
    z-index: 50;
    -webkit-tap-highlight-color: transparent;
    animation: ctaFloat 3s ease-in-out infinite;
  }
  .mobile-floating-cta svg {
    width: 18px;
    height: 18px;
  }
  .mobile-floating-cta:active {
    transform: scale(0.95);
  }
}

@keyframes ctaFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
