/* SolidWork Prints, coming soon (variant B).
   Palette is exactly three tokens. Gray is for borders, surfaces and large shapes only,
   never for text on black. */

@font-face { font-family: "Anton"; font-weight: 400; font-display: swap;
  src: url("../assets/fonts/anton-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Poppins"; font-weight: 400; font-display: swap; src: url("../assets/fonts/poppins-400-latin.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 500; font-display: swap; src: url("../assets/fonts/poppins-500-latin.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 600; font-display: swap; src: url("../assets/fonts/poppins-600-latin.woff2") format("woff2"); }
@font-face { font-family: "Tajawal"; font-weight: 500; font-display: swap;
  src: url("../assets/fonts/tajawal-500-arabic.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+200C-200E, U+FB50-FDFF, U+FE70-FEFC; }
@font-face { font-family: "Tajawal"; font-weight: 500; font-display: swap;
  src: url("../assets/fonts/tajawal-500-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+2000-206F, U+20AC; }
@font-face { font-family: "Tajawal"; font-weight: 800; font-display: swap;
  src: url("../assets/fonts/tajawal-800-arabic.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+200C-200E, U+FB50-FDFF, U+FE70-FEFC; }
@font-face { font-family: "Tajawal"; font-weight: 800; font-display: swap;
  src: url("../assets/fonts/tajawal-800-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+2000-206F, U+20AC; }
@font-face { font-family: "Tajawal"; font-weight: 900; font-display: swap;
  src: url("../assets/fonts/tajawal-900-arabic.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+200C-200E, U+FB50-FDFF, U+FE70-FEFC; }
/* Metric-matched fallbacks so the swap does not shift layout. */
@font-face { font-family: "Anton Fallback"; src: local("Arial Narrow"), local("Arial"); size-adjust: 78%; ascent-override: 118%; descent-override: 28%; line-gap-override: 0%; }
@font-face { font-family: "Poppins Fallback"; src: local("Arial"); size-adjust: 106%; ascent-override: 96%; descent-override: 32%; line-gap-override: 8%; }

:root {
  --black: #181818;
  --white: #ffffff;
  --gray: #3f3f3f;

  --font-display: "Anton", "Anton Fallback", "Arial Narrow", Impact, sans-serif;
  --font-body: "Poppins", "Poppins Fallback", system-ui, sans-serif;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-expo: cubic-bezier(0.16, 1, 0.3, 1);

  --gutter: clamp(16px, 4.2vw, 64px);
  --bar-h: 64px;

  /* z-index scale */
  --z-art: 1;
  --z-bar: 20;
  --z-skip: 60;

  color-scheme: dark;
}
:root:lang(ar) {
  --font-display: "Tajawal", "Segoe UI", Tahoma, sans-serif;
  --font-body: "Tajawal", "Segoe UI", Tahoma, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: var(--black);
  color: var(--white);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.55;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  padding-inline: env(safe-area-inset-left) env(safe-area-inset-right);
}
:root:lang(ar) body { line-height: 1.7; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ico { width: 1.25em; height: 1.25em; flex: none; fill: currentColor; }
button { font: inherit; color: inherit; }
a { color: inherit; }

:focus-visible { outline: 3px solid var(--white); outline-offset: 4px; border-radius: 2px; }
a, button { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }

.skip {
  position: fixed; inset-block-start: 8px; inset-inline-start: 8px; z-index: var(--z-skip);
  background: var(--white); color: var(--black); padding: 10px 16px; font-weight: 600; text-decoration: none;
  transform: translateY(-200%);
}
.skip:focus-visible { transform: none; }

/* ---------- bar ---------- */
.bar {
  position: relative; z-index: var(--z-bar);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: var(--bar-h);
  padding-inline: var(--gutter);
  padding-block-start: env(safe-area-inset-top);
  border-block-end: 1px solid var(--gray);
}
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; min-height: 44px; }
.brand-mark { display: block; width: 44px; height: auto; }
.brand-name { font-weight: 600; font-size: 0.9375rem; letter-spacing: 0.01em; line-height: 1.1; }
.brand-name span { font-weight: 400; }

.lang {
  min-height: 44px; min-width: 44px; padding: 0 18px;
  background: transparent; border: 1.5px solid var(--white); border-radius: 999px;
  font-weight: 500; font-size: 0.9375rem; cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease, transform 160ms var(--ease-out);
}
:root:lang(ar) .lang { font-family: "Poppins", "Poppins Fallback", system-ui, sans-serif; letter-spacing: 0.01em; }
.lang:active { transform: scale(0.96); }
@media (hover: hover) and (pointer: fine) {
  .lang:hover { background: var(--white); color: var(--black); }
}

/* ---------- stage ---------- */
.stage {
  display: grid;
  grid-template-columns: minmax(0, 5.6fr) minmax(0, 6.4fr);
  align-items: center;
  column-gap: clamp(24px, 4vw, 72px);
  padding-inline: var(--gutter);
  padding-block: clamp(20px, 4vh, 56px);
  position: relative;
  overflow-x: clip;
}

.copy { position: relative; z-index: 2; }

/* Headline: a gray ghost is the "sliced preview", the white solid is what has printed so far. */
.print-title {
  position: relative;
  margin: 0 0 clamp(18px, 3vh, 32px);
  font-family: var(--font-display);
  font-weight: 400;
  font-size: min(9rem, 9.6vw);
  line-height: 0.94;
  letter-spacing: 0.005em;
  text-transform: uppercase;
  text-wrap: balance;
  overflow-wrap: normal;
}
:root:lang(ar) .print-title {
  font-weight: 900; text-transform: none; letter-spacing: 0;
  font-size: min(11rem, 11.4vw); line-height: 1.12;
}
.print-title .solid, .print-title .ghost { display: block; }
.print-title .ghost { position: absolute; inset: 0; color: var(--gray); pointer-events: none; user-select: none; }
.print-title .solid {
  position: relative;
  --pitch: 7px;
}
/* while printing, the letterforms show their layer lines; once printed they are clean */
.print-title.is-printing .solid {
  -webkit-mask-image: repeating-linear-gradient(to bottom, #000 0 calc(var(--pitch) - 1.5px), transparent calc(var(--pitch) - 1.5px) var(--pitch));
          mask-image: repeating-linear-gradient(to bottom, #000 0 calc(var(--pitch) - 1.5px), transparent calc(var(--pitch) - 1.5px) var(--pitch));
}

.lede { margin: 0 0 clamp(24px, 4vh, 36px); max-width: 34ch; font-size: clamp(1rem, 1.25vw, 1.1875rem); text-wrap: pretty; }
:root:lang(ar) .lede { font-size: clamp(1.0625rem, 1.35vw, 1.3125rem); max-width: 30ch; }

.actions { display: flex; flex-wrap: wrap; gap: 14px; }

/* ---------- buttons: tactile, like a keycap on a plate ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 22px;
  border: 2px solid var(--white); border-radius: 12px;
  font-weight: 600; font-size: 1rem; line-height: 1.1; text-decoration: none; white-space: nowrap;
  cursor: pointer;
  transition: transform 150ms var(--ease-out), box-shadow 150ms var(--ease-out), background-color 160ms ease, color 160ms ease;
}
.btn-solid { background: var(--white); color: var(--black); box-shadow: 0 5px 0 var(--gray); transform: translateY(-5px); }
.btn-solid:active { transform: translateY(-1px); box-shadow: 0 1px 0 var(--gray); }
.btn-line { background: transparent; color: var(--white); box-shadow: 0 5px 0 var(--gray); transform: translateY(-5px); }
.btn-line:active { transform: translateY(-1px); box-shadow: 0 1px 0 var(--gray); }
@media (hover: hover) and (pointer: fine) {
  .btn-solid:hover { transform: translateY(-7px); box-shadow: 0 7px 0 var(--gray); }
  .btn-solid:hover:active { transform: translateY(-1px); box-shadow: 0 1px 0 var(--gray); }
  .btn-line:hover { background: var(--white); color: var(--black); transform: translateY(-7px); box-shadow: 0 7px 0 var(--gray); }
  .btn-line:hover:active { transform: translateY(-1px); box-shadow: 0 1px 0 var(--gray); }
}
.btn[aria-disabled="true"] { opacity: 0.5; pointer-events: none; }

/* Oversized wordmark, cropped by the footer rule. A large gray shape, not text to read. */
.crop {
  display: none;
  position: absolute; z-index: 0; inset-inline: var(--gutter); inset-block-end: 0;
  height: clamp(70px, 8.6vw, 170px); overflow: hidden;
  font-family: "Anton", "Anton Fallback", "Arial Narrow", Impact, sans-serif; font-size: calc((100vw - var(--gutter) * 2) / 4.3);
  line-height: 0.86; text-transform: uppercase; white-space: nowrap; color: var(--gray); letter-spacing: 0.004em;
  pointer-events: none; user-select: none; direction: ltr; text-align: center;
}
@media (min-width: 1000px) { .crop { display: block; } }

/* ---------- art ---------- */
.art { position: relative; z-index: var(--z-art); min-width: 0; margin-inline-end: calc(var(--gutter) * -0.4); }
.rig { display: block; width: 100%; height: auto; overflow: visible; }
.rig .stripes { opacity: 0.4; transition: opacity 900ms var(--ease-out); }
.rig.is-printing .stripes { opacity: 1; }
.readout { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-block-start: 14px; min-height: 44px; padding-inline-end: calc(var(--gutter) * 0.4); }
.layer-count { margin: 0; font-weight: 500; font-size: 0.9375rem; font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
.layer-count b { font-weight: 600; display: inline-block; min-width: 2ch; text-align: center; }

.replay {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px;
  background: transparent; border: 1.5px solid var(--white); border-radius: 999px; cursor: pointer; font-weight: 500; font-size: 0.9375rem;
  transition: background-color 160ms ease, color 160ms ease, transform 150ms var(--ease-out);
}
.replay[hidden] { display: none; }
.replay:active { transform: scale(0.96); }
.replay .ico { width: 1.15em; height: 1.15em; }
@media (hover: hover) and (pointer: fine) { .replay:hover { background: var(--white); color: var(--black); } }

/* ---------- footer ---------- */
.foot {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 28px;
  padding: 14px var(--gutter) calc(14px + env(safe-area-inset-bottom));
  border-block-start: 1px solid var(--gray);
  font-size: 0.9375rem;
}
.foot p { margin: 0; }
.foot-domain { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.foot-links { display: flex; flex-wrap: wrap; gap: 4px 6px; }
.foot-links a { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 10px; text-decoration: none; border-radius: 8px; transition: background-color 160ms ease, color 160ms ease; }
.foot-links a:active { background: var(--gray); }
@media (hover: hover) and (pointer: fine) { .foot-links a:hover { background: var(--white); color: var(--black); } }
.foot-copy { font-weight: 400; }

/* ---------- entrance (CSS only, content is visible if animation never runs) ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(16px); } }
@keyframes fade { from { opacity: 0; } }
.bar { animation: fade 600ms var(--ease-out) both; }
.lede { animation: rise 700ms var(--ease-expo) 700ms both; }
.actions .btn:nth-child(1) { animation: rise-btn 700ms var(--ease-expo) 900ms both; }
.actions .btn:nth-child(2) { animation: rise-btn 700ms var(--ease-expo) 1000ms both; }
.foot { animation: fade 700ms var(--ease-out) 1100ms both; }
@keyframes rise-btn { from { opacity: 0; transform: translateY(8px); } }

/* Before JS marks the page ready, hide the art for at most 2s so it never flashes its final state. */
.js:not(.ready) .rig, .js:not(.ready) .print-title .solid { opacity: 0; animation: failsafe 0s 2s forwards; }
@keyframes failsafe { to { opacity: 1; } }

/* ---------- small screens: art first, then copy ---------- */
@media (max-width: 999px) {
  .stage { grid-template-columns: minmax(0, 1fr); row-gap: 10px; align-content: center; padding-block: 16px 28px; }
  .art { order: -1; margin-inline: calc(var(--gutter) * -0.2); }
  .readout { padding-inline: calc(var(--gutter) * 0.2); margin-block-start: 8px; }
  .print-title { font-size: clamp(4.25rem, 22vw, 7.5rem); }
  :root:lang(ar) .print-title { font-size: clamp(4.75rem, 25vw, 8.5rem); }
  .lede { max-width: 38ch; }
  .actions .btn { flex: 1 1 auto; }
}
@media (max-width: 560px) {
  .actions { gap: 12px; }
  .actions .btn { width: 100%; min-height: 48px; }
  .stage { padding-block: 8px 18px; }
  .lede { margin-block-end: 20px; }
  .foot { gap: 0 12px; padding-block: 6px calc(8px + env(safe-area-inset-bottom)); font-size: 0.875rem; }
  .foot-links { order: 1; width: 100%; justify-content: space-between; margin-inline: -10px; width: calc(100% + 20px); }
  .foot-links a { padding: 0 8px; gap: 6px; }
  .foot-domain { order: 2; min-height: 34px; }
  .foot-copy { order: 3; }
}
@media (max-height: 560px) and (min-width: 1000px) {
  .print-title { font-size: min(6rem, 9vw); }
}

/* ---------- reduced motion: everything is already in its final state ---------- */
@media (prefers-reduced-motion: reduce) {
  .bar, .lede, .actions .btn, .foot { animation: none !important; }
  .btn-solid, .btn-line { transform: translateY(-5px); transition: background-color 160ms ease, color 160ms ease; }
  .btn-solid:hover, .btn-line:hover { transform: translateY(-5px); }
  .btn:active { transform: translateY(-1px); }
  .js:not(.ready) .rig, .js:not(.ready) .print-title .solid { animation-duration: 0.01ms; animation-delay: 0.01ms; }
}
