/* =================================================================
   THE STUDIO GATO — SHARED STYLES
   All pages import this file. Edit once, updates everywhere.
   ================================================================= */

/* =================================================================
   RESET & DESIGN TOKENS
   ================================================================= */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
:root {
  --bg: #F4F1EA;
  --ink: #141414;
  --muted: #8A8780;
  --rule: rgba(20,20,20,0.09);
  --rule-solid: #E0DDD6;
  --g1: #1EBDA5;        /* Gradient stop 1 — teal */
  --g2: #D96E07;        /* Gradient stop 2 — burnt orange */
  --g3: #FEDB44;        /* Gradient stop 3 — warm yellow */
  --serif: 'Fraunces', Georgia, serif;
  --sans: 'Inter', system-ui, sans-serif;
  --mono: 'JetBrains Mono', 'SF Mono', monospace;
  --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
  --container: 1320px;
  --gutter: 80px;
}
body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  background-image: radial-gradient(rgba(20,20,20,0.012) 1px, transparent 1px);
  background-size: 3px 3px;
  overflow-x: hidden;
  cursor: none;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
::selection { background: var(--g2); color: var(--bg); }

/* =================================================================
   PAGE LOADER
   ================================================================= */
.page-loader {
  position: fixed; inset: 0; z-index: 99999;
  background: var(--ink);
  display: flex; align-items: center; justify-content: center;
  transition: opacity .6s var(--ease), visibility .6s;
}
.page-loader.done { opacity: 0; visibility: hidden; pointer-events: none; }
.loader-content {
  display: flex; flex-direction: column; align-items: center; gap: 20px;
}
/* TODO: Replace src with your actual logo path */
.loader-logo {
  width: 64px; height: 64px;
  border-radius: 50%;
  object-fit: cover;
  opacity: 0;
  animation: logoEntry .6s var(--ease) .2s forwards, logoPulse 2s ease-in-out .8s infinite;
}
.loader-wordmark {
  font-family: var(--serif); font-weight: 300;
  font-size: clamp(20px, 4vw, 32px);
  letter-spacing: -.02em; color: var(--bg); opacity: 0;
  animation: loaderFade .5s var(--ease) .6s forwards;
}
.loader-wordmark em { font-style: italic; }
@keyframes logoEntry {
  0% { opacity: 0; transform: scale(0.5) rotate(-10deg); }
  100% { opacity: 1; transform: scale(1) rotate(0deg); }
}
@keyframes logoPulse {
  0%, 100% { transform: scale(1); filter: brightness(1); }
  50% { transform: scale(1.08); filter: brightness(1.2); }
}
@keyframes loaderFade {
  0% { opacity: 0; transform: translateY(8px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* =================================================================
   CUSTOM CURSOR
   ================================================================= */
.cursor {
  position: fixed; width: 20px; height: 20px;
  border: 1.5px solid var(--ink); border-radius: 50%;
  pointer-events: none; z-index: 9998;
  transform: translate(-50%, -50%);
  transition: width .35s var(--ease), height .35s var(--ease),
              background .35s var(--ease), border-color .35s var(--ease), opacity .2s;
  mix-blend-mode: exclusion; background: transparent;
}
.cursor.active {
  width: 56px; height: 56px;
  background: linear-gradient(135deg, var(--g1), var(--g2) 55%, var(--g3));
  border-color: transparent; mix-blend-mode: normal; opacity: .85;
}
.cursor-label {
  position: fixed; pointer-events: none; z-index: 9999;
  transform: translate(-50%, -50%);
  font-family: var(--mono); font-size: 8px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--ink);
  opacity: 0; transition: opacity .25s;
}
.cursor-label.visible { opacity: 1; }

/* =================================================================
   LAYOUT HELPERS
   ================================================================= */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
  position: relative;
}
.mono {
  font-family: var(--mono); font-size: 10px;
  letter-spacing: .08em; text-transform: uppercase; font-weight: 400;
}
.muted { color: var(--muted); }
.gradient-text {
  background: linear-gradient(135deg, var(--g1), var(--g2) 55%, var(--g3));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; font-style: italic;
}

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

/* =================================================================
   TOP BAR
   ================================================================= */
.top-bar-wrap { padding-top: 24px; position: relative; z-index: 100; }
.top-bar { display: flex; justify-content: space-between; align-items: center; }
.status-dot {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--g1); margin-right: 6px; vertical-align: middle;
  animation: statusPulse 3s ease-in-out infinite;
}
@keyframes statusPulse { 0%,100%{opacity:1} 50%{opacity:.4} }

/* =================================================================
   NAVIGATION
   ================================================================= */
.nav {
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px 0 32px; margin-top: 20px;
  border-bottom: 1px solid var(--rule);
  position: relative; z-index: 100;
}
.wordmark {
  font-family: var(--serif); font-weight: 400; font-size: 22px;
  letter-spacing: -.02em; display: flex; align-items: center; gap: 8px;
}
/* TODO: Replace with your actual logo image */
.wordmark .logo-icon {
  width: 28px; height: 28px; border-radius: 50%;
  object-fit: cover; flex-shrink: 0;
}
.wordmark em { font-style: italic; font-weight: 300; }
.nav-links { display: flex; gap: 28px; }
.nav-links a {
  font-family: var(--mono); font-size: 11px;
  letter-spacing: .1em; text-transform: uppercase;
  position: relative; padding-bottom: 2px;
}
.nav-links a::after {
  content: ''; position: absolute; left: 0; bottom: 0;
  width: 0; height: 1px; background: var(--ink);
  transition: width .3s var(--ease);
}
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }
.nav-cta {
  font-family: var(--mono); font-size: 11px;
  letter-spacing: .1em; text-transform: uppercase;
  padding: 9px 16px; border: 1px solid var(--ink);
  border-radius: 999px; display: inline-flex; align-items: center; gap: 8px;
  transition: background .3s var(--ease), color .3s var(--ease), transform .2s var(--ease);
}
.nav-cta:hover { background: var(--ink); color: var(--bg); }
.nav-cta:hover .cta-arrow { background: var(--bg); color: var(--ink); }
.nav-cta:active { transform: scale(.97); }
.cta-arrow {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--ink); color: var(--bg); font-size: 10px;
  transition: background .3s var(--ease), color .3s var(--ease);
}

/* Mobile menu toggle */
.menu-toggle {
  display: none; width: 32px; height: 32px;
  border: 1px solid var(--rule); border-radius: 50%;
  background: transparent; cursor: pointer; position: relative; flex-shrink: 0;
  transition: border-color .3s;
}
.menu-toggle:hover { border-color: var(--ink); }
.menu-toggle span {
  position: absolute; left: 8px; width: 16px; height: 1.5px;
  background: var(--ink); transition: all .3s var(--ease);
}
.menu-toggle span:nth-child(1) { top: 11px; }
.menu-toggle span:nth-child(2) { top: 16px; }
.menu-toggle span:nth-child(3) { top: 21px; }
.menu-toggle.open span:nth-child(1) { top: 16px; transform: rotate(45deg); }
.menu-toggle.open span:nth-child(2) { opacity: 0; }
.menu-toggle.open span:nth-child(3) { top: 16px; transform: rotate(-45deg); }

/* Full screen mobile menu */
.mobile-menu {
  position: fixed; inset: 0; z-index: 99;
  background: var(--bg);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 32px;
  opacity: 0; visibility: hidden;
  transition: opacity .4s var(--ease), visibility .4s;
}
.mobile-menu.open { opacity: 1; visibility: visible; }
.mobile-menu a {
  font-family: var(--serif); font-size: clamp(28px, 8vw, 48px);
  font-weight: 300; letter-spacing: -.02em; transition: opacity .3s;
}
.mobile-menu a em { font-style: italic; }
.mobile-menu a:hover { opacity: .5; }
.mobile-menu .mobile-cta {
  font-family: var(--mono); font-size: 12px; letter-spacing: .1em;
  text-transform: uppercase; padding: 12px 20px;
  border: 1px solid var(--ink); border-radius: 999px; margin-top: 20px;
}

/* =================================================================
   SECTION HEAD — reused across pages
   ================================================================= */
.section-head {
  display: grid; grid-template-columns: 1fr 1fr;
  margin-bottom: 60px; align-items: end; gap: 40px;
}
.section-head h2 {
  font-family: var(--serif); font-weight: 300;
  font-size: clamp(34px, 5vw, 60px);
  line-height: 1; letter-spacing: -.025em;
}
.section-head h2 em { font-style: italic; font-weight: 300; }
.section-head .aside {
  font-size: 14px; line-height: 1.55; color: var(--muted);
  max-width: 380px; justify-self: end;
}

/* =================================================================
   FOOTER
   ================================================================= */
.footer { padding: 80px 0 40px; border-top: 1px solid var(--rule); }
.footer-top {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px; margin-bottom: 80px;
}
.footer h4 {
  font-family: var(--mono); font-size: 10px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted);
  margin: 0 0 20px; font-weight: 400;
}
.big-email {
  font-family: var(--serif); font-weight: 300;
  font-size: clamp(24px, 4vw, 52px); line-height: .95;
  letter-spacing: -.025em; transition: opacity .3s;
}
.big-email:hover { opacity: .7; }
.footer ul { list-style: none; }
.footer li { font-size: 13px; line-height: 2; }
.footer li a { transition: opacity .3s; }
.footer li a:hover { opacity: .5; }
.footer .studio-address { font-size: 12px; line-height: 1.6; color: var(--muted); margin-top: 8px; }
.footer-bottom {
  display: flex; justify-content: space-between;
  padding-top: 24px; border-top: 1px solid var(--rule);
}

/* Back to top */
.back-to-top {
  position: fixed; bottom: 32px; right: 32px; z-index: 90;
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--rule); background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 14px; color: var(--ink);
  cursor: pointer; opacity: 0; visibility: hidden;
  transition: all .4s var(--ease);
  box-shadow: 0 2px 20px rgba(20,20,20,0.06);
}
.back-to-top.visible { opacity: 1; visibility: visible; }
.back-to-top:hover {
  background: var(--ink); color: var(--bg); border-color: var(--ink);
  transform: translateY(-2px);
}

/* =================================================================
   BREATHING GRADIENT TILES — used on case studies
   ================================================================= */
.grad-base { position: relative; overflow: hidden; }
.orb {
  position: absolute; border-radius: 50%; z-index: 1;
  pointer-events: none; will-change: transform, opacity;
}
@keyframes pA {
  0%{opacity:.2;transform:scale(1) translate(0,0)}
  50%{opacity:1;transform:scale(1.3) translate(6%,10%)}
  100%{opacity:.2;transform:scale(1) translate(0,0)}
}
@keyframes pB {
  0%{opacity:.15;transform:scale(1) translate(0,0)}
  50%{opacity:.9;transform:scale(1.25) translate(-8%,-6%)}
  100%{opacity:.15;transform:scale(1) translate(0,0)}
}
@keyframes pC {
  0%{opacity:.2;transform:scale(1) translate(0,0) rotate(0deg)}
  50%{opacity:.85;transform:scale(1.2) translate(5%,-8%) rotate(10deg)}
  100%{opacity:.2;transform:scale(1) translate(0,0) rotate(0deg)}
}

/* Gradient 1 — Brand: Teal / Orange / Yellow */
.grad-1{background:linear-gradient(135deg,#1EBDA5 0%,#D96E07 55%,#FEDB44 100%)}
.grad-1 .orb-a{width:75%;height:85%;background:radial-gradient(ellipse,rgba(30,189,165,.7) 0%,transparent 65%);top:-25%;left:-15%;animation:pA 7s ease-in-out infinite}
.grad-1 .orb-b{width:60%;height:70%;background:radial-gradient(ellipse,rgba(254,219,68,.6) 0%,transparent 60%);bottom:-20%;right:-10%;animation:pB 7s ease-in-out infinite 3.5s}
.grad-1 .orb-c{width:45%;height:50%;background:radial-gradient(ellipse,rgba(217,110,7,.4) 0%,transparent 55%);top:25%;left:35%;animation:pA 9s ease-in-out infinite 1.5s}

/* Gradient 2 — Ocean: Navy / Teal / Cyan */
.grad-2{background:linear-gradient(150deg,#0A1628 0%,#0E3B5C 50%,#1A6B7A 100%)}
.grad-2 .orb-a{width:70%;height:80%;background:radial-gradient(ellipse,rgba(26,107,122,.7) 0%,transparent 65%);top:-20%;right:-10%;animation:pA 8s ease-in-out infinite .5s}
.grad-2 .orb-b{width:55%;height:65%;background:radial-gradient(ellipse,rgba(30,189,165,.4) 0%,transparent 60%);bottom:-15%;left:-10%;animation:pB 9s ease-in-out infinite 2s}
.grad-2 .orb-c{width:40%;height:45%;background:radial-gradient(ellipse,rgba(80,180,200,.35) 0%,transparent 55%);top:30%;left:25%;animation:pC 11s ease-in-out infinite 4s}

/* Gradient 3 — Sand: Cream / Blush / Terracotta */
.grad-3{background:linear-gradient(135deg,#F2E6D0 0%,#E8C9A8 45%,#C49470 100%)}
.grad-3 .orb-a{width:65%;height:75%;background:radial-gradient(ellipse,rgba(196,148,112,.5) 0%,transparent 65%);top:-15%;left:-10%;animation:pA 9s ease-in-out infinite 1s}
.grad-3 .orb-b{width:55%;height:60%;background:radial-gradient(ellipse,rgba(242,230,208,.7) 0%,transparent 55%);bottom:-20%;right:-15%;animation:pB 7.5s ease-in-out infinite 3s}
.grad-3 .orb-c{width:40%;height:40%;background:radial-gradient(ellipse,rgba(200,160,120,.35) 0%,transparent 55%);top:35%;left:40%;animation:pC 10s ease-in-out infinite 2s}

/* Gradient 4 — Rose: Plum / Midnight */
.grad-4{background:linear-gradient(140deg,#D4908A 0%,#8A3D5C 50%,#2A1B2E 100%)}
.grad-4 .orb-a{width:70%;height:80%;background:radial-gradient(ellipse,rgba(212,144,138,.6) 0%,transparent 65%);top:-20%;left:-10%;animation:pB 8.5s ease-in-out infinite .8s}
.grad-4 .orb-b{width:50%;height:60%;background:radial-gradient(ellipse,rgba(138,61,92,.5) 0%,transparent 55%);bottom:-15%;right:-5%;animation:pA 10s ease-in-out infinite 4s}
.grad-4 .orb-c{width:45%;height:50%;background:radial-gradient(ellipse,rgba(180,120,140,.35) 0%,transparent 50%);top:20%;right:15%;animation:pC 7s ease-in-out infinite 2.5s}

/* Gradient 5 — Forest: Moss / Sage */
.grad-5{background:linear-gradient(130deg,#1A2F1F 0%,#3D5C3A 45%,#8B9E6B 100%)}
.grad-5 .orb-a{width:65%;height:75%;background:radial-gradient(ellipse,rgba(139,158,107,.6) 0%,transparent 65%);top:-20%;right:-10%;animation:pA 9.5s ease-in-out infinite 1.2s}
.grad-5 .orb-b{width:55%;height:65%;background:radial-gradient(ellipse,rgba(61,92,58,.5) 0%,transparent 55%);bottom:-20%;left:-10%;animation:pB 8s ease-in-out infinite 3.5s}
.grad-5 .orb-c{width:40%;height:40%;background:radial-gradient(ellipse,rgba(100,130,80,.3) 0%,transparent 55%);top:40%;left:30%;animation:pC 11s ease-in-out infinite 5s}

/* Gradient 6 — Amber: Gold / Copper */
.grad-6{background:linear-gradient(135deg,#F5C97A 0%,#C47A30 50%,#7A3E12 100%)}
.grad-6 .orb-a{width:70%;height:80%;background:radial-gradient(ellipse,rgba(245,201,122,.6) 0%,transparent 65%);top:-20%;left:-10%;animation:pA 8s ease-in-out infinite .3s}
.grad-6 .orb-b{width:55%;height:65%;background:radial-gradient(ellipse,rgba(122,62,18,.5) 0%,transparent 60%);bottom:-15%;right:-10%;animation:pB 9.5s ease-in-out infinite 2.5s}
.grad-6 .orb-c{width:40%;height:45%;background:radial-gradient(ellipse,rgba(196,122,48,.4) 0%,transparent 55%);top:30%;left:30%;animation:pC 10s ease-in-out infinite 4.5s}

/* =================================================================
   CASE TILE COMPONENT — reused on home and services
   ================================================================= */
.case-tile { display: flex; flex-direction: column; gap: 0; cursor: pointer; }
.case-top-meta { display: flex; justify-content: space-between; margin-bottom: 8px; color: var(--muted); }
.case-image {
  border-radius: 3px; position: relative; overflow: hidden;
  transition: transform .6s var(--ease);
}
.case-tile:hover .case-image { transform: scale(1.015); }
.case-tile .case-image { aspect-ratio: 4/3; }
.case-tile.wide .case-image { aspect-ratio: 16/9; }
.case-tile.tall .case-image { aspect-ratio: 3/4; }
.case-name {
  position: absolute; left: 28px; bottom: 28px;
  font-family: var(--serif); font-weight: 300; font-size: 30px;
  letter-spacing: -.02em; line-height: .95; z-index: 5;
  transition: transform .4s var(--ease);
}
.case-name em { font-style: italic; }
.case-tile:hover .case-name { transform: translateY(-4px); }
.case-name.light { color: var(--bg); }
.case-name.dark { color: var(--ink); }
.case-caption { padding-top: 16px; }
.case-caption p { font-size: 14px; line-height: 1.5; margin: 0 0 12px; }
.case-caption-footer { display: flex; justify-content: space-between; align-items: baseline; }
.case-tags { display: flex; gap: 4px; font-size: 13px; color: var(--muted); }
.case-metric {
  font-family: var(--mono); font-size: 10px; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted);
  display: flex; align-items: baseline; gap: 6px;
}
.case-metric strong {
  font-family: var(--serif); font-style: italic; font-weight: 400;
  font-size: 16px; letter-spacing: -.01em; color: var(--ink); text-transform: none;
}

/* Grid spans */
.span-4 { grid-column: span 4; }
.span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; }
.span-7 { grid-column: span 7; }

/* =================================================================
   RESPONSIVE — 1100px
   ================================================================= */
@media(max-width:1100px) {
  :root { --gutter: 48px; }
}

/* =================================================================
   RESPONSIVE — 900px (tablet)
   ================================================================= */
@media(max-width:900px) {
  :root { --gutter: 32px; }
  .cursor, .cursor-label { display: none; }
  body { cursor: auto; }
  .top-bar { flex-direction: row; }
  .nav-links { display: none; }
  .nav-cta { display: none; }
  .menu-toggle { display: flex; }
  .wordmark { font-size: 19px; }
  .section-head { grid-template-columns: 1fr; gap: 20px; }
  .section-head h2 { font-size: clamp(28px, 7vw, 44px); }
  .section-head .aside { justify-self: start; max-width: 100%; }
  .span-4, .span-5, .span-6, .span-7 { grid-column: span 6; }
  .footer-top { grid-template-columns: 1fr 1fr; gap: 32px; }
  .big-email { font-size: clamp(20px, 5vw, 36px); }
  .footer-bottom { flex-direction: column; gap: 8px; }
  .back-to-top { bottom: 20px; right: 20px; width: 40px; height: 40px; }
}

/* =================================================================
   RESPONSIVE — 640px (large phone)
   ================================================================= */
@media(max-width:640px) {
  :root { --gutter: 20px; }
  .top-bar .mono { font-size: 9px; }
  .section-head h2 { font-size: clamp(26px, 8vw, 36px); }
  .span-4, .span-5, .span-6, .span-7 { grid-column: span 12; }
  .case-name { font-size: 24px; left: 20px; bottom: 20px; }
  .footer-top { grid-template-columns: 1fr; gap: 28px; }
  .mobile-menu a { font-size: clamp(28px, 9vw, 44px); }
}

/* =================================================================
   RESPONSIVE — 380px (small phone)
   ================================================================= */
@media(max-width:380px) {
  :root { --gutter: 16px; }
  .wordmark { font-size: 17px; }
  .wordmark .logo-icon { width: 22px; height: 22px; }
  .case-name { font-size: 20px; left: 16px; bottom: 16px; }
  .big-email { font-size: clamp(18px, 6vw, 28px); }
  .footer h4 { font-size: 9px; }
  .footer li { font-size: 12px; }
  .footer-bottom .mono { font-size: 8px; }
  .back-to-top { bottom: 16px; right: 16px; width: 36px; height: 36px; }
}