/* ==========================================================================
   Soroosh Theme — Portfolio
   Design system + components
   ========================================================================== */

/* ---------- 1. Tokens ---------- */
:root, [data-theme="dark"] {
  color-scheme: dark;

  --bg:            #06070d;
  --bg-2:          #0a0c16;
  --bg-rgb:        6, 7, 13;
  --surface:       rgba(255, 255, 255, .034);
  --surface-2:     rgba(255, 255, 255, .055);
  --stroke:        rgba(255, 255, 255, .09);
  --stroke-strong: rgba(255, 255, 255, .16);

  --card-bg:       linear-gradient(170deg, rgba(255,255,255,.045), rgba(255,255,255,.014));
  --card-bg-2:     linear-gradient(160deg, rgba(255,255,255,.055), rgba(255,255,255,.012));

  --text:          #e8eaf2;
  --text-dim:      #a2abc2;
  --text-mute:     #6c7590;

  --cyan:          #22d3ee;
  --violet:        #8b5cf6;
  --indigo:        #6366f1;
  --mint:          #42e8a4;
  --coral:         #f0715a;

  --on-grad:       #05060b;
  --grid-line:     rgba(255, 255, 255, .028);
  --aurora-op:     .3;
  --grain-op:      .028;
  --dot-rgb:       140, 170, 255;
  --link-rgb:      99, 102, 241;

  /* client logos: lift dark marks out of a dark background */
  --logo-filter:       grayscale(1) brightness(2.4) contrast(.62) opacity(.55);
  --media-fade:        linear-gradient(to top, rgba(6,7,13,1) 2%, rgba(6,7,13,.35) 46%, transparent 82%);

  --grad: linear-gradient(110deg, var(--cyan) 0%, var(--indigo) 48%, var(--violet) 100%);

  --font-display: "Space Grotesk", "Vazirmatn", ui-sans-serif, system-ui, sans-serif;
  --font-body:    "Inter", "Vazirmatn", ui-sans-serif, system-ui, sans-serif;
  /* Vazirmatn sits after JetBrains Mono: Latin stays monospaced, while Persian
     characters (which JetBrains Mono lacks) fall back to a font that shapes
     contextual letter joining correctly instead of a broken system default. */
  --font-mono:    "JetBrains Mono", "Vazirmatn", ui-monospace, SFMono-Regular, Menlo, monospace;

  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 24px;
  --r-xl: 32px;

  --shell: 1180px;
  --gut: clamp(20px, 5vw, 48px);

  --ease: cubic-bezier(.22, 1, .36, 1);
  --ease-io: cubic-bezier(.65, 0, .35, 1);
}

/* ---------- 1b. Light theme ---------- */
[data-theme="light"] {
  color-scheme: light;

  --bg:            #f7f8fc;
  --bg-2:          #eef1f8;
  --bg-rgb:        247, 248, 252;
  --surface:       rgba(10, 14, 30, .035);
  --surface-2:     rgba(10, 14, 30, .06);
  --stroke:        rgba(10, 14, 30, .11);
  --stroke-strong: rgba(10, 14, 30, .2);

  --card-bg:       linear-gradient(170deg, rgba(255,255,255,.95), rgba(255,255,255,.72));
  --card-bg-2:     linear-gradient(160deg, rgba(255,255,255,.96), rgba(255,255,255,.75));

  --text:          #0d1226;
  --text-dim:      #414c66;
  --text-mute:     #6b7590;

  /* deepened so they stay legible on a light surface */
  --cyan:          #0891b2;
  --violet:        #7c3aed;
  --indigo:        #4f46e5;
  --mint:          #059669;
  --coral:         #dc4a2f;

  --on-grad:       #ffffff;
  --grid-line:     rgba(10, 14, 30, .045);
  --aurora-op:     .16;
  --grain-op:      .015;
  --dot-rgb:       90, 105, 170;
  --link-rgb:      99, 102, 241;

  /* darken instead of lighten so marks read against a white tile */
  --logo-filter:       grayscale(1) brightness(.45) contrast(1.1) opacity(.66);
  --media-fade:        linear-gradient(to top, rgba(255,255,255,1) 2%, rgba(255,255,255,.45) 46%, transparent 82%);
}

[dir="rtl"] {
  --font-display: "Vazirmatn", "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --font-body:    "Vazirmatn", "Inter", ui-sans-serif, system-ui, sans-serif;
}

/* smooth cross-fade when switching themes */
html.theme-anim, html.theme-anim body,
html.theme-anim .nav, html.theme-anim .cap,
html.theme-anim .bio-card, html.theme-anim .contact-wrap,
html.theme-anim .client, html.theme-anim .link-row,
html.theme-anim .field input, html.theme-anim .field textarea,
html.theme-anim .chip, html.theme-anim .mini-btn,
html.theme-anim .tabs, html.theme-anim .lang,
html.theme-anim .theme-btn, html.theme-anim .card-code,
html.theme-anim .foot {
  transition: background-color .45s var(--ease), color .45s var(--ease),
              border-color .45s var(--ease), background-image .45s var(--ease) !important;
}

/* ---------- 2. Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 104px;
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  min-height: 100vh;
}

body.is-booting { overflow: hidden; }

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; color: inherit; }
ul { list-style: none; padding: 0; }

::selection { background: rgba(139, 92, 246, .38); color: #fff; }

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(var(--indigo), var(--violet));
  border-radius: 99px;
  border: 2px solid var(--bg);
}

/* ---------- 3. Ambient layers ---------- */
.bg-canvas {
  position: fixed; inset: 0;
  z-index: 0; pointer-events: none;
  opacity: .75;
}
[data-theme="light"] .bg-canvas { opacity: .5; }

.aurora {
  position: fixed; inset: 0;
  z-index: 0; pointer-events: none;
  overflow: hidden;
}
.aurora span {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: var(--aurora-op);
  will-change: transform;
}
.aurora span:nth-child(1) {
  width: 46vw; height: 46vw; top: -14vw; inset-inline-end: -10vw;
  background: radial-gradient(circle, var(--indigo), transparent 66%);
  animation: drift 26s var(--ease-io) infinite alternate;
}
.aurora span:nth-child(2) {
  width: 38vw; height: 38vw; top: 44vh; inset-inline-start: -12vw;
  background: radial-gradient(circle, var(--cyan), transparent 66%);
  opacity: calc(var(--aurora-op) * .67);
  animation: drift 32s var(--ease-io) infinite alternate-reverse;
}
.aurora span:nth-child(3) {
  width: 42vw; height: 42vw; bottom: -16vw; inset-inline-end: 12vw;
  background: radial-gradient(circle, var(--violet), transparent 66%);
  opacity: calc(var(--aurora-op) * .73);
  animation: drift 38s var(--ease-io) infinite alternate;
}
@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(4vw, 6vh, 0) scale(1.18); }
}

.grid-veil {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 68px 68px;
  mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 20%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 20%, transparent 78%);
}

.grain {
  position: fixed; inset: 0; z-index: 3; pointer-events: none;
  opacity: var(--grain-op); mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.cursor-glow {
  position: fixed; top: 0; left: 0;
  width: 460px; height: 460px;
  margin: -230px 0 0 -230px;
  border-radius: 50%;
  pointer-events: none; z-index: 1;
  background: radial-gradient(circle, rgba(99,102,241,.13), rgba(34,211,238,.05) 42%, transparent 68%);
  opacity: 0;
  transition: opacity .5s;
  will-change: transform;
}
@media (pointer: fine) { .cursor-glow.on { opacity: 1; } }

/* ---------- 4. Layout ---------- */
.shell {
  width: min(100% - (var(--gut) * 2), var(--shell));
  margin-inline: auto;
}

main { position: relative; z-index: 2; }

section { position: relative; padding-block: clamp(56px, 6.5vw, 88px); }

.sec-head { margin-bottom: clamp(30px, 4vw, 46px); max-width: 720px; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-mono);
  font-size: 12px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--cyan);
  padding: 7px 14px;
  border: 1px solid rgba(34,211,238,.24);
  border-radius: 99px;
  background: rgba(34,211,238,.06);
  margin-bottom: 22px;
}
.eyebrow::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--cyan); box-shadow: 0 0 10px var(--cyan);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .28; } }

h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.1; font-weight: 600; letter-spacing: -.02em; }

.sec-title {
  font-size: clamp(30px, 5vw, 50px);
  margin-bottom: 18px;
}
.sec-sub { color: var(--text-dim); font-size: clamp(15px, 1.6vw, 17.5px); max-width: 62ch; }

.grad-text {
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}

/* ---------- 5. Buttons ---------- */
.btn {
  --btn-bg: var(--surface);
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 14px 26px;
  border-radius: 99px;
  border: 1px solid var(--stroke-strong);
  background: var(--btn-bg);
  font-weight: 600; font-size: 14.5px;
  letter-spacing: .01em;
  cursor: pointer;
  overflow: hidden;
  transition: transform .35s var(--ease), border-color .35s, box-shadow .35s, background .35s;
  will-change: transform;
}
.btn svg { width: 17px; height: 17px; flex: none; }
.btn:hover { border-color: var(--stroke-strong); box-shadow: 0 12px 40px -14px rgba(99,102,241,.7); }
.btn:active { transform: scale(.97); }

.btn--primary {
  border-color: transparent;
  background: var(--grad);
  color: var(--on-grad);
  font-weight: 700;
}
.btn--primary::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.55) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform .85s var(--ease);
}
.btn--primary:hover::after { transform: translateX(120%); }
.btn--primary:hover { box-shadow: 0 16px 46px -12px rgba(139,92,246,.85); }

.btn--ghost { background: var(--surface); }

/* ---------- 6. Boot / intro sequence ---------- */
#boot {
  position: fixed; inset: 0; z-index: 999;
  display: grid; place-items: center;
  background: radial-gradient(ellipse 80% 60% at 50% 40%, #0b0e1c 0%, #06070d 62%);
  color: #e8eaf2;
  padding: var(--gut);
  transition: opacity .8s var(--ease), transform .8s var(--ease), filter .8s var(--ease);
}
#boot.done {
  opacity: 0; pointer-events: none;
  transform: scale(1.06);
  filter: blur(14px);
}
#boot::before {
  content: ""; position: absolute; inset: 0;
  background-image: repeating-linear-gradient(0deg, rgba(255,255,255,.035) 0 1px, transparent 1px 3px);
  pointer-events: none; opacity: .55;
}

.boot-flash {
  position: fixed; inset: 0; z-index: 1000; pointer-events: none;
  background: radial-gradient(circle at 50% 50%, rgba(180,220,255,.9), rgba(99,102,241,.32) 42%, transparent 70%);
  opacity: 0;
}
.boot-flash.fire { animation: flashout .75s var(--ease) forwards; }
@keyframes flashout {
  0% { opacity: 0; transform: scale(.85); }
  18% { opacity: .95; }
  100% { opacity: 0; transform: scale(1.5); }
}

/* Code surfaces stay dark in BOTH themes — syntax highlighting is tuned for a
   dark editor, and a dark code block on a light page is the familiar pattern.
   Local token overrides keep their inner text legible under the light theme. */
[data-theme="light"] .term,
[data-theme="light"] .card-code {
  --text:      #e8eaf2;
  --text-dim:  #a2abc2;
  --text-mute: #8892ab;
  --stroke:        rgba(255, 255, 255, .1);
  --stroke-strong: rgba(255, 255, 255, .18);
  --surface:       rgba(255, 255, 255, .04);
  --surface-2:     rgba(255, 255, 255, .07);
  color: #e8eaf2;
}
[data-theme="light"] .card-code {
  background: linear-gradient(165deg, #141830 0%, #0b0e1c 100%);
  box-shadow: 0 30px 70px -30px rgba(20, 24, 60, .55),
              0 0 60px -40px rgba(99, 102, 241, .5);
}
[data-theme="light"] .card-code__out { background: rgba(34, 211, 238, .08); }

.term {
  width: min(100%, 720px);
  direction: ltr; /* code always reads left-to-right */
  border: 1px solid var(--stroke);
  border-radius: var(--r-md);
  background: linear-gradient(180deg, rgba(18,21,38,.96), rgba(9,11,22,.98));
  box-shadow: 0 40px 120px -30px rgba(0,0,0,.9), 0 0 0 1px rgba(255,255,255,.04) inset,
              0 0 90px -40px rgba(99,102,241,.7);
  overflow: hidden;
  position: relative;
}
.term__bar {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--stroke);
  background: var(--surface);
}
.term__dot { width: 11px; height: 11px; border-radius: 50%; }
.term__dot:nth-child(1) { background: #ff5f57; }
.term__dot:nth-child(2) { background: #febc2e; }
.term__dot:nth-child(3) { background: #28c840; }
.term__file {
  margin-inline-start: 12px;
  font-family: var(--font-mono); font-size: 12.5px; color: var(--text-mute);
}
.term__body {
  padding: 22px clamp(16px, 3vw, 26px) 26px;
  font-family: var(--font-mono);
  font-size: clamp(11.5px, 1.55vw, 13.5px);
  line-height: 1.85;
  min-height: 300px;
}
.term__code { white-space: pre-wrap; word-break: break-word; }

.caret {
  display: inline-block;
  width: 8px; height: 1.05em;
  background: var(--cyan);
  vertical-align: text-bottom;
  box-shadow: 0 0 10px var(--cyan);
  animation: blink 1s steps(2) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* code token colors */
.t-kw   { color: #c084fc; }
.t-str  { color: #7dd3a0; }
.t-fn   { color: #62d5f5; }
.t-prop { color: #f0b46a; }
.t-num  { color: #f0715a; }
.t-com  { color: #556080; font-style: italic; }
.t-pun  { color: #7c88a8; }
.t-op   { color: #d580d5; }
.t-id   { color: #d3d9ec; }

.term__log { margin-top: 18px; display: grid; gap: 7px; }
.log-line {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: 12.5px;
  color: var(--text-dim);
  opacity: 0; transform: translateY(6px);
  animation: logIn .4s var(--ease) forwards;
}
@keyframes logIn { to { opacity: 1; transform: none; } }
.log-line b { color: var(--mint); font-weight: 500; }
.log-line i { color: var(--text-mute); font-style: normal; margin-inline-start: auto; }
.log-tag {
  font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 5px;
  background: rgba(66,232,164,.13); color: var(--mint);
  border: 1px solid rgba(66,232,164,.22);
}

.boot-bar {
  margin-top: 22px; height: 3px; border-radius: 99px;
  background: var(--surface-2); overflow: hidden;
}
.boot-bar span {
  display: block; height: 100%; width: 0%;
  background: var(--grad);
  box-shadow: 0 0 14px rgba(34,211,238,.8);
  transition: width .3s linear;
}

.boot-skip {
  position: absolute; inset-block-end: clamp(22px, 5vh, 46px);
  inset-inline-end: clamp(20px, 5vw, 48px);
  font-family: var(--font-mono); font-size: 12px;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--text-mute);
  background: none; border: 1px solid var(--stroke);
  padding: 9px 16px; border-radius: 99px; cursor: pointer;
  transition: color .3s, border-color .3s, background .3s;
}
.boot-skip:hover { color: var(--text); border-color: var(--stroke-strong); background: var(--surface); }

/* ---------- 7. Nav ---------- */
.nav {
  position: fixed; inset-inline: 0; top: 0; z-index: 90;
  padding: 18px var(--gut);
  transition: padding .4s var(--ease), background .4s, backdrop-filter .4s, border-color .4s;
  border-bottom: 1px solid transparent;
}
.nav.stuck {
  padding-block: 11px;
  background: rgba(var(--bg-rgb), .72);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  border-bottom-color: var(--stroke);
}
.nav__in {
  width: min(100%, var(--shell)); margin-inline: auto;
  display: flex; align-items: center; gap: 20px;
}

.brand { display: flex; align-items: center; gap: 11px; font-family: var(--font-display); font-weight: 700; letter-spacing: -.01em; }
.brand__mark {
  width: 36px; height: 36px; border-radius: 50%; flex: none;
  object-fit: cover;
  background: var(--grad);
  padding: 2px;
  box-shadow: 0 8px 26px -8px rgba(99,102,241,.9);
  transition: transform .4s var(--ease), box-shadow .4s;
}
.brand:hover .brand__mark {
  transform: scale(1.06);
  box-shadow: 0 10px 30px -8px rgba(139,92,246,1);
}
.brand__txt { font-size: 15.5px; }
.brand__txt small { display: block; font-size: 10.5px; font-weight: 500; color: var(--text-mute); font-family: var(--font-mono); letter-spacing: .06em; }

.tabs {
  position: relative;
  display: flex; align-items: center; gap: 2px;
  margin-inline: auto;
  padding: 5px;
  border: 1px solid var(--stroke);
  border-radius: 99px;
  background: var(--surface);
  backdrop-filter: blur(10px);
}
.tabs__pill {
  position: absolute; top: 5px; bottom: 5px; left: 0;
  border-radius: 99px;
  background: var(--surface-2);
  border: 1px solid var(--stroke);
  box-shadow: 0 6px 22px -10px rgba(99,102,241,.9);
  transition: transform .48s var(--ease), width .48s var(--ease), opacity .3s;
  opacity: 0;
  will-change: transform, width;
}
.tab {
  position: relative; z-index: 1;
  padding: 9px 17px;
  border-radius: 99px;
  font-size: 13.5px; font-weight: 500;
  color: var(--text-mute);
  white-space: nowrap;
  transition: color .3s;
}
.tab:hover { color: var(--text-dim); }
.tab.active { color: var(--text); }

.nav__side { display: flex; align-items: center; gap: 10px; margin-inline-start: auto; }

.theme-btn {
  width: 40px; height: 40px; flex: none;
  display: grid; place-items: center;
  border: 1px solid var(--stroke); border-radius: 50%;
  background: var(--surface);
  color: var(--text-dim);
  cursor: pointer; position: relative; overflow: hidden;
  transition: color .3s, border-color .3s, background .3s, transform .4s var(--ease);
}
.theme-btn:hover { color: var(--text); border-color: var(--stroke-strong); transform: rotate(18deg) scale(1.06); }
.theme-btn svg { width: 18px; height: 18px; grid-area: 1 / 1; transition: transform .5s var(--ease), opacity .35s; }
/* dark theme shows the sun (what you'd switch TO); light shows the moon */
.ic-moon { opacity: 0; transform: rotate(-70deg) scale(.4); }
[data-theme="light"] .ic-sun  { opacity: 0; transform: rotate(70deg) scale(.4); }
[data-theme="light"] .ic-moon { opacity: 1; transform: none; }

.lang {
  display: flex; padding: 4px;
  border: 1px solid var(--stroke); border-radius: 99px;
  background: var(--surface);
}
.lang button {
  padding: 6px 12px; border: 0; border-radius: 99px; background: none;
  font-family: var(--font-mono); font-size: 11.5px; font-weight: 500;
  letter-spacing: .08em; color: var(--text-mute); cursor: pointer;
  transition: color .3s, background .3s;
}
.lang button.on { color: var(--on-grad); background: var(--grad); font-weight: 700; }

.nav__cta { padding: 11px 20px; font-size: 13.5px; }

/* hidden on desktop — enabled in the ≤1080px block */
.mobile-menu { display: none; }

.burger {
  display: none;
  width: 42px; height: 42px; border-radius: 12px;
  border: 1px solid var(--stroke); background: var(--surface);
  cursor: pointer;
  position: relative;
}
.burger span {
  position: absolute; inset-inline: 11px; height: 1.5px; background: var(--text);
  transition: transform .35s var(--ease), opacity .25s;
}
.burger span:nth-child(1) { top: 15px; }
.burger span:nth-child(2) { top: 20.5px; }
.burger span:nth-child(3) { top: 26px; }
.burger.open span:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
.burger.open span:nth-child(2) { opacity: 0; }
.burger.open span:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }

/* ---------- 8. Hero ---------- */
.hero {
  min-height: 100svh;
  display: flex; align-items: center;
  padding-block: 128px 64px;
}
.hero__grid {
  display: grid; grid-template-columns: 1.06fr .94fr;
  gap: clamp(36px, 5vw, 68px); align-items: center;
}

.hero__status {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--font-mono); font-size: 12px;
  color: var(--mint);
  padding: 7px 15px; border-radius: 99px;
  border: 1px solid rgba(66,232,164,.26);
  background: rgba(66,232,164,.07);
  margin-bottom: 26px;
}
.hero__status .dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--mint);
  box-shadow: 0 0 0 0 rgba(66,232,164,.6);
  animation: ripple 2.2s infinite;
}
@keyframes ripple {
  0%   { box-shadow: 0 0 0 0 rgba(66,232,164,.55); }
  70%  { box-shadow: 0 0 0 9px rgba(66,232,164,0); }
  100% { box-shadow: 0 0 0 0 rgba(66,232,164,0); }
}

.hero h1 {
  font-size: clamp(38px, 5.6vw, 68px);
  line-height: 1.04;
  letter-spacing: -.035em;
  margin-bottom: 20px;
}
.hero h1 .line { display: block; overflow: hidden; }
/* Persian renders wider than Latin — ease the size so the name stays on one line */
[dir="rtl"] .hero h1 { font-size: clamp(32px, 4.6vw, 56px); line-height: 1.32; }
[dir="rtl"] .hero h1 .line { overflow: visible; }
.hero h1 .line > span {
  display: block;
  transform: translateY(105%);
  transition: transform 1s var(--ease);
}
.revealed .hero h1 .line > span { transform: none; }
.hero h1 .line:nth-child(2) > span { transition-delay: .1s; }

.hero__role {
  font-family: var(--font-mono);
  font-size: clamp(14px, 2vw, 19px);
  color: var(--text-dim);
  margin-bottom: 22px;
  min-height: 1.7em;
}
.hero__role .rot { color: var(--cyan); }
.hero__role .rot::after {
  content: "▍"; color: var(--violet);
  animation: blink 1s steps(2) infinite;
  margin-inline-start: 2px;
}
/* RTL cross-fades whole words instead of typing, so no caret.
   Also swap off the mono face — JetBrains Mono has no Persian glyphs,
   which breaks contextual letter joining. */
[dir="rtl"] .hero__role .rot::after { content: none; }
[dir="rtl"] .hero__role { font-family: var(--font-body); }
[dir="rtl"] .hero__role .rot { font-weight: 600; }

.hero__desc {
  color: var(--text-dim);
  font-size: clamp(15px, 1.7vw, 17.5px);
  max-width: 52ch;
  margin-bottom: 34px;
}
.hero__desc b { color: var(--text); font-weight: 600; }

.hero__actions { display: flex; flex-wrap: wrap; gap: 13px; margin-bottom: 46px; }

.stats {
  display: grid; grid-template-columns: repeat(4, auto);
  gap: clamp(18px, 3.4vw, 40px);
  justify-content: start;
  padding-top: 30px;
  border-top: 1px solid var(--stroke);
}
.stat__n {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(24px, 3.4vw, 34px);
  line-height: 1;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stat__l {
  font-size: 11.5px; letter-spacing: .09em; text-transform: uppercase;
  color: var(--text-mute); margin-top: 8px; font-family: var(--font-mono);
}
[dir="rtl"] .stat__l { letter-spacing: 0; }

/* hero code card */
.card-code {
  border: 1px solid var(--stroke);
  border-radius: var(--r-lg);
  background: linear-gradient(165deg, rgba(20,24,44,.9), rgba(9,11,22,.92));
  box-shadow: 0 40px 100px -34px rgba(0,0,0,.95), 0 0 70px -40px rgba(99,102,241,.8);
  overflow: hidden;
  position: relative;
  transform-style: preserve-3d;
}
.card-code::before {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px;
  background: linear-gradient(150deg, rgba(34,211,238,.5), transparent 34%, transparent 66%, rgba(139,92,246,.5));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  pointer-events: none;
}
/* code + window chrome always read left-to-right, even inside an RTL page */
.card-code .term__bar,
.card-code__body { direction: ltr; }

.card-code__body {
  padding: 20px clamp(16px, 2.4vw, 24px);
  font-family: var(--font-mono);
  font-size: clamp(11px, 1.15vw, 12.8px);
  line-height: 1.85;
  white-space: pre;
  overflow-x: auto;
}
.card-code__out {
  display: flex; align-items: center; gap: 13px;
  padding: 16px clamp(16px, 2.4vw, 24px);
  border-top: 1px solid var(--stroke);
  background: rgba(34,211,238,.045);
}
.card-code__out .av {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  object-fit: cover;
  background: var(--grad); padding: 2px;
}
.card-code__out p { font-size: 13.5px; }
.card-code__out p small { display: block; font-family: var(--font-mono); font-size: 10.5px; color: var(--text-mute); letter-spacing: .06em; }

.scroll-hint {
  position: absolute; inset-inline: 0; bottom: 26px;
  display: flex; flex-direction: column; align-items: center; gap: 9px;
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .2em;
  text-transform: uppercase; color: var(--text-mute);
}
.scroll-hint .rail {
  width: 1px; height: 42px;
  background: linear-gradient(var(--cyan), transparent);
  animation: railGo 2.2s ease-in-out infinite;
  transform-origin: top;
}
@keyframes railGo { 0%,100% { transform: scaleY(.3); opacity: .4; } 50% { transform: scaleY(1); opacity: 1; } }

/* ---------- 9. Capability cards ---------- */
.caps { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(18px, 2.4vw, 26px); }

.cap {
  position: relative;
  border: 1px solid var(--stroke);
  border-radius: var(--r-lg);
  background: var(--card-bg);
  overflow: hidden;
  transition: transform .5s var(--ease), border-color .45s, box-shadow .45s;
  will-change: transform;
}
.cap::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  border-radius: inherit;
  background: radial-gradient(340px circle at var(--mx, 50%) var(--my, 0%), rgba(99,102,241,.18), transparent 62%);
  opacity: 0; transition: opacity .45s;
}
.cap:hover { border-color: var(--stroke-strong); box-shadow: 0 34px 80px -38px rgba(99,102,241,.85); }
.cap:hover::after { opacity: 1; }

.cap__media { position: relative; aspect-ratio: 16 / 8.6; overflow: hidden; background: var(--bg-2); }
.cap__media img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 1.1s var(--ease), filter .6s;
  filter: saturate(1.05);
}
.cap:hover .cap__media img { transform: scale(1.07); }
.cap__media::after {
  content: ""; position: absolute; inset: 0;
  background: var(--media-fade);
}
/* The badge sits on the artwork, which is dark in BOTH themes — so it keeps
   a dark plate and light text rather than following the page background. */
.cap__idx {
  position: absolute; top: 16px; inset-inline-start: 16px; z-index: 2;
  font-family: var(--font-mono); font-size: 11.5px; font-weight: 600;
  padding: 5px 11px; border-radius: 8px;
  background: rgba(6, 7, 13, .68);
  border: 1px solid rgba(255, 255, 255, .16);
  color: #67e8f9;
  backdrop-filter: blur(8px);
  letter-spacing: .04em;
}
.cap__body { padding: clamp(22px, 2.6vw, 30px) clamp(20px, 2.6vw, 28px) clamp(24px, 2.8vw, 30px); position: relative; z-index: 2; }
.cap__body h3 { font-size: clamp(19px, 2.1vw, 23px); margin-bottom: 11px; }
.cap__body p { color: var(--text-dim); font-size: 14.8px; }
.cap__body p a { color: var(--cyan); border-bottom: 1px solid rgba(34,211,238,.32); transition: border-color .3s; }
.cap__body p a:hover { border-bottom-color: var(--cyan); }

.chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 18px; }
.chip {
  font-family: var(--font-mono); font-size: 11px;
  padding: 5px 11px; border-radius: 7px;
  border: 1px solid var(--stroke);
  background: var(--surface);
  color: var(--text-mute);
  transition: color .3s, border-color .3s;
}
.cap:hover .chip { color: var(--text-dim); border-color: var(--stroke-strong); }

/* ---------- 10. About ---------- */
.about { display: grid; grid-template-columns: 1fr 1.15fr; gap: clamp(36px, 5vw, 72px); align-items: start; }

.bio-card {
  border: 1px solid var(--stroke); border-radius: var(--r-lg);
  background: var(--card-bg);
  padding: clamp(24px, 3vw, 34px);
  position: sticky; top: 116px;
}
.bio-card__top { display: flex; align-items: center; gap: 15px; margin-bottom: 22px; }
.bio-av {
  width: 60px; height: 60px; border-radius: 50%; flex: none;
  object-fit: cover;
  background: var(--grad); padding: 2.5px;
  box-shadow: 0 14px 34px -12px rgba(139,92,246,.9);
}
.bio-card h3 { font-size: 20px; }
.bio-card__top p { font-family: var(--font-mono); font-size: 12px; color: var(--text-mute); }
.bio-card > p { color: var(--text-dim); font-size: 15px; margin-bottom: 14px; }
.bio-meta { display: grid; gap: 11px; margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--stroke); }
.bio-meta div { display: flex; align-items: center; gap: 11px; font-size: 13.5px; color: var(--text-dim); }
.bio-meta svg { width: 16px; height: 16px; color: var(--cyan); flex: none; }

.tl-group + .tl-group { margin-top: 34px; }
.tl-group > h3 {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .18em;
  text-transform: uppercase; color: var(--text-mute); font-weight: 500;
  margin-bottom: 24px;
}
[dir="rtl"] .tl-group > h3 { letter-spacing: 0; }
.tl-group > h3::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--stroke), transparent); }

.tl { position: relative; padding-inline-start: 30px; }
.tl::before {
  content: ""; position: absolute; inset-inline-start: 5px; top: 8px; bottom: 8px; width: 1px;
  background: linear-gradient(180deg, var(--cyan), var(--violet), transparent);
  opacity: .45;
}
.tl li { position: relative; padding-block: 12px; }
.tl li::before {
  content: ""; position: absolute; inset-inline-start: -30px; top: 20px;
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--cyan);
  box-shadow: 0 0 0 4px rgba(34,211,238,.1);
  transition: background .35s, box-shadow .35s, border-color .35s;
}
.tl li:hover::before { background: var(--cyan); box-shadow: 0 0 0 6px rgba(34,211,238,.16); }
.tl h4 { font-size: 16.5px; margin-bottom: 3px; }
.tl p { color: var(--text-mute); font-size: 13.6px; font-family: var(--font-mono); }

/* ---------- 11. Clients ---------- */
/* The whole rail is pinned LTR. Logos are direction-agnostic, and in an RTL
   parent a max-content row anchors to the RIGHT edge — which made the
   translateX(-50%) loop slide the track off-screen and leave gaps. */
.marquee { position: relative; overflow: hidden; padding-block: 4px; direction: ltr; }
.marquee::before, .marquee::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: clamp(50px, 10vw, 130px); z-index: 2; pointer-events: none;
}
.marquee::before { left: 0; background: linear-gradient(to right, var(--bg), transparent); }
.marquee::after  { right: 0; background: linear-gradient(to left, var(--bg), transparent); }

.marquee__row { display: flex; width: max-content; }
.marquee__row:hover { animation-play-state: paused; }
.marquee__row + .marquee__row { margin-top: 16px; }
.marquee__row.l { animation: slideL var(--dur, 46s) linear infinite; }
.marquee__row.r { animation: slideR var(--dur, 52s) linear infinite; }
@keyframes slideL { to { transform: translateX(-50%); } }
@keyframes slideR { from { transform: translateX(-50%); } to { transform: none; } }

.client {
  flex: none;
  width: clamp(150px, 17vw, 196px); height: clamp(84px, 9.4vw, 106px);
  margin-inline-end: 16px;
  /* flex centring beats grid here: it keeps the logo optically centred even
     when the name ribbon is absolutely positioned over the bottom edge */
  display: flex; align-items: center; justify-content: center;
  padding: 16px 20px;
  border: 1px solid var(--stroke); border-radius: var(--r-md);
  background: var(--surface);
  position: relative; overflow: hidden;
  transition: border-color .4s, background .4s, transform .4s var(--ease);
}
/* Logos vary wildly in aspect ratio (wide wordmarks vs. tall crests), so cap
   BOTH axes and let object-fit letterbox instead of cropping the artwork. */
.client img {
  display: block;
  width: 100%; height: 100%;
  max-width: 100%; max-height: 100%;
  object-fit: contain;
  object-position: center;
  filter: var(--logo-filter);
  transition: filter .45s, transform .45s var(--ease);
}
/* hover lifts the tile to a light plate so dark AND light logos stay legible */
.client:hover {
  border-color: rgba(255,255,255,.34);
  background: rgba(255,255,255,.93);
  transform: translateY(-4px);
  box-shadow: 0 20px 44px -20px rgba(0,0,0,.9);
}
[data-theme="light"] .client { background: rgba(255,255,255,.75); }
[data-theme="light"] .client:hover {
  border-color: var(--stroke-strong);
  background: #fff;
  box-shadow: 0 20px 44px -22px rgba(20,24,60,.45);
}
.client:hover img { filter: none; }

.client__name {
  position: absolute; inset-inline: 0; bottom: 0;
  padding: 5px 10px;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .04em;
  color: #0b0e1a; font-weight: 500; text-align: center;
  background: linear-gradient(to top, rgba(255,255,255,.98), rgba(255,255,255,.75));
  transform: translateY(100%); opacity: 0;
  transition: transform .4s var(--ease), opacity .35s;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.client:hover .client__name { transform: none; opacity: 1; }
/* Lift the logo clear of the ribbon on hover instead of letting it overlap. */
.client:hover img { transform: translateY(-7px) scale(1.03); }

/* Clickable logos only get the pointer affordance when the option is on. */
a.client { cursor: pointer; }
a.client:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }

/* ---------- 12. Contact ---------- */
.contact-wrap {
  display: grid; grid-template-columns: .92fr 1.08fr;
  gap: clamp(28px, 4vw, 54px);
  border: 1px solid var(--stroke);
  border-radius: var(--r-xl);
  background: var(--card-bg-2);
  padding: clamp(26px, 4vw, 52px);
  position: relative; overflow: hidden;
}
.contact-wrap::before {
  content: ""; position: absolute; width: 420px; height: 420px;
  top: -180px; inset-inline-end: -120px; border-radius: 50%;
  background: radial-gradient(circle, rgba(99,102,241,.3), transparent 68%);
  filter: blur(50px); pointer-events: none;
}

.contact-info h2 { font-size: clamp(26px, 3.4vw, 38px); margin-bottom: 16px; }
.contact-info > p { color: var(--text-dim); margin-bottom: 30px; font-size: 15.4px; }

.link-row {
  display: flex; align-items: center; gap: 14px;
  padding: 15px 17px; border-radius: var(--r-md);
  border: 1px solid var(--stroke);
  background: var(--surface);
  transition: border-color .35s, background .35s, transform .35s var(--ease);
  width: 100%; text-align: start; cursor: pointer;
}
.link-row + .link-row { margin-top: 11px; }
.link-row:hover { border-color: rgba(34,211,238,.42); background: rgba(34,211,238,.07); transform: translateX(4px); }
[dir="rtl"] .link-row:hover { transform: translateX(-4px); }
.link-row .ic {
  width: 40px; height: 40px; border-radius: 12px; flex: none;
  display: grid; place-items: center;
  background: rgba(34,211,238,.11); border: 1px solid rgba(34,211,238,.2);
  color: var(--cyan);
}
.link-row .ic svg { width: 18px; height: 18px; }
.link-row .tx { min-width: 0; }
.link-row .tx small { display: block; font-size: 10.6px; letter-spacing: .13em; text-transform: uppercase; color: var(--text-mute); font-family: var(--font-mono); }
[dir="rtl"] .link-row .tx small { letter-spacing: 0; }
.link-row .tx span { font-size: 14.6px; font-family: var(--font-mono); word-break: break-all; }
.link-row .copy {
  margin-inline-start: auto; font-size: 10.5px; font-family: var(--font-mono);
  color: var(--text-mute); letter-spacing: .1em; text-transform: uppercase;
  opacity: 0; transition: opacity .3s; flex: none;
}
.link-row:hover .copy { opacity: 1; }
.link-row.copied .copy { opacity: 1; color: var(--mint); }

.form { display: grid; gap: 14px; position: relative; z-index: 1; }
.field { position: relative; }
.field label {
  position: absolute; top: 13px; inset-inline-start: 16px;
  font-size: 13.5px; color: var(--text-mute);
  pointer-events: none;
  transition: transform .3s var(--ease), font-size .3s var(--ease), color .3s;
  transform-origin: inline-start top;
}
[dir="rtl"] .field label { transform-origin: right top; }
.field input, .field textarea {
  width: 100%;
  padding: 26px 16px 11px;
  border-radius: var(--r-sm);
  border: 1px solid var(--stroke);
  background: var(--surface);
  font-size: 14.5px;
  transition: border-color .3s, background .3s, box-shadow .3s;
  resize: vertical;
}
.field textarea { min-height: 128px; }
.field input:hover, .field textarea:hover { border-color: var(--stroke-strong); }
.field input:focus, .field textarea:focus {
  outline: none; border-color: rgba(34,211,238,.6);
  background: rgba(34,211,238,.045);
  box-shadow: 0 0 0 3px rgba(34,211,238,.11);
}
.field input:focus + label, .field textarea:focus + label,
.field input:not(:placeholder-shown) + label, .field textarea:not(:placeholder-shown) + label {
  transform: translateY(-9px) scale(.78);
  color: var(--cyan);
}
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form .btn { width: 100%; margin-top: 4px; }
.form__note { font-size: 12px; color: var(--text-mute); text-align: center; font-family: var(--font-mono); }

/* ---------- 13. Footer ---------- */
.foot {
  border-top: 1px solid var(--stroke);
  padding-block: 40px;
  position: relative; z-index: 2;
  background: rgba(var(--bg-rgb), .6);
}
.foot__in { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; }
.foot p { font-size: 13px; color: var(--text-mute); font-family: var(--font-mono); }
.foot__acts { display: flex; gap: 9px; margin-inline-start: auto; flex-wrap: wrap; }
.mini-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 15px; border-radius: 99px;
  border: 1px solid var(--stroke); background: var(--surface);
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .06em;
  color: var(--text-dim); cursor: pointer;
  transition: color .3s, border-color .3s, background .3s, transform .3s var(--ease);
}
.mini-btn:hover { color: var(--text); border-color: var(--stroke-strong); background: var(--surface-2); transform: translateY(-2px); }
.mini-btn svg { width: 14px; height: 14px; }

/* ---------- 14. Reveal ---------- */
[data-reveal] {
  opacity: 0; transform: translateY(26px);
  transition: opacity .85s var(--ease), transform .85s var(--ease);
  transition-delay: var(--d, 0s);
}
[data-reveal].in { opacity: 1; transform: none; }

/* ---------- 15. Toast ---------- */
.toast {
  position: fixed; inset-inline: 0; bottom: 26px; z-index: 300;
  display: flex; justify-content: center; pointer-events: none;
}
.toast span {
  padding: 11px 20px; border-radius: 99px;
  background: rgba(10,13,26,.94); border: 1px solid rgba(66,232,164,.3);
  color: var(--mint); font-family: var(--font-mono); font-size: 12.5px;
  box-shadow: 0 20px 50px -20px rgba(0,0,0,.9);
  transform: translateY(24px); opacity: 0;
  transition: transform .45s var(--ease), opacity .35s;
  backdrop-filter: blur(12px);
}
.toast.show span { transform: none; opacity: 1; }

/* ---------- 16. Responsive ---------- */
@media (max-width: 1080px) {
  .tabs { display: none; }
  .burger { display: block; order: 3; }
  .nav__side { gap: 8px; }
  .nav__cta { display: none; }

  .mobile-menu {
    display: grid;
    position: fixed; inset: 0 0 auto; top: 0; z-index: 89;
    padding: 96px var(--gut) 30px;
    background: rgba(var(--bg-rgb), .97);
    backdrop-filter: blur(22px);
    border-bottom: 1px solid var(--stroke);
    transform: translateY(-100%);
    transition: transform .55s var(--ease);
    display: grid; gap: 4px;
  }
  .mobile-menu.open { transform: none; }
  .mobile-menu a {
    padding: 15px 4px; font-family: var(--font-display); font-size: 21px; font-weight: 600;
    border-bottom: 1px solid var(--stroke);
    display: flex; align-items: center; gap: 14px;
  }
  .mobile-menu a span { font-family: var(--font-mono); font-size: 12px; color: var(--cyan); font-weight: 400; }
  .mobile-menu .btn { margin-top: 18px; }
}

@media (max-width: 900px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero { min-height: auto; padding-block: 104px 52px; }
  .about { grid-template-columns: 1fr; }
  .bio-card { position: static; }
  .caps { grid-template-columns: 1fr; }
  .contact-wrap { grid-template-columns: 1fr; }
  .scroll-hint { display: none; }
}

@media (max-width: 560px) {
  .stats { grid-template-columns: repeat(2, 1fr); gap: 22px; }
  .form__row { grid-template-columns: 1fr; }
  .hero__actions .btn { flex: 1 1 100%; }
  .term__body { min-height: 250px; }
  .foot__in { flex-direction: column; align-items: flex-start; }
  .foot__acts { margin-inline-start: 0; }
  .brand__txt small { display: none; }
}

/* ---------- 17. Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
  .hero h1 .line > span { transform: none; }
  .marquee__row { animation: none; }
  .marquee { overflow-x: auto; }
  .bg-canvas, .cursor-glow { display: none; }
}

/* Print */
@media print {
  .nav, .boot-skip, #boot, .bg-canvas, .aurora, .grain, .cursor-glow, .scroll-hint { display: none !important; }
  body { background: #fff; color: #000; }
}

/* ==========================================================================
   18. WordPress additions
   ========================================================================== */

/* Hero code card: server-rendered <pre> keeps the same look as the JS version */
pre.card-code__body {
  margin: 0;
  font-family: var(--font-mono);
  tab-size: 2;
}

/* Contact block with the form hidden */
.contact-wrap--solo { grid-template-columns: 1fr; max-width: 620px; margin-inline: auto; }

/* Third-party form plugins (CF7, WPForms) inside the contact card */
.form--shortcode input[type="text"],
.form--shortcode input[type="email"],
.form--shortcode input[type="tel"],
.form--shortcode input[type="url"],
.form--shortcode textarea,
.form--shortcode select {
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--r-sm);
  border: 1px solid var(--stroke);
  background: var(--surface);
  color: var(--text);
  font-size: 14.5px;
  transition: border-color .3s, background .3s, box-shadow .3s;
}
.form--shortcode input:focus,
.form--shortcode textarea:focus,
.form--shortcode select:focus {
  outline: none;
  border-color: rgba(34,211,238,.6);
  background: rgba(34,211,238,.045);
  box-shadow: 0 0 0 3px rgba(34,211,238,.11);
}
.form--shortcode label { display: block; font-size: 13.5px; color: var(--text-dim); margin-bottom: 12px; }
.form--shortcode input[type="submit"],
.form--shortcode button[type="submit"] {
  width: 100%;
  padding: 14px 26px;
  border: 0; border-radius: 99px;
  background: var(--grad); color: var(--on-grad);
  font-weight: 700; font-size: 14.5px; cursor: pointer;
  transition: transform .35s var(--ease), box-shadow .35s;
}
.form--shortcode input[type="submit"]:hover,
.form--shortcode button[type="submit"]:hover {
  box-shadow: 0 16px 46px -12px rgba(139,92,246,.85);
}

/* ---- Blog / single / archive ---- */
.page-main { padding-block: clamp(120px, 14vw, 170px) clamp(56px, 7vw, 90px); position: relative; z-index: 2; }
.page-main--center { display: grid; place-items: center; min-height: 70vh; text-align: center; }
.page-main--center .sec-head { margin-inline: auto; }
.shell--narrow { width: min(100% - (var(--gut) * 2), 760px); margin-inline: auto; }

.post-list { display: grid; gap: clamp(18px, 2.4vw, 26px); grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }

.post-card {
  border: 1px solid var(--stroke); border-radius: var(--r-lg);
  background: var(--card-bg); overflow: hidden;
  transition: transform .5s var(--ease), border-color .45s, box-shadow .45s;
}
.post-card:hover { border-color: var(--stroke-strong); box-shadow: 0 34px 80px -38px rgba(99,102,241,.85); }
.post-card__media { display: block; aspect-ratio: 16/9; overflow: hidden; background: var(--bg-2); }
.post-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 1s var(--ease); }
.post-card:hover .post-card__media img { transform: scale(1.06); }
.post-card__body { padding: clamp(18px, 2.4vw, 26px); }
.post-card__title { font-size: clamp(17px, 2vw, 21px); margin-bottom: 8px; line-height: 1.25; }
.post-card__title a { transition: color .3s; }
.post-card__title a:hover { color: var(--cyan); }
.post-card__meta { font-family: var(--font-mono); font-size: 12px; color: var(--text-mute); margin-bottom: 10px; }
.post-card__excerpt { color: var(--text-dim); font-size: 14.6px; }

.entry__thumb { margin-block: 26px; border-radius: var(--r-lg); overflow: hidden; }
.entry__content { color: var(--text-dim); font-size: 16.5px; line-height: 1.8; }
.entry__content > * + * { margin-top: 1.1em; }
.entry__content h2, .entry__content h3, .entry__content h4 { color: var(--text); margin-top: 1.7em; }
.entry__content h2 { font-size: clamp(22px, 3vw, 30px); }
.entry__content h3 { font-size: clamp(19px, 2.4vw, 24px); }
.entry__content a { color: var(--cyan); border-bottom: 1px solid rgba(34,211,238,.32); }
.entry__content a:hover { border-bottom-color: var(--cyan); }
.entry__content img { border-radius: var(--r-md); height: auto; }
.entry__content ul, .entry__content ol { padding-inline-start: 1.4em; }
.entry__content ul { list-style: disc; }
.entry__content ol { list-style: decimal; }
.entry__content li + li { margin-top: .5em; }
.entry__content blockquote {
  border-inline-start: 3px solid var(--cyan);
  padding: 4px 0 4px 18px; padding-inline-start: 18px;
  color: var(--text); font-style: italic;
}
.entry__content code {
  font-family: var(--font-mono); font-size: .9em;
  background: var(--surface-2); padding: 2px 6px; border-radius: 5px;
}
.entry__content pre {
  background: #0b0e1c; color: #e8eaf2; padding: 18px 20px;
  border-radius: var(--r-md); overflow-x: auto; border: 1px solid var(--stroke);
  direction: ltr; text-align: start;
}
.entry__content pre code { background: none; padding: 0; }
.entry__content table { width: 100%; border-collapse: collapse; }
.entry__content th, .entry__content td { border: 1px solid var(--stroke); padding: 10px 12px; text-align: start; }

/* Pagination */
.pagination, .navigation.pagination { margin-top: 44px; display: flex; justify-content: center; }
.pagination .nav-links { display: flex; gap: 8px; flex-wrap: wrap; }
.pagination .page-numbers {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 40px; height: 40px; padding: 0 12px;
  border: 1px solid var(--stroke); border-radius: 99px;
  background: var(--surface); font-size: 14px;
  transition: border-color .3s, background .3s, color .3s;
}
.pagination .page-numbers:hover { border-color: var(--stroke-strong); background: var(--surface-2); }
.pagination .page-numbers.current { background: var(--grad); color: var(--on-grad); border-color: transparent; font-weight: 700; }

/* Comments */
.comments { margin-top: 56px; padding-top: 34px; border-top: 1px solid var(--stroke); }
.comments__title { font-size: clamp(19px, 2.4vw, 24px); margin-bottom: 22px; }
.comment-list { list-style: none; padding: 0; display: grid; gap: 18px; }
.comment-list ol.children { list-style: none; padding-inline-start: 24px; margin-top: 18px; display: grid; gap: 18px; }
.comment-body {
  border: 1px solid var(--stroke); border-radius: var(--r-md);
  background: var(--surface); padding: 18px;
}
.comment-author { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.comment-author img { border-radius: 50%; }
.comment-metadata { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-mute); margin: 6px 0 10px; }
.comment-content { color: var(--text-dim); font-size: 14.8px; }
.comment-respond { margin-top: 30px; }
.comment-reply-title { font-size: 19px; margin-bottom: 16px; }
.comment-form label { display: block; font-size: 13px; color: var(--text-dim); margin-bottom: 5px; }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
  width: 100%; padding: 12px 15px; margin-bottom: 14px;
  border: 1px solid var(--stroke); border-radius: var(--r-sm);
  background: var(--surface); color: var(--text); font-size: 14.5px;
}
.comment-form input:focus, .comment-form textarea:focus {
  outline: none; border-color: rgba(34,211,238,.6); background: rgba(34,211,238,.045);
}
.comment-form .submit {
  padding: 13px 26px; border: 0; border-radius: 99px;
  background: var(--grad); color: var(--on-grad);
  font-weight: 700; cursor: pointer;
}

/* Search form */
.search-form { display: flex; gap: 10px; flex-wrap: wrap; }
.search-form .search-field {
  flex: 1 1 220px; padding: 13px 16px;
  border: 1px solid var(--stroke); border-radius: var(--r-sm);
  background: var(--surface); color: var(--text);
}
.search-form .search-field:focus { outline: none; border-color: rgba(34,211,238,.6); }

/* Footer widgets */
.foot__widgets {
  display: grid; gap: 26px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  padding-bottom: 30px; margin-bottom: 26px;
  border-bottom: 1px solid var(--stroke);
}
.foot__widgets .widget-title { font-size: 15px; margin-bottom: 12px; }
.foot__widgets ul { display: grid; gap: 8px; }
.foot__widgets a { color: var(--text-dim); font-size: 14px; transition: color .3s; }
.foot__widgets a:hover { color: var(--cyan); }

/* Admin bar offset */
.admin-bar .nav { top: 32px; }
@media screen and (max-width: 782px) { .admin-bar .nav { top: 46px; } }
.admin-bar #boot { top: 32px; }

/* Block editor alignment helpers */
.entry__content .alignwide { width: min(100vw - 40px, 1100px); margin-inline: auto; }
.entry__content .alignfull { width: 100vw; margin-inline: calc(50% - 50vw); }

/* The greet() card is a <button>; keep it flush with the code block */
.card-code__out {
  width: 100%;
  border: 0;
  border-top: 1px solid var(--stroke);
  text-align: start;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.card-code__out:focus-visible { outline: 2px solid var(--cyan); outline-offset: -2px; }
