/* ============================================================
   SAIKAT DESIGN — CORE STYLESHEET
   A calm, editorial, AI-native product design system.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=Source+Sans+3:ital,wght@0,400;0,500;0,600;0,700;1,400&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Michroma&display=swap');

/* ---------- TOKENS ---------- */
:root{
  /* nav (real height set live by main.js; this is just the pre-JS fallback) */
  --nav-height: 73px;

  /* surfaces */
  --white:        #FDFCFA;
  --cream:        #F6F1E7;
  --gray-100:     #EFEDE6;
  --gray-200:     #E6E3DA;
  --border:       #DCD8CD;

  /* accents */
  --sky:          #a9dfff;
  --sky-deep:     #6E9BB8;
  --yellow:       #F0E2A3;
  --yellow-deep:  #B99B2E;
  --green-surface:#D2E4CB;
  --silver:       #C7C4BC;

  /* text */
  --ink:          #20211D;
  --ink-soft:     #55564E;
  --ink-faint:    #8B897E;

  /* cta */
  --green:        #4285f4;
  --green-hover:  #234F3A;
  --green-tint:   #E6EFE6;

  /* type */
  --font-display: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --font-body:    'Source Sans 3', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --font-mono:    'SFMono-Regular', 'SF Mono', 'Cascadia Code', 'Roboto Mono', Consolas, 'Liberation Mono', monospace;

  /* scale */
  --fs-h1: clamp(2.6rem, 3.2vw + 1.4rem, 5rem);
  --fs-h2: clamp(1.9rem, 1.6vw + 1.2rem, 2.9rem);
  --fs-h3: clamp(1.3rem, 0.8vw + 1rem, 1.7rem);
  --fs-body-lg: clamp(1.05rem, 0.3vw + 0.95rem, 1.25rem);
  --fs-body: 1rem;
  --fs-small: 0.875rem;
  --fs-eyebrow: 0.78rem;

  /* layout */
  --max: 1320px;
  --gutter: clamp(20px, 5vw, 64px);
  --radius-s: 8px;
  --radius-m: 14px;
  --radius-l: 22px;

  /* motion */
  --ease: cubic-bezier(.22,.61,.36,1);
  --dur-s: 220ms;
  --dur-m: 460ms;
  --dur-l: 820ms;
}

@media (prefers-reduced-motion: reduce){
  *{ animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

/* ---------- RESET ---------- */
*, *::before, *::after{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }
body{
  margin: 0;
  background: #ffffff;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img{ max-width: 100%; display: block; }
a{ color: #3367D6; text-decoration: none; }
ul{ list-style: none; margin: 0; padding: 0; }
button{ font: inherit; cursor: pointer; }
h1, h2, h3, h4{ font-family: var(--font-display); margin: 0; font-weight: 100; letter-spacing: -0.01em; color: var(--ink); }
p{ margin: 0; }
input{ font: inherit; }

/* visible focus states everywhere */
a:focus-visible, button:focus-visible, input:focus-visible, [tabindex]:focus-visible{
  outline: 2px solid var(--blue);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link{
  position: absolute; left: -999px; top: 0; background: var(--green); color: #fff;
  padding: 12px 18px; z-index: 999; border-radius: 0 0 8px 0;
}
.skip-link:focus{ left: 0; }

.michroma-regular {
  font-family: "Michroma", sans-serif;
  font-weight: 400;
  font-style: normal;
}

/* ---------- LAYOUT ---------- */
.container{
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.grid-12{
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: clamp(16px, 2vw, 28px);
}
section{ position: relative; }
.section{ padding: clamp(64px, 9vw, 128px) 0; }
.section-tight{ padding: clamp(40px, 5vw, 72px) 0; }

/* ---------- TYPE UTILITIES ---------- */
.eyebrow{
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-body); font-size: var(--fs-eyebrow);
  letter-spacing: 0.14em; text-transform: uppercase; font-weight: 600;
  color: var(--ink-soft);
}
.eyebrow::before{
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: #3367D6;
  flex-shrink: 0;
}
.h1{ font-size: var(--fs-h1); line-height: 1.05; }
.h2{ font-size: var(--fs-h2); line-height: 1.12; }
.h3{ font-size: var(--fs-h3); line-height: 1.25; }
.body-lg{ font-size: var(--fs-body-lg); color: var(--ink-soft); line-height: 1.65; }
.text-soft{ color: var(--ink-soft); }
.text-faint{ color: var(--ink-faint); }

/* ---------- BUTTONS ---------- */
.btn{
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 14px 26px; border-radius: 999px; font-weight: 600; font-size: 0.95rem;
  border: 1px solid transparent; transition: transform var(--dur-s) var(--ease), background var(--dur-s) var(--ease), box-shadow var(--dur-s) var(--ease), border-color var(--dur-s) var(--ease);
  white-space: nowrap;
}
.btn-primary{ background:#4285F4; color: #fff; }
.btn-primary:hover{ background: #3367D6; transform: translateY(-2px); box-shadow: 0 10px 24px -12px rgba(46,107,78,0.55); }
.btn-secondary{ background: transparent; color: var(--ink); border-color: var(--border); }
.btn-secondary:hover{ border-color: var(--ink); transform: translateY(-2px); }
.btn-ghost{ background: var(--cream); color: var(--ink); }
.btn-ghost:hover{ background: var(--gray-100); }
.btn-arrow{ transition: transform var(--dur-s) var(--ease); }
.btn:hover .btn-arrow{ transform: translateX(4px); }

/* ---------- NAV ---------- */
.nav{
  position: fixed; top: 0; left: 0; right: 0; z-index: 500;
  background: rgba(253,252,250,0.82);
  backdrop-filter: blur(14px) saturate(1.1);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur-m) var(--ease), padding var(--dur-m) var(--ease);
}
.nav.scrolled{ border-color: var(--border); }
.nav-inner{
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px var(--gutter);
  max-width: var(--max); margin: 0 auto;
  transition: padding var(--dur-m) var(--ease);
}
.nav.scrolled .nav-inner{ padding-top: 14px; padding-bottom: 14px; }
.logo{
  font-family: var(--font-display); font-weight: 800; font-size: 1.35rem; letter-spacing: 0.10em;
  display: flex; align-items: center; gap: 9px;
}
.logo-mark{
  width: 22px; height: 22px; flex-shrink: 0;
}
.nav-links{ display: flex; align-items: center; gap: 36px; }
.nav-links a{
  font-size: 0.94rem; font-weight: 500; color: var(--ink-soft);
  position: relative; padding: 4px 0;
  transition: color var(--dur-s) var(--ease);
}
.nav-links a:hover, .nav-links a.active{ color: var(--ink); }
.nav-links a.active::after{
  content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 2px; background: var(--green); border-radius: 2px;
}
.nav-cta{ display: flex; align-items: center; gap: 18px; }
.nav-toggle{
  display: none; flex-direction: column; gap: 5px; background: none; border: none; padding: 8px;
}
.nav-toggle span{ width: 22px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform var(--dur-s) var(--ease), opacity var(--dur-s) var(--ease); }

.mobile-menu{
  display: none;
  position: fixed; inset: 0; z-index: 490; background: var(--white);
  padding: 100px var(--gutter) 40px; flex-direction: column; gap: 28px;
  transform: translateY(-8px); opacity: 0; pointer-events: none;
  transition: transform var(--dur-m) var(--ease), opacity var(--dur-m) var(--ease);
}
.mobile-menu.open{ opacity: 1; transform: translateY(0); pointer-events: auto; }
.mobile-menu a{ font-family: var(--font-display); font-size: 1.6rem; font-weight: 600; }
.mobile-menu .btn{ align-self: flex-start; margin-top: 12px; }

/* ---------- FOOTER ---------- */
.footer{
  background: #e0fbff; border-top: 1px solid var(--border);
  padding: clamp(56px, 7vw, 96px) 0 32px;
}
.footer-top{
  display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 40px;
  padding-bottom: 48px; border-bottom: 1px solid var(--border);
}
.footer-brand p{ margin-top: 3px; max-width: 320px; color: var(--ink-soft); font-size: 0.95rem; }
.footer-heading{ font-size: var(--fs-eyebrow); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-faint); font-weight: 600; margin-bottom: 16px; }
.footer-col a{
  display: block; padding: 6px 0; color: var(--ink-soft); font-size: 0.95rem;
  transition: color var(--dur-s) var(--ease);
}
.footer-col a:hover{ color: var(--green); }
.footer-bottom{
  display: flex; align-items: center; justify-content: space-between; padding-top: 26px;
  font-size: 0.85rem; color: var(--ink-faint); flex-wrap: wrap; gap: 12px;
}
.footer-legal{ display: flex; gap: 20px; }
.footer-legal a:hover{ color: var(--ink); }

/* ---------- CARDS ---------- */
.card{
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-l);
  padding: clamp(22px, 2.4vw, 34px);
}
.surface-cream{ background: var(--cream); }
.surface-sky{ background: var(--sky); }
.surface-yellow{ background: var(--yellow); }
.surface-green{ background: var(--green-surface); }

/* ---------- METRIC STRIP ---------- */
.metrics{
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  background: var(--border);  border-radius: var(--radius-l); overflow: hidden;
}
.metric{
  background: #ffffff; padding: clamp(24px, 2.6vw, 38px) clamp(18px, 2vw, 28px);
}
.metric-value{ font-family: var(--font-display); font-size: clamp(1.8rem, 2vw, 2.6rem); font-weight: 600; color: #3367D6; }
.metric-label{ margin-top: 6px; font-size: 0.9rem; color: var(--ink-soft); }

/* ---------- PROJECT CARDS ---------- */
.work-grid{ display: grid; grid-template-columns: repeat(12, 1fr); gap: 28px; }
.project-card{
  grid-column: span 6;
  perspective: 1400px;
}
.project-card:nth-child(5){ grid-column: 3 / span 8; }
.project-card-inner{
  border: 1px solid var(--border); border-radius: var(--radius-l); overflow: hidden;
  background: var(--white);
  transform-style: preserve-3d;
  transition: transform var(--dur-m) var(--ease), box-shadow var(--dur-m) var(--ease), border-color var(--dur-m) var(--ease);
  will-change: transform;
}
.project-card:hover .project-card-inner, .project-card:focus-within .project-card-inner{
  box-shadow: 0 30px 60px -30px rgba(32,33,29,0.28);
  border-color: var(--ink-faint);
}
.project-media{
  aspect-ratio: 16/10.5; position: relative; overflow: hidden;
  transform: translateZ(20px);
}
.project-media .placeholder-art{ width: 100%; height: 100%; transition: transform var(--dur-l) var(--ease); }
.project-card:hover .placeholder-art{ transform: scale(1.035); }
.project-body{ padding: clamp(20px, 2.2vw, 30px); }
.project-meta-row{ display: flex; gap: 18px; margin-bottom: 14px; flex-wrap: wrap; }
.tag{
  font-size: 0.76rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink-soft); padding: 5px 11px; border-right: 1px solid var(--border); 
}
.tag-2{
  font-size: 0.76rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink-soft); padding: 5px 11px;
}
.project-title{ font-size: clamp(1.25rem, 1.2vw, 1.55rem); margin-bottom: 8px; }
.project-desc{ color: var(--ink-soft); font-size: 0.98rem; }
.project-footer{
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--border);
  font-size: 0.85rem; color: var(--ink-faint);
}
.project-link{ display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--ink); }
.project-link svg{ transition: transform var(--dur-s) var(--ease); }
.project-card:hover .project-link svg{ transform: translateX(4px); }

/* ---------- PLACEHOLDER ART SYSTEM ---------- */
.placeholder-art{
  position: relative; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(155deg, var(--cream), var(--white));
}
.placeholder-art::before{
  content: attr(data-label);
  position: absolute; bottom: 14px; left: 14px;
  font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 600;
  color: var(--ink-faint); background: rgba(253,252,250,0.75); padding: 5px 10px; border-radius: 6px;
  backdrop-filter: blur(6px);
}
.art-01{ background: linear-gradient(160deg, var(--sky) 0%, var(--white) 65%); }
.art-02{ background: linear-gradient(160deg, var(--yellow) 0%, var(--white) 65%); }
.art-03{ background: linear-gradient(160deg, var(--green-surface) 0%, var(--white) 65%); }
.art-04{ background: linear-gradient(160deg, var(--cream) 0%, var(--sky) 120%); }
.art-05{ background: linear-gradient(160deg, var(--gray-100) 0%, var(--yellow) 130%); }

/* dot / node texture, the brand signature */
.node-field{
  position: absolute; inset: 0; background-image: radial-gradient(var(--ink-faint) 1px, transparent 1.4px);
  background-size: 26px 26px; opacity: 0.14; pointer-events: none;
}

/* ---------- FLOW DIAGRAM (signature component) ---------- */
.flow{
  display: flex; align-items: center; gap: 0; flex-wrap: wrap;
  padding: 30px 10px;
}
.flow-node{
  display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; width: 130px;
}
.flow-dot{
  width: 14px; height: 14px; border-radius: 50%; background: var(--white); border: 2px solid var(--green);
  position: relative;
}
.flow-node.is-ai .flow-dot{ background: var(--green); }
.flow-label{ font-size: 0.82rem; font-weight: 600; color: var(--ink); }
.flow-sub{ font-size: 0.74rem; color: var(--ink-faint); }
.flow-line{
  flex: 1; min-width: 24px; height: 1px; background: repeating-linear-gradient(90deg, var(--ink-faint) 0 6px, transparent 6px 12px);
  margin-top: -22px;
}

/* ---------- SCROLL REVEAL ---------- */
.reveal{ opacity: 0; transform: translateY(26px); transition: opacity var(--dur-l) var(--ease), transform var(--dur-l) var(--ease); }
.reveal.is-visible{ opacity: 1; transform: translateY(0); }
.reveal-stagger > *{ transition-delay: calc(var(--i, 0) * 70ms); }

/* ---------- DIVIDERS ---------- */
.hr{ height: 1px; background: var(--border); border: none; margin: 0; }

/* ---------- HERO ---------- */
.hero{
  padding-top: clamp(150px, 16vw, 210px); padding-bottom: clamp(60px, 7vw, 100px);
}
.hero-grid{ display: grid; grid-template-columns: 1.05fr 1.05fr; gap: clamp(30px, 5vw, 70px); align-items: center; }
.hero-actions{ display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.hero-tags{ display: flex; gap: 10px; flex-wrap: wrap; margin-top: 30px; }
.hero-visual{
  position: relative; aspect-ratio: 1/1; border-radius: var(--radius-l);
  background: transparent;
  overflow: hidden;
}
.hero-orb{
  position: absolute; border-radius: 50%;
  filter: blur(0.5px);
}
.hero-visual .hero-orb.o1{ width: 46%; aspect-ratio:1/1; background: var(--green-surface); top: 10%; left: 8%; opacity: 0.85; }
.hero-visual .hero-orb.o2{ width: 30%; aspect-ratio:1/1; background: var(--yellow); bottom: 12%; right: 12%; opacity: 0.9; }
.hero-visual .hero-orb.o3{ width: 20%; aspect-ratio:1/1; background: var(--white); border: 1px solid var(--border); bottom: 30%; left: 20%; }
.hero-visual .flow-diagram-mini{ position: absolute; inset: 0; }

/* ---------- 3D TILT ---------- */
.tilt{ transform-style: preserve-3d; }

/* ---------- SECTION HEADER PATTERN ---------- */
.section-head{ max-width: 100%; margin-bottom: clamp(36px, 4vw, 56px); }
.section-head .h2{ margin-top: 14px; max-width: 860px; }

/* ---------- NDA GATE ---------- */
#nda-gate{
  min-height: 100vh;
  transition: opacity 520ms cubic-bezier(.5,0,.2,1), transform 520ms cubic-bezier(.5,0,.2,1);
}
.gate-shell{
  display: grid; grid-template-columns: 1.1fr 1fr; min-height: 100vh;
}
.gate-visual{
  position: relative; background: linear-gradient(150deg, var(--sky) 0%, var(--white) 70%, var(--cream) 100%);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px;
  border-right: 1px solid var(--border);
  padding: 40px;
}
.gate-mark{
  width: 84px; height: 84px; border-radius: 50%; background: var(--white); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 30px 60px -30px rgba(32,33,29,0.25);
}
.gate-caption{
  text-align: center; font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; color: var(--ink);
  line-height: 1.4;
}

.gate-caption span{ font-weight: 400; color: #2f96d8; font-size: 0.92rem; font-family: 'Michroma', sans-serif;}
.gate-panel{ display: flex; align-items: center; padding: clamp(28px, 5vw, 90px); }
.gate-panel-inner{ max-width: 420px; width: 100%; }
.gate-form{ margin-top: 30px; display: flex; flex-direction: column; gap: 18px; }
.field{ display: flex; flex-direction: column; gap: 7px; }
.field label{ font-size: 0.85rem; font-weight: 600; color: var(--ink-soft); }
.field input[type="text"], .field input[type="email"], .field input[type="password"]{
  padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-s);
  background: var(--white); color: var(--ink);
  transition: border-color var(--dur-s) var(--ease), box-shadow var(--dur-s) var(--ease);
}
.field input:focus{ border-color: var(--green); box-shadow: 0 0 0 3px var(--green-tint); outline: none; }
.field.has-error input{ border-color: #B5543F; }
.field-error{ font-size: 0.8rem; color: #B5543F; min-height: 1em; }
.field-checkbox{
  display: flex; align-items: flex-start; gap: 10px; font-size: 0.88rem; color: var(--ink-soft);
  cursor: pointer; padding: 10px; border-radius: var(--radius-s); transition: background var(--dur-s) var(--ease);
}
.field-checkbox input{ margin-top: 3px; accent-color: var(--green); width: 16px; height: 16px; flex-shrink: 0; }
.field-checkbox.has-error{ background: #F7ECE9; }
.gate-submit{ width: 100%; margin-top: 4px; }
.gate-links{ margin-top: 16px; font-size: 0.82rem; color: var(--ink-faint); display: flex; gap: 8px; flex-wrap: wrap; }
.gate-links a:hover{ color: #3367D6}
.gate-existing{ margin-top: 22px; font-size: 0.9rem; color: var(--ink-soft); }
.gate-existing a{ color: #3367D6; font-weight: 600; }
.gate-existing a:hover{ text-decoration: underline; }
.gate-honeypot{ position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* Password view: show/hide toggle */
.input-wrap{ position: relative; display: flex; align-items: center; }
.input-wrap input[type="password"], .input-wrap input[type="text"]{ padding-right: 44px; width: 100%; }
.pw-toggle{
  position: absolute; right: 6px; width: 32px; height: 32px; border: none; background: transparent;
  color: var(--ink-faint); border-radius: 8px; display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.pw-toggle:hover{ color: var(--green); }
.pw-toggle svg{ width: 18px; height: 18px; position: absolute; transition: opacity 0.2s ease; }
.pw-toggle .icon-eye-off{ opacity: 0; }
.pw-toggle[aria-pressed="true"] .icon-eye{ opacity: 0; }
.pw-toggle[aria-pressed="true"] .icon-eye-off{ opacity: 1; }

/* Password view: shake on wrong password */
.shake{ animation: gate-shake 0.4s ease; }
@keyframes gate-shake{
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

/* Password view: lockout + help text */
.gate-lockout{
  margin-top: 18px; padding: 12px 14px; border-radius: var(--radius-s);
  background: #c6eeff;
  display: flex; align-items: center; gap: 10px; font-size: 0.86rem; color: var(--ink-soft);
}
.gate-lockout svg{ flex-shrink: 0; color: var(--ink-faint); }
.gate-help{ margin-top: 18px; font-size: 0.82rem; color: var(--ink-faint); }
.gate-help a{ color: #3367D6; font-weight: 600; }
.gate-help a:hover{ text-decoration: underline; }

/* Smooth "wipe" swap between the two gate views (opacity/transform set inline by JS) */
.gate-panel-inner{ transition: opacity 280ms ease, transform 280ms ease; }

@media (max-width: 900px){
  .gate-shell{ grid-template-columns: 1fr; }
  .gate-visual{ border-right: none; border-bottom: 1px solid var(--border); padding: 48px 24px; min-height: 260px; }
  .gate-panel{ padding: 40px 24px 64px; }
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1024px){
  .hero-grid{ grid-template-columns: 1fr; }
  .hero-visual{ order: -1; max-width: 460px; margin: 0 auto; }
  .footer-top{ grid-template-columns: 1.2fr 1fr 1fr; }
  .project-card, .project-card:nth-child(5){ grid-column: span 12; }
}
@media (max-width: 860px){
  .nav-links{ display: none; }
  .nav-cta .btn-secondary{ display: none; }
  .nav-toggle{ display: flex; }
  .mobile-menu{ display: flex; }
  .metrics{ grid-template-columns: repeat(2, 1fr); }
  .footer-top{ grid-template-columns: 1fr 1fr; gap: 32px; }
}
@media (max-width: 560px){
  .metrics{ grid-template-columns: 1fr; }
  .footer-top{ grid-template-columns: 1fr; }
  .footer-bottom{ flex-direction: column; align-items: flex-start; }
  .work-grid{ gap: 20px; }
}
