/* ICICI Bank Custody Diwali card. Direction: the dark room (seed 1164661675), ICICI inks kept. */
@font-face { font-family: Erode; src: url(../assets/fonts/erode-400-normal.woff2) format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: Erode; src: url(../assets/fonts/erode-400-italic.woff2) format('woff2'); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: Erode; src: url(../assets/fonts/erode-500-normal.woff2) format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: Erode; src: url(../assets/fonts/erode-600-normal.woff2) format('woff2'); font-weight: 600; font-style: normal; font-display: swap; }

:root {
  /* ICICI inks: navy #004A7F darkened into the night ground, orange #F06321 the one accent, maroon #AE282E in the emblem */
  --bg: #061523;
  --ink: #F1F0EE;
  --muted: #B7C3CE;
  --accent: #F06321;
  --accent-press: #D9531A;
  --paper: #FFFFFF;
  --paper-ink: #0B2A44;
  --paper-muted: #3E5568;

  --font: Erode, 'Nirmala UI', 'Kohinoor Devanagari', 'Noto Serif Devanagari', Georgia, serif;
  --step-small: clamp(0.8125rem, 0.79rem + 0.1vw, 0.875rem);
  --step-body: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  --step-lead: clamp(1.25rem, 1.1rem + 0.7vw, 1.625rem);
  --step-head: clamp(2rem, 1.3rem + 3.2vw, 4rem);
  --step-display: clamp(3rem, 1.5rem + 7vw, 8.25rem);

  --margin: clamp(20px, 5vw, 72px);
  --gap-section: clamp(120px, 16vw, 220px);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: var(--step-body); line-height: 1.55; font-weight: 400;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
p { margin: 0; }
h1, h2, h3 { margin: 0; font-weight: 500; letter-spacing: -0.025em; line-height: 0.98; }
h1, h2 { font-size: var(--step-head); }
h3 { font-size: var(--step-lead); line-height: 1.15; letter-spacing: -0.01em; }
a { color: inherit; }
button { font: inherit; color: inherit; }
::selection { background: var(--accent); color: var(--bg); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* each .stage holds one 3D object, drawn into its own canvas by js/world.js */
.stage { position: relative; cursor: pointer; touch-action: pan-x pan-y; -webkit-tap-highlight-color: transparent; }
.stage canvas.view { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.stage .still { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
html.gl .stage .still { visibility: hidden; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 0 28px; border: 0; border-radius: 0;
  background: var(--accent); color: var(--bg); font-size: var(--step-body); font-weight: 600; letter-spacing: 0;
  cursor: pointer; transition: background-color 160ms ease, transform 160ms var(--ease-out);
}
.btn:hover { background: #F57A3F; }
.btn:active { transform: scale(0.97); background: var(--accent-press); }
.text-btn {
  background: none; border: 0; padding: 10px 0; min-height: 44px; cursor: pointer;
  font-size: var(--step-body); color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.25em;
  transition: color 160ms ease, transform 160ms var(--ease-out);
}
.text-btn:hover { color: var(--accent); }
.text-btn:active { transform: translateY(1px); }

/* ---------- hero: lit object in the middle, four corners ---------- */
.hero {
  min-height: 100svh; display: grid; grid-template-rows: auto minmax(0, 1fr) auto;
  padding: clamp(18px, 3vw, 44px) var(--margin) clamp(24px, 4vw, 44px);
}
.hero-bar { grid-row: 1; grid-column: 1; position: relative; z-index: 2; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.brand img { width: clamp(150px, 15vw, 210px); }
.emblem-stage { grid-row: 1 / 3; grid-column: 1; min-height: 320px; margin-bottom: clamp(8px, 2vh, 24px); }
.emblem-stage:focus-visible { outline-offset: -4px; }
.hero-foot { grid-row: 3; display: flex; justify-content: space-between; align-items: flex-end; gap: 32px 48px; flex-wrap: wrap; }
.hero-words { max-width: 36rem; }
.hero-words .hi { font-size: var(--step-lead); margin-top: 14px; color: var(--ink); }
.hero-words .lede { margin-top: 18px; max-width: 30ch; font-size: var(--step-lead); line-height: 1.35; }
.hero-act { display: flex; flex-direction: column; align-items: flex-end; gap: 16px; text-align: right; }
.hint { max-width: 26ch; color: var(--ink); }

/* ---------- sections ---------- */
.section-head { padding: 0 var(--margin); display: grid; gap: 24px; }
.section-head p { max-width: 52ch; }
.row-section { padding-top: var(--gap-section); }
.statement, .sky-section { padding-top: var(--gap-section); }
.sky-section { padding-bottom: var(--gap-section); }

/* the drag row: native sideways scroll with snapping */
.drag-row {
  list-style: none; margin: clamp(40px, 6vw, 72px) var(--margin) 0; padding: 0 0 12px;
  display: flex; gap: clamp(16px, 2vw, 28px); overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; scrollbar-width: none; cursor: grab;
}
.drag-row.dragging { cursor: grabbing; }
.drag-row::-webkit-scrollbar { display: none; }
.item { flex: 0 0 clamp(280px, 38vw, 560px); scroll-snap-align: start; }
.diya-stage { aspect-ratio: 4 / 3; width: 100%; }
.item h3 { margin-top: 8px; }
.item .status { margin-top: 6px; color: var(--muted); font-size: var(--step-body); }
.item.lit .status { color: var(--ink); }

/* the statement: one type size, columns at fixed starts, nothing but leading between rows */
.ledger {
  width: calc(100% - 2 * var(--margin)); margin: clamp(40px, 6vw, 72px) var(--margin) 0; border-collapse: collapse;
  font-size: var(--step-lead); line-height: 1.5; font-variant-numeric: tabular-nums;
}
.ledger th, .ledger td { text-align: left; font-weight: 400; padding: 0; vertical-align: baseline; }
.ledger thead th { color: var(--muted); padding-bottom: 0.4em; }
.ledger th:first-child, .ledger td:first-child { width: 33%; }
.ledger td:last-child, .ledger th:last-child { text-align: right; width: 14%; }
.ledger .part td { color: var(--accent); padding: 0.9em 0 0.35em; text-align: left; }
.ledger .st { color: var(--muted); transition: color 400ms ease; }
.ledger tr.lit .st { color: var(--ink); }
.ledger .total th, .ledger .total td { padding-top: 0.9em; }
.ledger .total td:not(.st) { color: var(--muted); }

/* the sky: a headline you type into, written in light below */
.wish { padding: clamp(40px, 6vw, 72px) var(--margin) 0; }
.wish-input {
  display: block; width: 100%; background: none; border: 0; padding: 0; margin: 0; border-radius: 0;
  font-family: var(--font); font-size: var(--step-display); font-weight: 500; letter-spacing: -0.035em; line-height: 1.05;
  color: var(--ink); caret-color: var(--accent);
}
.wish-input:focus { outline: none; }
.wish-input:focus-visible { outline: 2px solid var(--accent); outline-offset: 6px; }
.sky-canvas { display: block; width: 100%; height: clamp(260px, 44vh, 520px); margin-top: 28px; cursor: crosshair; touch-action: pan-y; }
.examples { display: flex; flex-wrap: wrap; gap: 4px 32px; margin-top: 20px; }

/* ---------- the close: ground and ink inverted, the name at full width ---------- */
.close {
  position: relative; z-index: 2; background: var(--paper); color: var(--paper-ink);
  padding: clamp(40px, 5vw, 64px) var(--margin) 20px; display: grid; grid-template-rows: auto auto auto; gap: clamp(56px, 9vw, 120px) 0;
}
.close-cols { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px; }
.close-cols p { color: var(--paper-muted); }
.close-cols .strong { color: var(--paper-ink); font-weight: 500; }
.close .text-btn { color: var(--paper-ink); padding: 0; min-height: 0; }
.close .text-btn:hover { color: var(--accent-press); }
.close .wordmark { width: 100%; }
.close .legal { font-size: var(--step-small); color: var(--paper-muted); margin-top: -40px; }

/* ---------- entrances: heading, then text, then picture; only when script runs ---------- */
html.js [data-in] .rise, html.js [data-in].rise { opacity: 0; transform: translateY(24px); transition: opacity 700ms var(--ease-out), transform 900ms var(--ease-out); transition-delay: calc(var(--i, 0) * 80ms); }
html.js [data-in].in .rise, html.js [data-in].in.rise { opacity: 1; transform: none; }

@media (max-width: 1024px) {
  .close-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 24px; }
}

/* ---------- phone: its own composition ---------- */
@media (max-width: 760px) {
  .hero { grid-template-rows: auto minmax(44svh, 1fr) auto; }
  .hero-foot { flex-direction: column; align-items: stretch; gap: 22px; }
  .hero-act { align-items: stretch; text-align: left; }
  .hero-act .btn { width: 100%; }
  .section-head { grid-template-columns: 1fr; }
  .item { flex-basis: 82vw; }
  .ledger, .ledger tbody, .ledger tr { display: block; }
  .ledger thead { display: none; }
  .ledger tr { display: grid; grid-template-columns: 1fr auto; column-gap: 16px; margin-bottom: 18px; }
  .ledger th, .ledger td, .ledger th:first-child, .ledger td:first-child, .ledger td:last-child { width: auto; }
  .ledger tr > :first-child { grid-column: 1 / -1; font-size: 22px; line-height: 1.3; }
  .ledger tr > :nth-child(2) { font-size: var(--step-body); color: var(--muted); }
  .ledger tr > .st { font-size: var(--step-body); text-align: right; }
  .ledger .part td { font-size: 22px; padding-top: 0; }
  .wish-input { font-size: 11vw; }
  .sky-canvas { height: clamp(190px, 30vh, 260px); margin-top: 16px; }
  .examples { gap: 10px; }
  .examples .example { background: #102A40; text-decoration: none; padding: 0 16px; min-height: 44px; }
  .close-cols { grid-template-columns: 1fr 1fr; gap: 32px 20px; }
  .close .legal { margin-top: -24px; }
}

@media (prefers-reduced-motion: reduce) {
  html.js [data-in] .rise, html.js [data-in].rise { transform: none; transition: opacity 400ms linear; }
  .btn, .text-btn { transition: none; }
}
