/* ============================================================
   Arman Chaudhary — Portfolio v2
   Engineering Brutalist · Cream + Ink
   ============================================================ */

:root {
  --cream:        #EDE6D2;
  --cream-2:      #E5DDC4;
  --cream-3:      #DAD0B0;
  --ink:          #0E0E0E;
  --ink-2:        #1A1A18;
  --ink-soft:     rgba(14, 14, 14, 0.62);
  --ink-mute:     rgba(14, 14, 14, 0.42);
  --ink-fade:     rgba(14, 14, 14, 0.22);
  --hairline:     rgba(14, 14, 14, 0.18);
  --hairline-2:   rgba(14, 14, 14, 0.10);

  --font-sans: "Manrope", -apple-system, system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --font-serif: "Instrument Serif", "Times New Roman", serif;

  --bezier: cubic-bezier(0.7, 0, 0.15, 1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01", "ss02", "cv11";
  cursor: none;
}

body {
  /* faint paper grain */
  background-image:
    radial-gradient(rgba(14,14,14,0.035) 1px, transparent 1px),
    radial-gradient(rgba(14,14,14,0.025) 1px, transparent 1px);
  background-size: 3px 3px, 7px 7px;
  background-position: 0 0, 1px 2px;
}

a { color: inherit; text-decoration: none; cursor: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: none; }
input, textarea, select, label, [role="button"], .hover-target { cursor: none; }

::selection { background: var(--ink); color: var(--cream); }

.mono { font-family: var(--font-mono); font-variant-ligatures: none; }
.serif { font-family: var(--font-serif); font-style: italic; font-weight: 400; }

/* ============================================================
   Layout — page grid
   ============================================================ */
.page {
  min-height: 100vh;
  position: relative;
  overflow-x: clip;
}

.shell {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 32px;
}

@media (max-width: 720px) {
  .shell { padding: 0 18px; }
  html, body { cursor: auto; }
  button, a { cursor: pointer !important; }
}

/* hairline grid columns indicator (visible at top of sections) */
.col-rule {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(to right,
    var(--hairline-2) 1px, transparent 1px);
  background-size: calc(100% / 12) 100%;
  opacity: 0.55;
  mix-blend-mode: multiply;
}

/* ============================================================
   Status bar
   ============================================================ */
.statusbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 8px 22px;
  background: var(--cream);
  border-bottom: 1px solid var(--hairline);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.statusbar .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--ink);
  box-shadow: 0 0 0 3px rgba(14,14,14,0.10);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.35; }
}
.statusbar .spacer { flex: 1; }
.statusbar .seg { display: flex; align-items: center; gap: 8px; }
.statusbar .seg::before {
  content: "";
  width: 1px; height: 10px;
  background: var(--hairline);
}
.statusbar .seg:first-of-type::before { display: none; }

@media (max-width: 720px) {
  .statusbar { font-size: 10px; padding: 6px 12px; gap: 10px; overflow: hidden; }
  .statusbar .hide-sm { display: none; }
}

/* ============================================================
   Nav
   ============================================================ */
.nav {
  position: fixed;
  top: 36px; left: 0; right: 0;
  z-index: 80;
  display: flex;
  justify-content: center;
  pointer-events: none;
}
.nav-inner {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px;
  background: var(--cream);
  border: 1px solid var(--hairline);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  box-shadow: 0 8px 24px rgba(14,14,14,0.06);
}
.nav-link {
  position: relative;
  padding: 8px 14px;
  color: var(--ink-soft);
  transition: color 0.2s var(--bezier);
}
.nav-link:hover { color: var(--ink); }
.nav-link.active {
  background: var(--ink);
  color: var(--cream);
}
.nav-link .num {
  font-size: 9px;
  opacity: 0.55;
  margin-right: 6px;
}
.nav-link.active .num { opacity: 0.7; }

.nav-toggle { display: none; }
.nav-scrim { display: none; }

@media (max-width: 720px) {
  .nav { top: 30px; padding: 0 12px; }
  .nav-inner {
    flex-direction: column;
    align-items: stretch;
    padding: 4px;
    font-size: 11px;
    overflow: visible;
    max-width: 100%;
    width: min(320px, 92vw);
    gap: 0;
  }
  .nav-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    color: var(--ink);
    font: inherit;
    text-transform: inherit;
    letter-spacing: inherit;
    background: transparent;
    border: 0;
    width: 100%;
    text-align: left;
  }
  .nav-toggle .num { font-size: 9px; opacity: 0.55; }
  .nav-toggle-label { flex: 1; }
  .nav-toggle-icon {
    font-size: 18px; line-height: 1;
    color: var(--ink-soft);
    transition: transform 0.2s var(--bezier);
  }
  .nav-open .nav-toggle-icon { transform: rotate(90deg); }
  .nav-links {
    display: none;
    flex-direction: column;
    gap: 2px;
    padding-top: 4px;
    margin-top: 4px;
    border-top: 1px solid var(--hairline);
  }
  .nav-open .nav-links { display: flex; }
  .nav-link {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px;
  }
  .nav-link .num { display: inline; font-size: 9px; margin-right: 0; min-width: 18px; }
  .nav-scrim {
    display: block;
    position: fixed; inset: 0;
    background: rgba(14,14,14,0.18);
    z-index: 70;
    animation: navFade 0.18s var(--bezier);
  }
  @keyframes navFade { from { opacity: 0; } to { opacity: 1; } }
}

@media (min-width: 721px) {
  .nav-links { display: flex; align-items: center; gap: 4px; }
}

/* ============================================================
   Section chrome
   ============================================================ */
.section {
  position: relative;
  padding: 96px 0;
  border-bottom: 1px solid var(--hairline);
}
.section:first-of-type { padding-top: 120px; }

.section-head {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 24px;
  margin-bottom: 56px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--hairline);
}
.section-head h2 {
  margin: 0;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: clamp(36px, 5.5vw, 72px);
  letter-spacing: -0.04em;
  line-height: 0.95;
}
.section-head .meta {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  text-align: right;
  white-space: nowrap;
}
.section-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 12px;
}
.section-tag::before {
  content: "";
  width: 22px;
  height: 1px;
  background: var(--ink);
}

@media (max-width: 720px) {
  .section { padding: 72px 0; }
  .section-head { grid-template-columns: 1fr; gap: 8px; align-items: start; margin-bottom: 36px; }
  .section-head .meta { text-align: left; }
}

/* ============================================================
   Cursor crosshair
   ============================================================ */
.cursor {
  position: fixed;
  top: 0; left: 0;
  width: 28px; height: 28px;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  mix-blend-mode: difference;
}
.cursor::before, .cursor::after {
  content: "";
  position: absolute;
  background: #fff;
}
.cursor::before { top: 50%; left: 0; right: 0; height: 1px; }
.cursor::after { top: 0; bottom: 0; left: 50%; width: 1px; }
.cursor.dot::before, .cursor.dot::after { display: none; }
.cursor.dot {
  width: 10px; height: 10px;
  background: #fff;
  border-radius: 50%;
}
.cursor-coords {
  position: fixed;
  pointer-events: none;
  z-index: 9998;
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--ink-soft);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transform: translate(18px, 12px);
  white-space: nowrap;
}

@media (max-width: 720px) {
  .cursor, .cursor-coords { display: none; }
}

/* ============================================================
   Reveal
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.9s var(--bezier), transform 0.9s var(--bezier);
}
.reveal.in {
  opacity: 1;
  transform: none;
}
.reveal.delay-1 { transition-delay: 0.08s; }
.reveal.delay-2 { transition-delay: 0.16s; }
.reveal.delay-3 { transition-delay: 0.24s; }
.reveal.delay-4 { transition-delay: 0.32s; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; }
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 22px;
  background: var(--ink);
  color: var(--cream);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid var(--ink);
  position: relative;
  overflow: hidden;
  transition: background 0.2s var(--bezier), color 0.2s var(--bezier);
}
.btn:hover { background: var(--cream); color: var(--ink); }
.btn .arrow {
  display: inline-block;
  width: 22px; height: 10px;
  position: relative;
  transition: transform 0.3s var(--bezier);
}
.btn .arrow::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 50%;
  height: 1px;
  background: currentColor;
}
.btn .arrow::after {
  content: "";
  position: absolute;
  right: 0; top: 50%;
  width: 8px; height: 8px;
  border-top: 1px solid currentColor;
  border-right: 1px solid currentColor;
  transform: translateY(-50%) rotate(45deg);
  transform-origin: center;
}
.btn:hover .arrow { transform: translateX(4px); }

.btn-ghost {
  background: transparent;
  color: var(--ink);
}
.btn-ghost:hover { background: var(--ink); color: var(--cream); }

/* ============================================================
   Caret blink
   ============================================================ */
@keyframes blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }
.caret {
  display: inline-block;
  width: 0.5em; height: 1em;
  background: currentColor;
  vertical-align: text-bottom;
  margin-left: 2px;
  animation: blink 1.05s step-end infinite;
}
.caret-thin {
  width: 1px;
  background: currentColor;
}

/* ============================================================
   Footnote / labels
   ============================================================ */
.footnote {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  text-transform: uppercase;
}

/* utility */
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { scrollbar-width: none; }
