/* ==========================================================================
   BASE — design tokens, reset, typography, layout primitives
   Putta Manikanta · Product Designer
   ========================================================================== */

/* ---- Tokens ------------------------------------------------------------ */

:root {
  /* Earth — the mine palette */
  --ink-950: #060708;
  --ink-900: #0a0c0d;
  --ink-850: #101315;
  --ink-800: #16191c;
  --ink-700: #1f2427;
  --slate-600: #2b3236;
  --slate-500: #3d4549;
  --slate-400: #5a6367;

  /* Light — the design palette */
  --paper: #f5f3ef;
  --paper-2: #edeae4;
  --paper-3: #e2ded7;
  --ink: #141517;
  --ink-soft: #3a3d40;
  --muted: #74767a;
  --muted-2: #9b9da1;
  --line: #d9d5cd;
  --line-soft: #e6e2da;

  /* The one accent — copper carried up from underground */
  --copper: #b06a3c;
  --copper-lit: #cf8047;
  --amber: #d9a45e;

  /* Type */
  --sans: "Inter Tight", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
    Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo,
    Consolas, monospace;

  --fs-display: clamp(2.75rem, 8.4vw, 7.5rem);
  --fs-h1: clamp(2.25rem, 5.6vw, 4.5rem);
  --fs-h2: clamp(1.75rem, 3.6vw, 3rem);
  --fs-h3: clamp(1.2rem, 1.9vw, 1.6rem);
  --fs-lead: clamp(1.05rem, 1.5vw, 1.375rem);
  --fs-body: clamp(1rem, 1.05vw, 1.0625rem);
  --fs-mono: 0.6875rem;

  /* Space & rhythm */
  --gutter: clamp(1.25rem, 5vw, 5rem);
  --maxw: 1440px;
  --measure: 62ch;
  --section-y: clamp(5rem, 12vh, 10rem);

  --radius: 3px;
  --radius-lg: 6px;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-io: cubic-bezier(0.65, 0, 0.35, 1);
  --dur: 0.7s;
}

/* ---- Reset ------------------------------------------------------------- */

*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--fs-body);
  line-height: 1.6;
  font-weight: 400;
  letter-spacing: -0.006em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* `clip`, not `hidden` — `hidden` would make the body a scroll container
     and break the sticky stage the whole opening depends on. */
  overflow-x: clip;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, p, figure, blockquote, ul, ol, dl, dd {
  margin: 0;
}

ul, ol { padding: 0; list-style: none; }

img, svg, video {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

::selection {
  background: var(--copper);
  color: #fff;
}

:focus-visible {
  outline: 2px solid var(--copper);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---- Typography -------------------------------------------------------- */

h1, h2, h3, h4 {
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.display {
  font-size: var(--fs-display);
  font-weight: 500;
  line-height: 0.94;
  letter-spacing: -0.045em;
}

.h1 { font-size: var(--fs-h1); }
.h2 { font-size: var(--fs-h2); }
.h3 { font-size: var(--fs-h3); letter-spacing: -0.02em; line-height: 1.25; }

.lead {
  font-size: var(--fs-lead);
  line-height: 1.5;
  letter-spacing: -0.014em;
  color: var(--ink-soft);
  max-width: 46ch;
  text-wrap: pretty;
}

p { max-width: var(--measure); text-wrap: pretty; }

.prose p + p { margin-top: 1.15em; }
.prose strong { font-weight: 500; color: var(--ink); }

/* Monospace metadata — dates, categories, labels, captions only */
.mono {
  font-family: var(--mono);
  font-size: var(--fs-mono);
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1.4;
}

.mono--tight { letter-spacing: 0.08em; text-transform: none; }

.muted { color: var(--muted); }

/* Numbered section marker: 01 — Overview */
.marker {
  display: flex;
  align-items: baseline;
  gap: 0.9rem;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: clamp(1.5rem, 3vw, 2.25rem);
}
.marker__num {
  font-family: var(--mono);
  font-size: var(--fs-mono);
  letter-spacing: 0.14em;
  color: var(--copper);
}
.marker__label {
  font-family: var(--mono);
  font-size: var(--fs-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---- Layout ------------------------------------------------------------ */

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

.shell--narrow { max-width: 980px; }

.section {
  padding-block: var(--section-y);
  position: relative;
}

.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: clamp(1.25rem, 2.5vw, 2.5rem);
}

.rule {
  height: 1px;
  background: var(--line);
  border: 0;
  margin: 0;
}

/* ---- Links & buttons --------------------------------------------------- */

.link {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  font-size: 0.9375rem;
  letter-spacing: -0.01em;
  padding-bottom: 0.35em;
  border-bottom: 1px solid currentColor;
  color: var(--ink);
  transition: gap 0.35s var(--ease), color 0.35s var(--ease);
}
.link .arw { transition: transform 0.4s var(--ease); }
.link:hover { color: var(--copper); }
.link:hover .arw { transform: translateX(4px); }

.link--lg { font-size: clamp(1rem, 1.6vw, 1.25rem); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.7em;
  padding: 0.85em 1.4em;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  font-size: 0.9375rem;
  letter-spacing: -0.01em;
  background: var(--ink);
  color: var(--paper);
  transition: background 0.4s var(--ease), color 0.4s var(--ease),
    border-color 0.4s var(--ease);
}
.btn:hover { background: var(--copper); border-color: var(--copper); }
.btn .arw { transition: transform 0.4s var(--ease); }
.btn:hover .arw { transform: translateX(4px); }

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

/* ---- Reveal on scroll -------------------------------------------------- */

[data-reveal] {
  opacity: 0;
  transform: translate3d(0, 18px, 0);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
  transition-delay: var(--d, 0ms);
}
[data-reveal].is-in {
  opacity: 1;
  transform: none;
}

/* A quiet horizontal line that draws itself in */
[data-reveal-rule] {
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 1.1s var(--ease);
  transition-delay: var(--d, 0ms);
}
[data-reveal-rule].is-in { transform: scaleX(1); }

/* ---- Utilities --------------------------------------------------------- */

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 999;
  padding: 0.7em 1.1em;
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--radius);
  font-size: 0.875rem;
  transform: translateY(-160%);
  transition: transform 0.3s var(--ease);
}
.skip-link:focus { transform: none; }

.arw { display: inline-block; }

/* ---- Motion preferences ------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
  [data-reveal-rule] { transform: none; }
}
