/*
 * Fitframe design tokens. One system for the website and the Mini App.
 * Concept: a studio's ruled worksheet. Warm paper, deep ink, one vermilion mark,
 * hairline rules, crop marks and dimension lines.
 */
:root {
  --paper: #f6f3ec;
  --paper-2: #eeeadf;
  --card: #ffffff;
  --ink: #0f2138;
  --ink-2: #3f4e66;
  --ink-3: #596982;
  --rule: #ddd6c5;
  --rule-2: #c8c0aa;
  --accent: #b8401e;
  --accent-ink: #ffffff;
  --accent-soft: #f5e4dc;
  --pass: #17643f;
  --pass-soft: #e3f0e8;
  --warn: #7a5200;
  --warn-soft: #f8edd0;
  --fail: #a3221a;
  --fail-soft: #f9e2df;
  --blueprint: #e7edf5;
  --blueprint-line: #8ea4c4;

  /* illustration palette */
  --ill-bg: #eceae3;
  --ill-skin: #d9a581;
  --ill-skin-shade: #c18a66;
  --ill-hair: #2a1f19;
  --ill-cloth: #1f3454;
  --ill-cloth-shade: #162844;

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --shadow-1: 0 1px 0 rgba(15, 33, 56, 0.05), 0 1px 2px rgba(15, 33, 56, 0.06);
  --shadow-2: 0 1px 0 rgba(15, 33, 56, 0.04), 0 18px 40px -18px rgba(15, 33, 56, 0.28);

  --serif: 'Source Serif 4 Variable', 'Noto Serif', Georgia, 'Times New Roman', serif;
  --sans: 'Source Sans 3 Variable', 'Noto Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --t-label: 0.72rem;
  --t-small: 0.875rem;
  --t-body: 1rem;
  --t-lead: 1.2rem;
  --t-h3: 1.2rem;
  --t-h2: 1.7rem;
  --t-h1: clamp(2.3rem, 6.4vw, 3.9rem);

  color-scheme: light;
}

:root[data-theme='dark'] {
  --paper: #0b1424;
  --paper-2: #101b30;
  --card: #14213a;
  --ink: #eef1f6;
  --ink-2: #bcc7d8;
  --ink-3: #93a2b9;
  --rule: #25344f;
  --rule-2: #34476a;
  --accent: #f08a5d;
  --accent-ink: #0b1424;
  --accent-soft: #3a2420;
  --pass: #7fd3a1;
  --pass-soft: #12301f;
  --warn: #f0c36a;
  --warn-soft: #36290d;
  --fail: #ff9a92;
  --fail-soft: #3b1816;
  --blueprint: #12213a;
  --blueprint-line: #4a648f;
  --ill-bg: #1a2740;
  --ill-skin: #d9a581;
  --ill-skin-shade: #b98563;
  --ill-hair: #1a120d;
  --ill-cloth: #d5dceb;
  --ill-cloth-shade: #b4bfd6;
  --shadow-1: 0 1px 0 rgba(0, 0, 0, 0.3);
  --shadow-2: 0 18px 40px -18px rgba(0, 0, 0, 0.7);
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --paper: #0b1424;
    --paper-2: #101b30;
    --card: #14213a;
    --ink: #eef1f6;
    --ink-2: #bcc7d8;
    --ink-3: #93a2b9;
    --rule: #25344f;
    --rule-2: #34476a;
    --accent: #f08a5d;
    --accent-ink: #0b1424;
    --accent-soft: #3a2420;
    --pass: #7fd3a1;
    --pass-soft: #12301f;
    --warn: #f0c36a;
    --warn-soft: #36290d;
    --fail: #ff9a92;
    --fail-soft: #3b1816;
    --blueprint: #12213a;
    --blueprint-line: #4a648f;
    --ill-bg: #1a2740;
    --ill-cloth: #d5dceb;
    --ill-cloth-shade: #b4bfd6;
    --ill-hair: #1a120d;
    --shadow-1: 0 1px 0 rgba(0, 0, 0, 0.3);
    --shadow-2: 0 18px 40px -18px rgba(0, 0, 0, 0.7);
    color-scheme: dark;
  }
}

:lang(ar),
:lang(fa) {
  --sans: 'Noto Sans Arabic', system-ui, sans-serif;
  --serif: 'Noto Sans Arabic', system-ui, sans-serif;
}
:lang(hi) {
  --sans: 'Noto Sans Devanagari', system-ui, sans-serif;
  --serif: 'Noto Sans Devanagari', system-ui, sans-serif;
}

/* Shared small components */
.ff-eyebrow {
  font: 600 var(--t-label) / 1 var(--sans);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
}
:lang(ar) .ff-eyebrow,
:lang(fa) .ff-eyebrow,
:lang(hi) .ff-eyebrow {
  letter-spacing: 0;
  text-transform: none;
}
.ff-num {
  font-variant-numeric: lining-nums tabular-nums;
  font-feature-settings: 'lnum', 'tnum';
}
.ff-icon {
  width: 1.25em;
  height: 1.25em;
  flex: none;
  vertical-align: -0.2em;
}

/* Specification diagram */
.ff-diagram {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}
.fd-frame {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.6;
}
.fd-zone {
  fill: var(--accent);
  fill-opacity: 0.2;
}
.fd-line {
  stroke: var(--accent);
  stroke-width: 1;
}
.fd-eye {
  stroke: var(--accent);
  stroke-width: 1.6;
  stroke-dasharray: 5 4;
}
.fd-dim line {
  stroke: var(--ink-3);
  stroke-width: 1;
}
.fd-text {
  fill: var(--ink);
  font: 600 13px var(--sans);
  font-variant-numeric: lining-nums tabular-nums;
  letter-spacing: 0.02em;
}
.fd-small {
  fill: var(--ink-2);
  font: 600 11px var(--sans);
  paint-order: stroke;
  stroke: var(--ill-bg);
  stroke-width: 3px;
}
.fd-text {
  direction: ltr;
  unicode-bidi: isolate;
}
.ff-thumb {
  display: block;
  flex: none;
}
.ff-sheet {
  display: block;
  width: 100%;
  height: auto;
}

/* Country monogram stamp */
.ff-mono {
  display: inline-grid;
  place-items: center;
  min-width: 2.4em;
  height: 2.4em;
  padding: 0 0.45em;
  border: 1.5px solid var(--ink);
  border-radius: 6px;
  font: 700 0.78rem/1 var(--sans);
  letter-spacing: 0.1em;
  color: var(--ink);
  background: var(--card);
}

/* Crop marks around a framed print */
.cropmarks {
  position: relative;
}
.cropmarks::before {
  content: '';
  position: absolute;
  inset: -9px;
  pointer-events: none;
  --m: var(--ink-3);
  background:
    linear-gradient(var(--m), var(--m)) top left / 14px 1.5px no-repeat,
    linear-gradient(var(--m), var(--m)) top left / 1.5px 14px no-repeat,
    linear-gradient(var(--m), var(--m)) top right / 14px 1.5px no-repeat,
    linear-gradient(var(--m), var(--m)) top right / 1.5px 14px no-repeat,
    linear-gradient(var(--m), var(--m)) bottom left / 14px 1.5px no-repeat,
    linear-gradient(var(--m), var(--m)) bottom left / 1.5px 14px no-repeat,
    linear-gradient(var(--m), var(--m)) bottom right / 14px 1.5px no-repeat,
    linear-gradient(var(--m), var(--m)) bottom right / 1.5px 14px no-repeat;
}
