/* ============================================================
   Sallah iPhone — Serekunda phone repair
   Composition: receipt/listing layout, section colour rotation,
   stacked headline, fade+rise on scroll, grain overlay,
   drag-to-scroll band.
   ============================================================ */

/* ---------- tokens ---------- */
:root {
  --ink:        #0a0a0a;
  --red:        #e10600;
  --blue:       #003c8a;
  --acid:       #f4ff33;
  --paper:      #f2efe6;

  --on-ink:     #f6f4ee;
  --on-red:     #fff5f4;
  --on-blue:    #eef3ff;
  --on-acid:    #14140a;
  --on-paper:   #14130f;

  --muted-ink:  rgba(246,244,238,.72);
  --muted-red:  #fff5f4;
  --muted-blue: rgba(238,243,255,.82);
  --muted-acid: rgba(20,20,10,.74);
  --muted-paper:rgba(20,19,15,.72);

  --rule-ink:   rgba(246,244,238,.28);
  --rule-red:   rgba(255,245,244,.42);
  --rule-blue:  rgba(238,243,255,.42);
  --rule-acid:  rgba(20,20,10,.34);
  --rule-paper: rgba(20,19,15,.28);

  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --disp: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;

  --gut: clamp(1.15rem, 4.5vw, 2.5rem);
  --col: 40ch;
}

/* dark mode: the paper + ink sections swap roles, the three
   saturated sections stay saturated (they read fine either way). */
html[data-theme="dark"] {
  --ink:      #050505;
  --paper:    #121110;
  --on-paper: #f2efe6;
  --muted-paper: rgba(242,239,230,.74);
  --rule-paper:  rgba(242,239,230,.26);
  --red:      #c00500;
  --blue:     #002f6e;
  --acid:     #e2ee2b;
  --on-acid:  #101008;
  --muted-acid: rgba(16,16,8,.78);
  --rule-acid:  rgba(16,16,8,.36);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  background: var(--ink);
  color: var(--on-ink);
  font-family: var(--mono);
  font-size: clamp(0.95rem, 0.55vw + 0.82rem, 1.05rem);
  line-height: 1.62;
  font-variant-ligatures: none;
  overflow-x: hidden;
}

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

a { color: inherit; }

:focus-visible {
  outline: 3px solid currentColor;
  outline-offset: 3px;
  border-radius: 2px;
}

.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 {
  position: absolute; left: -9999px; top: 0; z-index: 60;
  background: var(--acid); color: var(--on-acid);
  padding: .6rem 1rem; font-size: .8rem;
}
.skip:focus { left: .5rem; top: .5rem; }

/* ---------- grain overlay ---------- */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  opacity: .07;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='180' height='180' filter='url(%23n)'/></svg>");
  background-size: 180px 180px;
}

/* ---------- layout ---------- */
.wrap {
  width: 100%;
  max-width: calc(var(--col) + var(--gut) * 2);
  margin-inline: auto;
  padding-inline: var(--gut);
}
.wrap--wide { max-width: 1180px; }

.sec {
  position: relative;
  padding-block: clamp(3.5rem, 9vw, 6.5rem);
  background: var(--sec-bg, var(--ink));
  color: var(--sec-fg, var(--on-ink));
}
.sec--ink   { --sec-bg: var(--ink);   --sec-fg: var(--on-ink);   --sec-muted: var(--muted-ink);   --sec-rule: var(--rule-ink); }
.sec--red   { --sec-bg: var(--red);   --sec-fg: var(--on-red);   --sec-muted: var(--muted-red);   --sec-rule: var(--rule-red); }
.sec--blue  { --sec-bg: var(--blue);  --sec-fg: var(--on-blue);  --sec-muted: var(--muted-blue);  --sec-rule: var(--rule-blue); }
.sec--acid  { --sec-bg: var(--acid);  --sec-fg: var(--on-acid);  --sec-muted: var(--muted-acid);  --sec-rule: var(--rule-acid); }
.sec--paper { --sec-bg: var(--paper); --sec-fg: var(--on-paper); --sec-muted: var(--muted-paper); --sec-rule: var(--rule-paper); }

/* ---------- motion: fade + rise on enter ---------- */
@keyframes fadeRise {
  from { opacity: 0; translate: 0 14px; }
  to   { opacity: 1; translate: 0 0; }
}

.sec > .wrap,
.sec > .wrap--wide {
  animation: fadeRise 420ms cubic-bezier(.2,.7,.1,1) both;
  animation-timeline: view();
  animation-range: entry 0% cover 22%;
}

@supports not (animation-timeline: view()) {
  .sec > .wrap,
  .sec > .wrap--wide { animation: none; }
}

/* ---------- top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--ink) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px dotted var(--rule-ink);
  color: var(--on-ink);
}
.topbar-inner {
  max-width: 1180px;
  margin-inline: auto;
  padding: .55rem var(--gut);
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  text-decoration: none;
  font-family: var(--disp);
  font-weight: 700;
  letter-spacing: -.01em;
  font-size: 1rem;
  margin-right: auto;
}
.wordmark-mark {
  display: grid;
  place-items: center;
  width: 30px; height: 30px;
  background: var(--acid);
  color: var(--on-acid);
  font-family: var(--mono);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .04em;
}
.topnav {
  display: flex;
  gap: 1.1rem;
  font-size: .78rem;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.topnav a {
  text-decoration: none;
  color: var(--muted-ink);
  padding: .5rem .1rem;
  border-bottom: 1px solid transparent;
}
.topnav a:hover { color: var(--on-ink); border-bottom-color: var(--acid); }

.topbar-actions { display: flex; align-items: center; gap: .5rem; }

.callbtn {
  display: inline-flex;
  align-items: baseline;
  gap: .45rem;
  text-decoration: none;
  background: var(--red);
  color: var(--on-red);
  padding: .55rem .85rem;
  min-height: 44px;
  font-size: .82rem;
  letter-spacing: .02em;
}
.callbtn-label { opacity: .85; font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; }
.callbtn-num { font-weight: 700; }
.callbtn:hover { background: var(--acid); color: var(--on-acid); }

.theme-toggle {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  background: transparent;
  border: 1px solid var(--rule-ink);
  color: var(--on-ink);
  cursor: pointer;
  padding: 0;
}
.theme-toggle:hover { border-color: var(--acid); }
.theme-toggle-icon {
  width: 15px; height: 15px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: inset -5px -3px 0 0 var(--ink);
}
html[data-theme="dark"] .theme-toggle-icon {
  box-shadow: none;
  background: var(--acid);
}

/* ---------- type ---------- */
.eyebrow {
  font-size: .72rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--sec-muted, var(--muted-ink));
  margin: 0 0 1.1rem;
  padding-bottom: .6rem;
  border-bottom: 1px dotted var(--sec-rule, var(--rule-ink));
}

.stack {
  font-family: var(--disp);
  font-weight: 800;
  font-size: clamp(2.6rem, 12vw, 5.2rem);
  line-height: .92;
  letter-spacing: -.035em;
  margin: 0 0 1.6rem;
  text-wrap: balance;
}
.stack span { display: block; }
.stack span:nth-child(1) { margin-left: 0; }
.stack span:nth-child(2) { margin-left: 1.6em; }
.stack span:nth-child(3) { margin-left: -.06em; color: var(--acid); }

.h2 {
  font-family: var(--disp);
  font-weight: 700;
  font-size: clamp(1.6rem, 5.4vw, 2.5rem);
  line-height: 1.06;
  letter-spacing: -.025em;
  margin: 0 0 1.1rem;
  text-wrap: balance;
}

.lede {
  font-size: 1.02rem;
  color: var(--sec-muted, var(--muted-ink));
  margin: 0 0 2rem;
  max-width: 46ch;
}
.body {
  color: var(--sec-muted, var(--muted-ink));
  margin: 0 0 2rem;
  max-width: 52ch;
}
.fineprint {
  font-size: .82rem;
  color: var(--sec-muted, var(--muted-ink));
  margin: 1.4rem 0 0;
  padding-top: .9rem;
  border-top: 1px dotted var(--sec-rule, var(--rule-ink));
  max-width: 52ch;
}

/* ---------- hero ---------- */
.hero { padding-top: clamp(2.5rem, 7vw, 4.5rem); }

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.2rem 1.6rem;
  margin-bottom: 2.6rem;
}
.bigcall {
  display: inline-flex;
  flex-direction: column;
  gap: .1rem;
  text-decoration: none;
  background: var(--acid);
  color: var(--on-acid);
  padding: .85rem 1.4rem;
  min-height: 44px;
  transition: translate 160ms ease;
}
.bigcall:hover { translate: 0 -3px; }
.bigcall-k {
  font-size: .68rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  opacity: .8;
}
.bigcall-v {
  font-family: var(--disp);
  font-weight: 800;
  font-size: 1.5rem;
  letter-spacing: -.02em;
  line-height: 1.1;
}
.hero-note {
  margin: 0;
  font-size: .84rem;
  color: var(--muted-ink);
  max-width: 30ch;
}

/* ---------- receipt blocks ---------- */
.receipt {
  margin: 0;
  border-top: 1px dotted var(--sec-rule, var(--rule-ink));
  font-size: .86rem;
}
.receipt--hero { max-width: 46ch; }
.receipt--price { max-width: 52ch; }

.rline {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: .58rem 0;
  border-bottom: 1px dotted var(--sec-rule, var(--rule-ink));
}
.rline dt {
  color: var(--sec-muted, var(--muted-ink));
  flex: 1 1 auto;
}
.rline dd {
  margin: 0;
  text-align: right;
  font-weight: 700;
  flex: 0 0 auto;
}
.rline dd a { text-decoration: none; border-bottom: 1px solid currentColor; }
.rline--total {
  border-bottom: 0;
  border-top: 2px solid currentColor;
  margin-top: .3rem;
  padding-top: .8rem;
  font-size: .95rem;
}
.rline--total dt { color: inherit; font-weight: 700; }
.closed { color: inherit; opacity: .72; }

/* ---------- band (drag to scroll) ---------- */
.bandsec { padding-bottom: clamp(3rem, 8vw, 5.5rem); }
.band {
  overflow: hidden;
  cursor: grab;
  touch-action: pan-y;
  padding-block: .4rem 1.2rem;
  user-select: none;
  -webkit-user-select: none;
}
.band.is-dragging { cursor: grabbing; }
.band-track {
  display: flex;
  gap: 1rem;
  list-style: none;
  margin: 0;
  padding: 0 var(--gut);
  width: max-content;
  will-change: transform;
}
.band-item { width: min(78vw, 340px); flex: 0 0 auto; }
.band-item img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  filter: grayscale(1) contrast(1.06);
  border: 1px solid var(--rule-paper);
}
.band-cap {
  margin: .6rem 0 0;
  font-size: .78rem;
  color: var(--muted-paper);
  display: flex;
  gap: .6rem;
  line-height: 1.45;
}
.band-cap span {
  flex: 0 0 auto;
  font-weight: 700;
  color: var(--on-paper);
  border-bottom: 2px solid var(--red);
}
.band-hint {
  font-size: .74rem;
  color: var(--muted-paper);
  margin: .2rem 0 0;
}

/* ---------- jobs list ---------- */
.jobs {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: job;
}
.job {
  padding: 1.3rem 0;
  border-top: 1px dotted var(--sec-rule);
  counter-increment: job;
}
.job:last-child { border-bottom: 1px dotted var(--sec-rule); }
.job h3 {
  font-family: var(--disp);
  font-weight: 700;
  font-size: 1.16rem;
  letter-spacing: -.015em;
  margin: 0 0 .45rem;
  display: flex;
  gap: .7rem;
  align-items: baseline;
}
.job h3::before {
  content: counter(job, decimal-leading-zero);
  font-family: var(--mono);
  font-size: .72rem;
  font-weight: 400;
  letter-spacing: .06em;
  opacity: .7;
}
.job p {
  margin: 0 0 .5rem;
  color: var(--sec-muted);
  font-size: .9rem;
  max-width: 54ch;
}
.job-meta {
  display: flex;
  gap: 1.2rem;
  font-size: .74rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--sec-fg);
  margin: 0;
}
.job-meta span { border-bottom: 1px dotted var(--sec-rule); padding-bottom: .15rem; }

/* ---------- hours table ---------- */
.hours {
  width: 100%;
  max-width: 46ch;
  border-collapse: collapse;
  font-size: .88rem;
  margin-top: .5rem;
}
.hours th, .hours td {
  text-align: left;
  padding: .62rem 0;
  border-bottom: 1px dotted var(--sec-rule);
  font-weight: 400;
}
.hours th { color: var(--sec-fg); font-weight: 700; }
.hours td { text-align: right; color: var(--sec-muted); }
.hours tr.is-closed th,
.hours tr.is-closed td { opacity: .62; }
.hours tr.is-closed td { font-style: italic; }

/* ---------- find us ---------- */
.find-grid {
  display: grid;
  gap: 1px;
  background: var(--rule-ink);
  border: 1px solid var(--rule-ink);
  margin-bottom: 2.6rem;
}
@media (min-width: 720px) {
  .find-grid { grid-template-columns: repeat(3, 1fr); }
}
.find-card {
  background: var(--ink);
  padding: 1.3rem 1.2rem 1.5rem;
}
.find-card h3 {
  font-size: .72rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted-ink);
  margin: 0 0 .7rem;
  font-weight: 400;
}
.find-big {
  font-family: var(--disp);
  font-weight: 700;
  font-size: 1.22rem;
  letter-spacing: -.015em;
  line-height: 1.2;
  margin: 0 0 .55rem;
  text-wrap: balance;
}
.find-big a { text-decoration: none; border-bottom: 2px solid var(--acid); }
.find-big a:hover { background: var(--acid); color: var(--on-acid); }
.find-sub {
  margin: 0;
  font-size: .82rem;
  color: var(--muted-ink);
}

.promise {
  border-top: 1px dotted var(--rule-ink);
  padding-top: 1.6rem;
}
.promise h3 {
  font-family: var(--disp);
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0 0 1rem;
  letter-spacing: -.015em;
}
.promise-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: .7rem;
}
.promise-list li {
  display: flex;
  gap: .8rem;
  font-size: .88rem;
  color: var(--muted-ink);
  max-width: 56ch;
}
.promise-list span {
  flex: 0 0 auto;
  font-size: .72rem;
  font-weight: 700;
  color: var(--on-ink);
  border-bottom: 2px solid var(--red);
  align-self: flex-start;
  padding-top: .18rem;
}

/* ---------- footer ---------- */
.foot {
  background: var(--paper);
  color: var(--on-paper);
  padding: clamp(2.2rem, 6vw, 3.2rem) 0 2.6rem;
  border-top: 1px dotted var(--rule-paper);
}
.foot-line {
  margin: 0 0 .5rem;
  font-size: .86rem;
}
.foot-line a { color: inherit; }
.foot-line--muted { color: var(--muted-paper); font-size: .8rem; }

.claim-banner {
  display: inline-block;
  margin: 1.4rem 0 .9rem;
  padding: .5rem .75rem;
  font-size: .76rem;
  text-decoration: none;
  color: var(--on-paper);
  background: color-mix(in srgb, var(--on-paper) 7%, transparent);
  border: 1px dotted var(--rule-paper);
}
.claim-banner:hover { background: var(--acid); color: var(--on-acid); border-color: var(--acid); }

.attribution {
  margin: 0;
  font-size: .74rem;
  color: var(--muted-paper);
}
.attribution a { color: inherit; }

/* ---------- responsive ---------- */
@media (max-width: 620px) {
  .topnav { display: none; }
  .stack span:nth-child(2) { margin-left: .9em; }
  .hero-actions { gap: 1rem; }
  .bigcall { width: 100%; }
  .hero-note { max-width: none; }
}

@media (min-width: 900px) {
  .band-item { width: 360px; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .sec > .wrap,
  .sec > .wrap--wide { animation: none; }
  .bigcall { transition: none; }
  .bigcall:hover { translate: 0 0; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}
