/* ============================================================
   Rangeet Majumder — personal portfolio
   Original design system. Dark + warm coral.
   ============================================================ */

:root {
  --bg:        #0B0B0C;
  --bg-2:      #141417;
  --surface:   #1A1A1E;
  --text:      #ECECEC;
  --muted:     #8E8E94;
  --faint:     #5A5A60;
  --line:      rgba(255, 255, 255, 0.10);
  --line-2:    rgba(255, 255, 255, 0.18);
  --accent:    #FF5C35;
  --accent-2:  #FF7A57;
  --on-accent: #0B0B0C;

  --invert-bg:   #F2F1EC;
  --invert-text: #131316;
  --invert-muted:#5C5C62;
  --invert-line: rgba(0, 0, 0, 0.12);

  --sans: "Space Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --maxw: 1280px;
  --gutter: clamp(20px, 5vw, 72px);
  --radius: 14px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  font-weight: 400;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img, svg, canvas { display: block; max-width: 100%; }
::selection { background: var(--accent); color: var(--on-accent); }

.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }

/* ---- skip link / a11y ---- */
.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--accent); color: var(--on-accent);
  padding: 10px 16px; font-family: var(--mono); font-size: 13px;
}
.skip:focus { left: 12px; top: 12px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---- scroll progress ---- */
.progress {
  position: fixed; top: 0; left: 0; height: 2px; width: 0%;
  background: var(--accent); z-index: 60; transition: width 0.1s linear;
}

/* ============================================================ Header / nav */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center;
  height: 76px;
  border-bottom: 1px solid transparent;
  transition: background 0.4s var(--ease), border-color 0.4s var(--ease), height 0.4s var(--ease);
}
.site-header.scrolled {
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom-color: var(--line);
  height: 64px;
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 24px; }

.wordmark { display: inline-flex; flex-direction: column; line-height: 0.94; letter-spacing: 0.02em; }
.wordmark b { font-weight: 700; font-size: 15px; }
.wordmark span { font-weight: 400; font-size: 15px; color: var(--text); }

.nav { display: flex; align-items: center; gap: 6px; }
.nav a {
  font-family: var(--mono); font-size: 12.5px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted); padding: 10px 14px; border-radius: 8px;
  transition: color 0.25s var(--ease), background 0.25s var(--ease);
}
.nav a:hover { color: var(--text); }
.nav a.active { color: var(--text); }
.nav a.active::before { content: "▸ "; color: var(--accent); }
.nav .nav-cta {
  color: var(--text); border: 1px solid var(--line-2); margin-left: 8px;
}
.nav .nav-cta:hover { border-color: var(--accent); color: var(--accent); }

.nav-toggle {
  display: none; background: none; border: 1px solid var(--line-2); border-radius: 8px;
  width: 44px; height: 40px; cursor: pointer; position: relative;
}
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  content: ""; position: absolute; left: 50%; width: 18px; height: 1.5px; background: var(--text);
  transform: translateX(-50%); transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
}
.nav-toggle span { top: 50%; }
.nav-toggle span::before { top: -6px; }
.nav-toggle span::after { top: 6px; }
body.nav-open .nav-toggle span { background: transparent; }
body.nav-open .nav-toggle span::before { transform: translateX(-50%) translateY(6px) rotate(45deg); }
body.nav-open .nav-toggle span::after  { transform: translateX(-50%) translateY(-6px) rotate(-45deg); }

@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .nav {
    position: fixed; inset: 0; flex-direction: column; justify-content: center; gap: 8px;
    background: var(--bg); transform: translateY(-100%); transition: transform 0.5s var(--ease);
    z-index: 49;
  }
  body.nav-open .nav { transform: translateY(0); }
  .nav a { font-size: 20px; padding: 12px; }
  .nav .nav-cta { margin: 12px 0 0; }
}

/* ============================================================ Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 14px 22px; border-radius: 10px; border: 1px solid transparent; cursor: pointer;
  transition: transform 0.25s var(--ease), background 0.25s var(--ease), color 0.25s var(--ease), border-color 0.25s var(--ease);
}
.btn .arrow { transition: transform 0.25s var(--ease); }
.btn:hover .arrow { transform: translateX(4px); }
.btn-primary { background: var(--accent); color: var(--on-accent); font-weight: 600; }
.btn-primary:hover { background: var(--accent-2); transform: translateY(-2px); }
.btn-ghost { border-color: var(--line-2); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ============================================================ Sections / typography */
section { position: relative; }
.section { padding-block: clamp(72px, 12vh, 160px); }
.eyebrow {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--mono); font-size: 12.5px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 28px;
}
.eyebrow .num { color: var(--accent); }
.eyebrow::after { content: ""; width: 48px; height: 1px; background: var(--line-2); }

h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.03em; line-height: 1.02; }
.display { font-size: clamp(2.7rem, 8.2vw, 7rem); font-weight: 700; line-height: 0.96; }
.h2 { font-size: clamp(2rem, 4.6vw, 3.6rem); }
.h3 { font-size: clamp(1.3rem, 2.2vw, 1.7rem); letter-spacing: -0.02em; }
.lead { font-size: clamp(1.05rem, 1.6vw, 1.35rem); color: var(--muted); max-width: 56ch; }
.muted { color: var(--muted); }
.accent { color: var(--accent); }

/* ============================================================ Hero */
.hero { min-height: 100svh; display: flex; align-items: center; position: relative; overflow: hidden; }
.hero canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }
.hero::after { /* vignette so text stays legible */
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(120% 90% at 70% 40%, transparent 40%, var(--bg) 100%);
}
.hero .wrap { position: relative; z-index: 2; width: 100%; }
.hero .display { max-width: 14ch; }
.hero-sub { margin-top: 28px; }
.hero-cta { margin-top: 40px; display: flex; gap: 14px; flex-wrap: wrap; }
.scroll-cue {
  position: absolute; left: var(--gutter); bottom: 28px; z-index: 2;
  font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--faint);
}

/* hero word reveal on load */
.reveal-line { display: block; overflow: hidden; }
.reveal-line > span { display: block; transform: translateY(110%); }
.loaded .reveal-line > span { transform: translateY(0); transition: transform 0.9s var(--ease); }
.loaded .reveal-line:nth-child(2) > span { transition-delay: 0.08s; }
.loaded .reveal-line:nth-child(3) > span { transition-delay: 0.16s; }

/* ============================================================ Page hero (inner pages) */
.page-hero { padding-block: clamp(120px, 20vh, 220px) clamp(40px, 7vh, 90px); position: relative; }
.page-hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0.5;
  background-image: radial-gradient(var(--line) 1px, transparent 1px);
  background-size: 26px 26px;
  -webkit-mask-image: radial-gradient(80% 80% at 80% 10%, #000, transparent 75%);
          mask-image: radial-gradient(80% 80% at 80% 10%, #000, transparent 75%);
}

/* ============================================================ Reveal-on-scroll */
[data-reveal] { opacity: 0; transform: translateY(22px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
[data-reveal].is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  [data-reveal], .loaded .reveal-line > span { opacity: 1 !important; transform: none !important; transition: none !important; }
}

/* ============================================================ Grids & cards */
.grid { display: grid; gap: 20px; }
.cols-2 { grid-template-columns: repeat(2, 1fr); }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 980px) { .cols-3, .cols-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .cols-2, .cols-3, .cols-4 { grid-template-columns: 1fr; } }

.card {
  position: relative; background: var(--bg-2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 28px; transition: border-color 0.3s var(--ease), transform 0.3s var(--ease), background 0.3s var(--ease);
}
.card:hover { border-color: var(--line-2); transform: translateY(-3px); }
.card .k { font-family: var(--mono); font-size: 12px; letter-spacing: 0.1em; color: var(--accent); text-transform: uppercase; }
.card h3 { margin: 14px 0 10px; }
.card p { margin: 0; color: var(--muted); font-size: 0.97rem; }

/* feature list (services) */
.feature { display: flex; gap: 20px; padding: 26px 0; border-top: 1px solid var(--line); align-items: baseline; }
.feature:last-child { border-bottom: 1px solid var(--line); }
.feature .idx { font-family: var(--mono); font-size: 12px; color: var(--accent); min-width: 44px; }
.feature .ft { flex: 1; }
.feature h3 { margin: 0 0 8px; }
.feature p { margin: 0; color: var(--muted); max-width: 60ch; }
.feature:hover h3 { color: var(--accent); transition: color 0.25s var(--ease); }

/* work cards */
.work-card { display: block; }
.work-card .thumb {
  aspect-ratio: 16 / 10; border-radius: 12px; border: 1px solid var(--line);
  background:
    radial-gradient(120% 120% at 20% 10%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 55%),
    repeating-linear-gradient(135deg, var(--bg-2) 0 14px, var(--surface) 14px 28px);
  display: grid; place-items: center; overflow: hidden; transition: border-color 0.3s var(--ease);
}
.work-card .thumb span { font-family: var(--mono); font-size: 12px; color: var(--faint); letter-spacing: 0.1em; }
.work-card:hover .thumb { border-color: var(--accent); }
.work-card .meta { display: flex; justify-content: space-between; gap: 16px; margin-top: 16px; align-items: baseline; }
.work-card h3 { font-size: 1.25rem; }
.work-card .tag { font-family: var(--mono); font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.work-card .result { margin-top: 8px; color: var(--accent); font-family: var(--mono); font-size: 13px; }

/* stat row */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
@media (max-width: 760px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.stat .n { font-size: clamp(2.2rem, 4vw, 3.2rem); font-weight: 700; letter-spacing: -0.03em; }
.stat .l { font-family: var(--mono); font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; margin-top: 6px; }

/* writing list */
.post { display: grid; grid-template-columns: 130px 1fr auto; gap: 24px; align-items: baseline;
  padding: 28px 0; border-top: 1px solid var(--line); transition: padding-left 0.3s var(--ease); }
.post:last-child { border-bottom: 1px solid var(--line); }
.post:hover { padding-left: 10px; }
.post .date { font-family: var(--mono); font-size: 12.5px; color: var(--muted); }
.post h3 { font-size: 1.35rem; }
.post p { margin: 8px 0 0; color: var(--muted); font-size: 0.97rem; }
.post .go { font-family: var(--mono); font-size: 12px; color: var(--accent); white-space: nowrap; }
@media (max-width: 700px) { .post { grid-template-columns: 1fr; gap: 6px; } .post .go { display: none; } }

/* pill tags */
.pills { display: flex; flex-wrap: wrap; gap: 10px; }
.pill { font-family: var(--mono); font-size: 12.5px; letter-spacing: 0.04em; color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; }

/* ============================================================ Invert band */
.invert { background: var(--invert-bg); color: var(--invert-text); }
.invert .eyebrow { color: var(--invert-muted); }
.invert .eyebrow::after { background: var(--invert-line); }
.invert .lead, .invert .muted { color: var(--invert-muted); }
.invert .feature { border-color: var(--invert-line); }
.invert .feature p { color: var(--invert-muted); }

/* ============================================================ CTA band */
.cta-band { border-top: 1px solid var(--line); }
.cta-band .display { max-width: 18ch; }
.cta-band .row { display: flex; align-items: flex-end; justify-content: space-between; gap: 40px; flex-wrap: wrap; }

/* ============================================================ Contact form */
.form { display: grid; gap: 18px; max-width: 560px; }
.field { display: grid; gap: 8px; }
.field label { font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.field input, .field textarea, .field select {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; color: var(--text);
  font-family: var(--sans); font-size: 1rem; padding: 14px 16px; width: 100%;
  transition: border-color 0.25s var(--ease);
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--accent); outline: none; }
.field textarea { min-height: 130px; resize: vertical; }

/* ============================================================ Footer */
.site-footer { border-top: 1px solid var(--line); padding-block: clamp(56px, 8vh, 96px) 40px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; gap: 28px; } }
.site-footer h2 { max-width: 16ch; }
.footer-links { display: grid; gap: 10px; }
.footer-links a, .footer-col a { color: var(--muted); transition: color 0.2s var(--ease); }
.footer-links a:hover, .footer-col a:hover { color: var(--accent); }
.footer-col .lbl { font-family: var(--mono); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); margin-bottom: 12px; }
.footer-meta { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--line);
  font-family: var(--mono); font-size: 12px; color: var(--faint); letter-spacing: 0.04em; }

/* utility */
.mt-s { margin-top: 18px; } .mt-m { margin-top: 36px; } .mt-l { margin-top: 64px; }
.stack-lead { max-width: 60ch; }
.divider { height: 1px; background: var(--line); border: 0; margin: 0; }
