:root {
  --bg: #f7f9fa;
  --surface: #ecf0f2;
  --surface-2: #dde5e9;
  --tile-dark: #18262d;
  --tile-dark-2: #21333c;
  --ink: #1f3038;
  --muted: #33434b;
  --accent: #0d7480;
  --accent-hover: #095963;
  --accent-ink: #ffffff;
  --warn-bg: #3b1c1c;
  --warn-ink: #ffffff;
  --font-sans: "Switzer", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --step-small: clamp(0.84rem, 0.81rem + 0.1vw, 0.9rem);
  --step-body: clamp(1.03rem, 0.99rem + 0.2vw, 1.125rem);
  --step-lead: clamp(1.22rem, 1.08rem + 0.55vw, 1.52rem);
  --step-h2: clamp(1.65rem, 1.25rem + 1.9vw, 2.55rem);
  --step-display: clamp(2.15rem, 1.55rem + 2.8vw, 3.65rem);
  --gap: 8px;
  --pad: 24px;
  --max-w: 1416px;
}

html[lang="fa"] {
  --font-sans: "Vazirmatn", "Switzer", -apple-system, BlinkMacSystemFont, sans-serif;
}

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

html {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.52;
  letter-spacing: -0.005em;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-size: var(--step-body);
  overflow-x: clip;
}

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

a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1.5px;
  transition: color 150ms ease-out, background-color 150ms ease-out, opacity 150ms ease-out;
}

a:hover {
  color: var(--accent-hover);
}

.tile-dark a,
.tile-accent a,
[data-ui] a:not(.btn-primary):not(.btn-ghost) {
  color: #ffffff;
}

.tile-tone a {
  color: #07545e;
}

.tile-dark a:hover,
.tile-accent a:hover {
  opacity: 0.86;
}

a:focus-visible,
button:focus-visible,
select:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.tile-dark a:focus-visible,
.tile-accent a:focus-visible,
.tile-dark button:focus-visible,
.tile-accent button:focus-visible {
  outline: 2px solid #ffffff;
}

h1, h2, h3, h4 {
  margin: 0 0 0.48em;
  font-family: var(--font-sans);
  font-weight: 600;
  color: inherit;
}

h1 {
  font-size: var(--step-display);
  line-height: 0.96;
  letter-spacing: -0.038em;
}

h2 {
  font-size: var(--step-h2);
  line-height: 1.02;
  letter-spacing: -0.032em;
}

h3, h4 {
  font-size: var(--step-lead);
  line-height: 1.18;
  letter-spacing: -0.02em;
}

html[lang="fa"] h1,
html[lang="fa"] h2,
html[lang="fa"] h3 {
  letter-spacing: 0;
  line-height: 1.24;
}

p, ul, ol, dl, table, pre, blockquote {
  margin: 0 0 1rem;
}

p, li {
  max-width: 68ch;
  overflow-wrap: anywhere;
}

p:last-child, ul:last-child, ol:last-child {
  margin-bottom: 0;
}

code, pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: var(--step-small);
  direction: ltr;
  unicode-bidi: isolate;
}

p code, li code, td code, summary code {
  background: var(--surface-2);
  color: var(--ink);
  padding: 0.1em 0.35em;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.tile-dark p code,
.tile-dark li code,
.tile-dark td code {
  background: var(--tile-dark-2);
  color: #ffffff;
}

pre {
  max-width: 100%;
  background: var(--tile-dark);
  color: #ffffff;
  padding: 1rem 1.1rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.48;
}

pre code {
  background: transparent;
  color: inherit;
  padding: 0;
}

/* Frame & Board Grid */
.board-shell {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: var(--pad);
}

.top-bar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--gap);
  margin-bottom: var(--gap);
}

.brand-tile {
  background: var(--tile-dark);
  color: #ffffff;
  padding: 12px 18px;
  font-weight: 600;
  font-size: 1.05rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  min-height: 46px;
}

.nav-tile {
  background: var(--surface);
  padding: 8px 16px;
  min-height: 46px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 20px;
}

.nav-tile a {
  color: var(--ink);
  text-decoration: none;
  font-size: var(--step-small);
  font-weight: 500;
}

.nav-tile a:hover,
.nav-tile a[aria-current="page"] {
  color: var(--accent);
  text-decoration: underline;
}

.cta-tile {
  background: var(--accent);
  color: var(--accent-ink);
  padding: 12px 20px;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: var(--step-small);
  text-decoration: none;
  transition: background-color 150ms ease-out, transform 120ms ease-out;
}

.cta-tile:hover {
  background: var(--accent-hover);
  color: #ffffff;
}

.cta-tile:active,
.btn-primary:active,
.btn-ghost:active {
  transform: scale(0.98);
}

/* Section spacing per laws of craft */
.board-section {
  margin-top: clamp(88px, 9.5vw, 148px);
}

.board-section--first {
  margin-top: 0;
}

.section-head {
  margin-bottom: 16px;
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: var(--gap);
  align-items: end;
}

.section-head p {
  color: var(--muted);
  margin: 0;
}

/* 12-column well-kept board */
.tile-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--gap);
}

.tile {
  background: var(--surface);
  color: var(--ink);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
}

.tile--top {
  justify-content: flex-start;
}

.tile-white {
  background: #ffffff;
  color: var(--ink);
}

.tile-tone {
  background: var(--surface-2);
  color: var(--ink);
}

.tile-dark {
  background: var(--tile-dark);
  color: #ffffff;
}

.tile-accent {
  background: var(--accent);
  color: var(--accent-ink);
}

.tile-photo {
  padding: 0;
  position: relative;
  overflow: hidden;
  background: var(--tile-dark);
  min-height: 260px;
}

.tile-photo img {
  width: 100%;
  height: 100%;
  min-height: 260px;
  object-fit: cover;
}

.photo-strip {
  background: var(--tile-dark);
  color: #ffffff;
  padding: 7px 14px;
  font-size: var(--step-small);
  line-height: 1.3;
}

.photo-strip--accent {
  background: var(--accent);
  color: #ffffff;
}

.photo-strip--surface {
  background: var(--surface-2);
  color: var(--ink);
}

/* Span utilities */
.c-12 { grid-column: span 12; }
.c-8  { grid-column: span 8; }
.c-7  { grid-column: span 7; }
.c-6  { grid-column: span 6; }
.c-5  { grid-column: span 5; }
.c-4  { grid-column: span 4; }
.c-3  { grid-column: span 3; }
.r-2  { grid-row: span 2; }

/* Hero board */
.hero-lead {
  font-size: var(--step-lead);
  line-height: 1.38;
  color: inherit;
  margin: 0.65rem 0 1.35rem;
  max-width: 58ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: auto;
}

.btn-primary {
  background: var(--accent);
  color: #ffffff;
  padding: 13px 22px;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: var(--step-small);
  text-decoration: none;
  border: 0;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: background-color 150ms ease-out, transform 120ms ease-out;
}

.btn-primary:hover {
  background: var(--accent-hover);
  color: #ffffff;
}

.tile-accent .btn-primary {
  background: var(--tile-dark);
  color: #ffffff;
}

.btn-ghost {
  background: var(--surface-2);
  color: var(--ink);
  padding: 13px 18px;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
  font-size: var(--step-small);
  text-decoration: none;
  border: 0;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: background-color 150ms ease-out, transform 120ms ease-out;
}

.tile-dark .btn-ghost {
  background: var(--tile-dark-2);
  color: #ffffff;
}

.btn-ghost:hover {
  background: var(--ink);
  color: #ffffff;
}

.stat-big {
  font-size: clamp(2.1rem, 3.6vw, 3.4rem);
  font-weight: 600;
  line-height: 0.95;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  margin-bottom: 0.35rem;
}

.stat-note {
  font-size: var(--step-small);
  color: var(--muted);
  margin: 0;
}

.tile-dark .stat-note,
.tile-accent .stat-note,
[data-ui] .stat-note {
  color: rgba(255, 255, 255, 0.88);
}

/* Signature Shutter Image + subtle drift */
.shutter-frame {
  overflow: hidden;
}

.js-ready .shutter-frame {
  clip-path: inset(0 100% 0 0);
  transition: clip-path 1.05s cubic-bezier(0.22, 1, 0.36, 1);
}

.js-ready .shutter-frame.is-open {
  clip-path: inset(0 0 0 0);
}

.shutter-frame img {
  transform: scale(1.04);
  animation: heroDrift 18s ease-in-out infinite alternate;
}

@keyframes heroDrift {
  0%   { transform: scale(1.03) translate3d(0, 0, 0); }
  100% { transform: scale(1.09) translate3d(-1.5%, -1%, 0); }
}

/* Interactive UI panels ([data-ui]) */
[data-ui].ui-panel {
  background: var(--tile-dark);
  color: #ffffff;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

[data-ui] .ui-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

[data-ui] .ui-tab {
  background: var(--tile-dark-2);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.16);
  padding: 9px 14px;
  min-height: 40px;
  font-family: var(--font-sans);
  font-size: var(--step-small);
  font-weight: 500;
  cursor: pointer;
  transition: background-color 140ms ease-out;
}

[data-ui] .ui-tab.is-active,
[data-ui] .ui-tab:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

[data-ui] .ui-kv-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

[data-ui] .ui-kv {
  background: var(--tile-dark-2);
  padding: 12px 14px;
}

[data-ui] .ui-kv span {
  display: block;
  font-size: var(--step-small);
  color: rgba(255, 255, 255, 0.75);
  margin-bottom: 4px;
}

[data-ui] .ui-kv strong {
  display: block;
  font-size: 1rem;
  word-break: break-word;
}

[data-ui] .ui-digest-box {
  background: #101b20;
  padding: 12px 14px;
  margin-bottom: 12px;
  font-size: var(--step-small);
  word-break: break-all;
  direction: ltr;
}

[data-ui] .ui-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 10px;
}

[data-ui] input[type="text"],
[data-ui] input[type="file"],
[data-ui] select {
  width: 100%;
  min-height: 44px;
  padding: 9px 12px;
  background: #101b20;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.24);
  font-family: var(--font-sans);
  font-size: var(--step-small);
}

[data-ui] .verify-status {
  margin-top: 12px;
  padding: 12px 14px;
  background: var(--tile-dark-2);
  font-size: var(--step-small);
}

[data-ui] .verify-status.is-match {
  background: var(--accent);
  color: #ffffff;
}

[data-ui] .verify-status.is-warn {
  background: var(--warn-bg);
  color: var(--warn-ink);
}

/* Showcase 62/38 split panel */
[data-ui].showcase-split {
  display: grid;
  grid-template-columns: minmax(0, 62fr) minmax(0, 38fr);
  gap: 0;
  background: var(--tile-dark);
  color: #ffffff;
}

[data-ui] .showcase-demo {
  padding: 26px;
  background: var(--tile-dark);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

[data-ui] .showcase-controls {
  padding: 22px;
  background: var(--tile-dark-2);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

[data-ui] .ctrl-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 5px;
}

[data-ui] .ctrl-row label {
  font-size: var(--step-small);
  font-weight: 500;
}

/* Stages as one proportional bar (how-it-works) */
[data-ui].stage-bar {
  display: flex;
  gap: 6px;
  width: 100%;
  min-height: 176px;
}

[data-ui] .stage-seg {
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
}

[data-ui] .stage-seg strong {
  font-size: clamp(1.18rem, 1.7vw, 1.55rem);
  line-height: 1.1;
}

[data-ui] .stage-seg p {
  font-size: var(--step-small);
  margin: 0.65rem 0 0;
}

/* Data tables */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  background: #ffffff;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--step-small);
  margin: 0;
}

th, td {
  text-align: start;
  padding: 12px 14px;
  border-bottom: 1px solid var(--surface-2);
  vertical-align: top;
}

th {
  background: var(--surface);
  font-weight: 600;
  color: var(--ink);
}

/* Stack list (details bars) */
.bar-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bar-item {
  background: var(--surface);
}

.bar-item summary {
  list-style: none;
  padding: 16px 20px;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-weight: 500;
  cursor: pointer;
}

.bar-item summary::-webkit-details-marker {
  display: none;
}

.bar-item summary::after {
  content: "+";
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--accent);
}

.bar-item[open] summary::after {
  content: "−";
}

.bar-body {
  padding: 0 20px 20px;
  color: var(--ink);
}

/* Question index, one answer (FAQ blueprint) */
.faq-index {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: var(--gap);
  align-items: start;
}

.faq-q-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.faq-q-btn {
  width: 100%;
  text-align: start;
  background: var(--surface);
  color: var(--muted);
  border: 0;
  padding: 16px 18px;
  font-family: var(--font-sans);
  font-size: var(--step-body);
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: baseline;
  gap: 12px;
  transition: background-color 140ms ease-out, color 140ms ease-out;
}

.faq-q-dot {
  width: 8px;
  height: 8px;
  background: var(--muted);
  flex-shrink: 0;
  display: inline-block;
}

.faq-q-btn.is-active,
.faq-q-btn:hover {
  background: #ffffff;
  color: var(--ink);
}

.faq-q-btn.is-active .faq-q-dot {
  background: var(--accent);
}

.faq-answer-pane {
  background: var(--tile-dark);
  color: #ffffff;
  padding: 32px;
  position: sticky;
  top: 24px;
  min-height: 240px;
}

.faq-answer-pane h3 {
  margin-bottom: 12px;
}

.faq-answer-pane p {
  font-size: var(--step-lead);
  line-height: 1.38;
  max-width: 46ch;
}

.faq-mobile-ans {
  display: none;
  background: #ffffff;
  padding: 14px 18px 18px 38px;
  color: var(--ink);
}

/* Amazon Hardware Gear Row (asymmetric mosaic, zero uniform card-grid) */
.gear-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--gap);
}

.gear-tile {
  background: #ffffff;
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  grid-column: span 5;
}

.gear-tile:nth-child(2),
.gear-tile:nth-child(3) {
  grid-column: span 7;
  background: var(--surface);
}

.disclosure-note {
  margin-top: 10px;
  font-size: var(--step-small);
  color: var(--muted);
}

/* Compliance Adsterra Static Slots (zero popunders, full-width native) */
.ad-slot {
  margin: 22px 0;
  background: var(--surface);
  padding: 10px 12px;
  overflow: hidden;
}

.ad-leader,
.ad-300 {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 82px;
}

.ad-n {
  display: block;
  width: 100%;
}

.ad-native {
  display: block;
  width: 100%;
}

.ad-slot-label {
  display: block;
  font-size: var(--step-small);
  color: var(--muted);
  margin-bottom: 6px;
}

.ad-slot-pending {
  display: none;
}

/* Footer of tiles */
.footer-board {
  margin-top: clamp(72px, 9vw, 140px);
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--gap);
}

.footer-wordmark {
  background: var(--tile-dark);
  color: #ffffff;
  padding: 28px 24px;
  display: flex;
  align-items: flex-end;
  min-height: 200px;
}

.footer-wordmark span {
  font-size: clamp(2.6rem, 7.6vw, 6.8rem);
  font-weight: 600;
  line-height: 0.86;
  letter-spacing: -0.045em;
}

.footer-cta-tile {
  background: var(--accent);
  color: #ffffff;
  padding: 24px;
  min-height: 200px;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.footer-cta-tile strong {
  font-size: var(--step-lead);
  line-height: 1.15;
}

.footer-cta-arrow {
  align-self: flex-end;
}

.footer-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-list a {
  text-decoration: none;
  color: var(--ink);
  font-size: var(--step-small);
}

.footer-list a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.credits {
  font-size: var(--step-small);
  color: var(--muted);
  max-width: none;
  margin-top: 10px;
}

/* Motion entrance layer (>16 staggered elements, safe fallback) */
.js-ready [data-reveal] {
  opacity: 0;
  transform: translate3d(0, 20px, 0);
  transition: opacity 480ms cubic-bezier(0.22, 1, 0.36, 1), transform 480ms cubic-bezier(0.22, 1, 0.36, 1);
}

.js-ready [data-reveal].is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .js-ready [data-reveal],
  .js-ready .shutter-frame {
    opacity: 1 !important;
    transform: none !important;
    clip-path: none !important;
    transition: none !important;
  }
  .shutter-frame img {
    animation: none !important;
    transform: none !important;
  }
}

/* Tablet & Mobile Responsive Boards */
@media (max-width: 980px) {
  .top-bar {
    grid-template-columns: 1fr auto;
  }
  .nav-tile {
    grid-column: 1 / -1;
    order: 3;
  }
  .c-8, .c-7, .c-6, .c-5, .c-4, .c-3 {
    grid-column: span 6;
  }
  .c-12 {
    grid-column: span 12;
  }
  .section-head {
    grid-template-columns: 1fr;
  }
  [data-ui].showcase-split {
    grid-template-columns: 1fr;
  }
  .gear-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .gear-tile,
  .gear-tile:nth-child(2),
  .gear-tile:nth-child(3) {
    grid-column: span 1;
  }
}

@media (max-width: 680px) {
  :root {
    --pad: 18px;
    --gap: 6px;
  }
  .tile-grid,
  .footer-board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .c-12, .c-8, .c-7, .c-6, .c-5, .c-4 {
    grid-column: span 2;
  }
  .c-3 {
    grid-column: span 1;
  }
  .tile {
    padding: 18px;
  }
  [data-ui] .ui-kv-grid {
    grid-template-columns: 1fr;
  }
  [data-ui] .ui-input-row {
    grid-template-columns: 1fr;
  }
  [data-ui].stage-bar {
    flex-direction: column;
  }
  .faq-index {
    grid-template-columns: 1fr;
  }
  .faq-answer-pane {
    display: none;
  }
  .faq-item-wrap.is-open .faq-mobile-ans {
    display: block;
  }
  .gear-grid {
    grid-template-columns: 1fr;
  }
  .footer-wordmark {
    min-height: 132px;
  }
  .footer-cta-tile {
    min-height: 132px;
  }
}
