/*
Theme Name: TypeNegar
Theme URI: https://typenegar.ir
Description: قالب سایت معرفی تایپ‌نگار – «سیاه‌مشق»: هر صفحه یک برگ تمرین خوشنویسی؛ راست‌چین، بلوکی و قابل ویرایش کامل از ویرایشگر سایت.
Author: TypeNegar
Version: 2.4.0
Requires at least: 6.4
Requires PHP: 7.4
Tested up to: 6.8
License: GPL-2.0-or-later
Text Domain: typenegar
*/

/* World: siah-mashq. Sheets alternate ink (#0b1030) and paper (#f4f6fd). The ground is layered reed-pen ink
   (nib-angle strokes, generated in assets/js/typenegar.js); each sheet resolves with one nib stroke under its
   heading; green belongs to the master's seal only. No cards: visuals sit on the sheet, notes are marginalia. */

:root {
  --ink: #0b1030;
  --ink-2: #151c4a;
  --paper: #f4f6fd;
  --blue: var(--wp--preset--color--primary, #1f5fe8);
  --violet: var(--wp--preset--color--accent, #6b3df0);
  --seal: var(--wp--preset--color--success, #1fa951);
  --gold: #f5c542;          /* the recommended plan only */
  --on-ink: #eef0ff;
  --on-ink-2: #b9c0e8;      /* 8.4:1 on ink */
  --on-paper: #121735;
  --on-paper-2: #474e73;    /* 7.9:1 on paper */
  --rule-ink: rgba(185, 192, 232, .22);
  --rule-paper: rgba(18, 23, 53, .14);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --header-h: 72px;
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .07 0 0 0 0 .09 0 0 0 0 .21 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- browser surfaces ---------- */
body { -webkit-font-smoothing: antialiased; background: var(--ink); }
::selection { background: color-mix(in srgb, var(--blue) 30%, transparent); color: inherit; }
* { caret-color: var(--blue); }
html { scrollbar-color: color-mix(in srgb, var(--blue) 55%, var(--ink)) var(--ink); scrollbar-width: thin; }
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--ink); }
::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--blue) 50%, var(--ink)); border-radius: 10px; border: 2px solid var(--ink); }
a { text-underline-offset: .25em; text-decoration-thickness: 1px; }
a:focus-visible, button:focus-visible, summary:focus-visible, .wp-block-button__link:focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; border-radius: 6px; }
.tn-sheet--ink a:focus-visible, .tn-sheet--ink .wp-block-button__link:focus-visible, .tn-footer a:focus-visible { outline-color: #9db6ff; }
a, button, summary, .wp-block-button__link { cursor: pointer; }
.wp-site-blocks { padding: 0; }

/* ---------- sheets ---------- */
.tn-sheet {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: 100svh; display: flex; flex-direction: column; justify-content: center;
  padding-block: calc(var(--header-h) + clamp(28px, 5vh, 64px)) clamp(44px, 7vh, 88px);
  margin-block: 0 !important;
}
.tn-sheet > * { position: relative; z-index: 1; }
.tn-sheet--ink { background: radial-gradient(80% 70% at 80% 10%, #18205a, transparent 70%), var(--ink); color: var(--on-ink); }
.tn-sheet--ink h1, .tn-sheet--ink h2, .tn-sheet--ink h3, .tn-sheet--ink strong { color: #fff; }
.tn-sheet--paper { background: var(--grain), var(--paper); background-size: 220px 220px, auto; color: var(--on-paper); }
.tn-sheet--paper::before { /* faint ruling of a practice sheet */
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: repeating-linear-gradient(180deg, transparent 0 51px, rgba(31, 95, 232, .08) 51px 52px);
  -webkit-mask: linear-gradient(90deg, transparent 4%, #000 22%, #000 78%, transparent 96%); mask: linear-gradient(90deg, transparent 4%, #000 22%, #000 78%, transparent 96%);
}
.tn-sheet--ink::after { content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none; background: var(--grain); background-size: 220px; opacity: .35; mix-blend-mode: soft-light; }

/* the siah-mashq ground: layered nib strokes (SVG built by JS) – dense at the margins, clear behind the text */
.tn-mashq { position: absolute; inset: 0; z-index: 0; pointer-events: none; max-width: none !important; width: auto !important; margin: 0 !important; }
.tn-mashq svg { width: 100%; height: 100%; display: block; }
.tn-mashq { -webkit-mask: radial-gradient(58% 60% at 50% 48%, transparent 34%, #000 82%); mask: radial-gradient(58% 60% at 50% 48%, transparent 34%, #000 82%); }

/* ---------- type ---------- */
.tn-sheet h1, .tn-sheet h2 { font-weight: 900; letter-spacing: -.02em; text-wrap: balance; }
.tn-sheet h1 { font-size: clamp(2.4rem, 6vw, 5.4rem); line-height: 1.14; margin: 0 0 .3em; }
.tn-sheet h2 { font-size: clamp(2rem, 4.2vw, 3.7rem); line-height: 1.2; margin: 0 0 .15em; }
.tn-lead { font-size: clamp(1.05rem, 1.55vw, 1.28rem); line-height: 1.9; max-width: 38em; margin: .9em 0 1.3em; }
.tn-sheet--ink .tn-lead { color: var(--on-ink-2); }
.tn-sheet--paper .tn-lead { color: var(--on-paper-2); }
.tn-fine { font-size: .9rem; }
.tn-sheet--ink .tn-fine { color: var(--on-ink-2); }
.tn-sheet--paper .tn-fine { color: var(--on-paper-2); }

/* the resolving stroke under each sheet heading (SVG inserted by JS) */
.tn-stroke { display: block; width: min(360px, 70%); height: 26px; margin: 2px 0 0; overflow: visible; }
.tn-stroke path { fill: currentColor; }
.tn-sheet--ink .tn-stroke { color: #7f9bff; }
.tn-sheet--paper .tn-stroke { color: var(--blue); }
.tn-stack-head .tn-stroke, .tn-hero .tn-stroke { margin-inline: auto; }
.tn-js .tn-stroke { clip-path: inset(0 0 0 100%); transition: clip-path 1.1s cubic-bezier(.65, 0, .35, 1) .25s; }
.tn-js .is-here .tn-stroke { clip-path: inset(0 0 0 0); }

/* marginalia (حاشیه): notes beside the work, set like a scholar's margin – not cards */
.tn-notes { list-style: none; margin: 0; padding: 0 0 0 0; display: grid; gap: 12px; max-width: 32em; font-size: .97rem; line-height: 1.75; }
.tn-notes li { position: relative; padding-inline-start: 22px; }
.tn-notes li::before { /* a short nib dash */
  content: ""; position: absolute; inset-inline-start: 0; top: .8em; width: 12px; height: 4px; border-radius: 1px 4px;
  background: var(--blue); transform: skewX(-25deg) rotate(-12deg);
}
.tn-sheet--ink .tn-notes { color: var(--on-ink-2); }
.tn-sheet--ink .tn-notes li::before { background: #8aa4ff; }
.tn-sheet--paper .tn-notes { color: var(--on-paper-2); }
.tn-notes--row { max-width: none; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px 36px; margin-top: clamp(18px, 3vh, 32px) !important; transform: rotate(-1.2deg); font-size: .92rem; }

/* ---------- compositions ---------- */
.tn-split { align-items: center !important; gap: clamp(28px, 6vw, 96px) !important; }
.tn-stack-head { text-align: center; }
.tn-stack-head .tn-lead { margin-inline: auto; }
.tn-visual { min-height: 300px; display: grid; place-items: center; }
.tn-visual-alt { font-size: .95rem; line-height: 1.8; max-width: 30em; padding-inline-start: 16px; border-inline-start: 1px solid currentColor; opacity: .85; }
.tn-js .tn-visual.is-built .tn-visual-alt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; padding: 0; border: 0; }

/* ---------- buttons ---------- */
.wp-block-button__link {
  min-height: 52px; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  border-radius: 12px; font-weight: 800; padding: 14px 28px;
  transition: transform .25s var(--ease-out), box-shadow .25s var(--ease-out), background-color .2s, color .2s;
  box-shadow: 0 12px 26px -14px rgba(31, 95, 232, .8);
}
.wp-block-button__link:hover { transform: translateY(-2px); box-shadow: 0 18px 32px -16px rgba(31, 95, 232, .9); }
.wp-block-button__link:active { transform: translateY(0); }
.is-style-outline .wp-block-button__link { box-shadow: none; border: 1.5px solid currentColor; background: transparent; }
.tn-sheet--ink .is-style-outline .wp-block-button__link { color: #fff; border-color: rgba(238, 240, 255, .5); }
.tn-sheet--ink .is-style-outline .wp-block-button__link:hover { border-color: #fff; }
.tn-sheet--paper .is-style-outline .wp-block-button__link { color: var(--on-paper); border-color: rgba(18, 23, 53, .35); }
.tn-btn-download .wp-block-button__link::before {
  content: ""; width: 20px; height: 20px; background: currentColor;
  -webkit-mask: url(assets/icons/download.svg) center / contain no-repeat; mask: url(assets/icons/download.svg) center / contain no-repeat;
}

/* ---------- header: takes the ground of the sheet beneath it ---------- */
.wp-site-blocks > header { position: fixed; inset: 0 0 auto 0; z-index: 60; }
.admin-bar .wp-site-blocks > header { top: 32px; }
.tn-header { min-height: var(--header-h); display: flex; align-items: center; transition: background-color .4s, box-shadow .4s, color .4s; color: #eef0ff; }
.tn-header.alignfull { padding-block: 10px; }
html.is-scrolled .tn-header { background: rgba(11, 16, 48, .94); box-shadow: 0 1px 0 var(--rule-ink); }
html.is-scrolled.hdr-paper .tn-header { background: rgba(244, 246, 253, .96); box-shadow: 0 1px 0 var(--rule-paper); color: var(--on-paper); }
.tn-brand { display: flex; align-items: center; gap: 12px; }
.tn-header .tn-logo { margin: 0; }
.tn-header .tn-logo img { width: 42px; height: auto; display: block; }
.tn-header .wp-block-site-title { margin: 0; font-size: 1.3rem; font-weight: 900; }
.tn-header .wp-block-site-title a { color: inherit; text-decoration: none; }
.tn-header .wp-block-navigation { color: inherit; font-weight: 600; font-size: .98rem; }
.tn-header .wp-block-navigation a { text-decoration: none; padding: 8px 2px; position: relative; }
.tn-header .wp-block-navigation a::after { content: ""; position: absolute; inset-inline: 0; bottom: 2px; height: 2px; border-radius: 2px; background: currentColor; opacity: .8; transform: scaleX(0); transform-origin: right; transition: transform .35s var(--ease-out); }
.tn-header .wp-block-navigation a:hover::after { transform: scaleX(1); }
.tn-header .wp-block-navigation__responsive-container-open, .tn-header .wp-block-navigation__responsive-container-close { color: inherit; }
.tn-header .wp-block-navigation__responsive-container.is-menu-open { background: var(--ink); color: #fff; }
.tn-nav-group { gap: clamp(14px, 3vw, 36px); }
.tn-header-cta .wp-block-button__link { min-height: 44px; padding: 10px 20px; font-size: .95rem; }

/* sheet index rail */
.tn-rail { position: fixed; left: clamp(10px, 2vw, 28px); top: 50%; transform: translateY(-50%); z-index: 55; display: grid; gap: 10px; }
.tn-rail button { width: 14px; height: 14px; padding: 0; border-radius: 50%; border: 2px solid currentColor; background: transparent; color: rgba(185, 192, 232, .75); transition: transform .3s var(--ease-out), background-color .3s, color .3s; position: relative; }
.tn-rail button[aria-current="true"] { background: currentColor; color: #fff; transform: scale(1.2); }
.tn-rail.on-paper button { color: rgba(18, 23, 53, .4); }
.tn-rail.on-paper button[aria-current="true"] { color: var(--blue); }
.tn-rail button span { position: absolute; left: 24px; top: 50%; transform: translateY(-50%); white-space: nowrap; font-size: .8rem; font-weight: 700; padding: 3px 10px; border-radius: 8px; background: var(--ink-2); color: #fff; opacity: 0; pointer-events: none; transition: opacity .2s; }
.tn-rail button:hover span, .tn-rail button:focus-visible span { opacity: 1; }

/* ---------- 1. hero ---------- */
.tn-hero { text-align: center; }
.tn-hero .tn-lead { margin-inline: auto; }
.tn-hero > h1 { max-width: 1100px !important; }
.tn-hero .wp-block-buttons { justify-content: center; }
.tn-pen { position: relative; margin: 6px auto 30px; max-width: 760px; min-height: 140px; display: grid; place-items: center; gap: 4px; }
.tn-pen-wrong, .tn-pen-right { margin: 0; unicode-bidi: plaintext; font-weight: 800; }
.tn-pen-wrong { font-size: clamp(1rem, 1.8vw, 1.25rem); color: #ffa3a3; text-decoration: line-through; text-decoration-color: rgba(255, 163, 163, .6); }
.tn-pen-right { font-size: clamp(1.4rem, 3vw, 2.3rem); color: #fff; position: relative; padding-inline-end: 62px; }
.tn-pen-right::after { /* the master's mark */
  content: ""; position: absolute; inset-inline-end: 0; top: 50%; width: 50px; height: 38px; margin-top: -22px; background: var(--seal);
  -webkit-mask: url(assets/img/seal.svg) center / contain no-repeat; mask: url(assets/img/seal.svg) center / contain no-repeat;
}
.tn-pen .tn-stroke { width: min(520px, 88%); height: 30px; color: #8aa4ff; }
.tn-js .tn-pen .tn-stroke { clip-path: inset(0 0 0 100%); }
.tn-js .tn-pen.is-stroked .tn-stroke { clip-path: inset(0 0 0 0); }
.tn-js .tn-pen .tn-pen-right { transition: opacity .6s var(--ease-out), transform .6s var(--ease-out), filter .6s var(--ease-out); }
.tn-js .tn-pen:not(.is-sealed) .tn-pen-right { opacity: 0; transform: translateY(10px); filter: blur(6px); }
.tn-js .tn-pen .tn-pen-right::after { transition: clip-path .5s var(--ease-out) .3s; clip-path: inset(0 0 0 0); }
.tn-js .tn-pen:not(.is-sealed) .tn-pen-right::after { clip-path: inset(0 0 0 100%); }
.tn-js .tn-pen.is-typing .tn-pen-wrong { text-decoration-color: transparent; color: #ffc6c6; }
.tn-js .tn-pen.is-typing .tn-pen-wrong::after { content: ""; display: inline-block; width: 2px; height: 1em; margin-inline-start: 3px; vertical-align: -.1em; background: currentColor; animation: tn-caret 1s steps(1) infinite; }
.tn-scroll-cue { margin-top: clamp(20px, 5vh, 48px); display: inline-grid; justify-items: center; gap: 8px; color: var(--on-ink-2); font-size: .85rem; }
.tn-scroll-cue::after { content: ""; width: 22px; height: 36px; border: 2px solid currentColor; border-radius: 12px; background: radial-gradient(circle, currentColor 2.5px, transparent 3px) center 8px / 6px 6px no-repeat; animation: tn-cue 2s var(--ease-out) infinite; }

/* ---------- 2. AI (paper, stacked): the sentence on the sheet, readings in the margin ---------- */
.tn-ai-board { width: min(880px, 100%); display: grid; grid-template-columns: 1.4fr 1fr; gap: clamp(24px, 4vw, 56px); align-items: center; }
.tn-ai-sentence { display: flex; flex-wrap: nowrap; white-space: nowrap; gap: 6px 18px; font-size: clamp(1.4rem, 2.6vw, 2.1rem); font-weight: 900; line-height: 1.6; }
.tn-tok { position: relative; padding-bottom: 6px; color: #a1263c; unicode-bidi: plaintext; transition: color .4s; }
.tn-tok::after { content: ""; position: absolute; inset-inline: 0; bottom: 0; height: 4px; border-radius: 1px 5px; background: var(--blue); transform: scaleX(0); transform-origin: right; transition: transform .5s var(--ease-out); }
.tn-tok.is-active::after { transform: scaleX(1); }
.tn-tok.is-fixed { color: var(--on-paper); }
.tn-cands { border-inline-start: 1.5px solid var(--rule-paper); padding-inline-start: 22px; min-height: 170px; }
.tn-cands-title { font-size: .85rem; color: var(--on-paper-2); margin: 0 0 10px; }
.tn-cand { display: grid; grid-template-columns: 7em 1fr 3em; align-items: center; gap: 12px; padding: 7px 0; font-weight: 700; color: var(--on-paper-2); transition: color .3s, opacity .3s; }
.tn-cand.is-best { color: var(--on-paper); }
.tn-cand.is-out { opacity: .45; text-decoration: line-through; }
.tn-cand-bar { height: 3px; background: var(--rule-paper); }
.tn-cand-bar i { display: block; height: 100%; width: var(--p, 50%); background: var(--violet); transform-origin: right; transform: scaleX(0); transition: transform .9s var(--ease-out); }
.tn-cand.is-best .tn-cand-bar i { background: var(--blue); height: 5px; margin-top: -1px; }
.tn-cands.is-shown .tn-cand-bar i { transform: scaleX(1); }
.tn-cand-p { font-variant-numeric: tabular-nums; text-align: left; font-size: .9rem; }

/* ---------- 3. layout (ink): keycaps as engraved outlines ---------- */
.tn-keys-board { display: grid; grid-template-columns: repeat(5, 72px); gap: 12px; direction: ltr; perspective: 700px; }
.tn-k { width: 72px; height: 72px; position: relative; transform-style: preserve-3d; transition: transform .7s var(--ease-out); }
.tn-k b, .tn-k i { position: absolute; inset: 0; display: grid; place-items: center; border-radius: 14px; backface-visibility: hidden; font-style: normal; font-weight: 900; font-size: 1.6rem; border: 1.5px solid rgba(185, 192, 232, .45); background: rgba(255, 255, 255, .03); }
.tn-k b { color: #e8ebff; font-family: Vazirmatn, Tahoma, sans-serif; }
.tn-k i { color: #b9a6ff; transform: rotateX(180deg); border-color: rgba(185, 166, 255, .6); }
.tn-keys-board.is-flipped .tn-k { transform: rotateX(180deg); }
.tn-keys-line { margin-top: 26px; text-align: center; font-weight: 800; font-size: 1.35rem; min-height: 2.6em; unicode-bidi: plaintext; }
.tn-keys-line .from { color: #ffa3a3; text-decoration: line-through; font-size: 1rem; display: block; }
.tn-keys-line .to { color: #fff; }

/* ---------- shared: a correction keeps its trace (struck original above the fix) ---------- */
.tn-fix { position: relative; display: inline-block; }
.tn-fix .was { position: absolute; inset-inline-start: 0; bottom: 100%; font-size: .52em; font-weight: 700; white-space: nowrap; text-decoration: line-through; opacity: 0; transform: translateY(6px); transition: opacity .4s, transform .4s var(--ease-out); }
.tn-fix.is-ok .was { opacity: .8; transform: none; }

/* ---------- 4. typos (paper, stacked): the text itself on the sheet ---------- */
.tn-typo-board { width: min(860px, 100%); text-align: center; }
.tn-typo-line { font-size: clamp(1.5rem, 3vw, 2.4rem); font-weight: 900; line-height: 1.6; margin: 0; padding-top: .9em; unicode-bidi: plaintext; color: var(--on-paper); }
.tn-typo-line .tn-fix { color: #a1263c; transition: color .4s; }
.tn-typo-line .tn-fix::after { content: ""; position: absolute; inset-inline: 0; bottom: .08em; height: 6px; background: radial-gradient(circle at 3px -1px, transparent 3px, #c5221f 3.5px 4.5px, transparent 5px) 0 0 / 8px 6px repeat-x; transition: opacity .3s; }
.tn-typo-line .tn-fix.is-ok { color: var(--on-paper); }
.tn-typo-line .tn-fix.is-ok::after { background: var(--blue); height: 3px; border-radius: 1px 4px; }
.tn-typo-line .tn-fix .was { color: #a1263c; }
.tn-typo-tag { margin-top: 18px; font-size: .9rem; color: var(--on-paper-2); display: inline-flex; gap: 10px; align-items: center; }
.tn-typo-tag kbd { font: 700 .82rem ui-sans-serif, system-ui; padding: 4px 9px; border-radius: 6px; border: 1.5px solid rgba(18, 23, 53, .3); color: var(--on-paper); direction: ltr; }

/* ---------- 5. Persian writing (ink): gaps close, letters turn Persian ---------- */
.tn-zw-board { display: grid; width: min(540px, 100%); }
.tn-zw-row { display: flex; align-items: baseline; justify-content: space-between; gap: 18px; padding: 40px 4px 18px; border-bottom: 1px solid var(--rule-ink); }
.tn-zw-row:first-child { border-top: 1px solid var(--rule-ink); }
.tn-zw-word { font-weight: 900; font-size: clamp(1.6rem, 3.2vw, 2.4rem); color: #fff; }
.tn-zw-word .was { color: #ffa3a3; }
.tn-zw-note { font-size: .85rem; color: var(--on-ink-2); }

/* ---------- 6. learning (paper, stacked) ---------- */
.tn-learn-board { width: 540px; max-width: 100%; flex: none; justify-self: center; margin-inline: auto; aspect-ratio: 1; }
.tn-vis-learn { width: 100%; display: flex; justify-content: center; }
.tn-learn-board svg { width: 100%; height: 100%; overflow: visible; }
.tn-learn-board .ring { fill: none; stroke: rgba(31, 95, 232, .25); stroke-width: 1.2; stroke-dasharray: 2 8; }
.tn-learn-board .user { fill: var(--paper); stroke: rgba(18, 23, 53, .35); stroke-width: 1.5; }
.tn-learn-board .user-ic { fill: none; stroke: var(--on-paper); stroke-width: 2; stroke-linecap: round; }
.tn-learn-board .core { fill: var(--ink); }
.tn-learn-board .core-ring { fill: none; stroke: var(--violet); stroke-width: 2.5; stroke-dasharray: 14 10; animation: tn-spin 22s linear infinite; transform-origin: 280px 280px; }
.tn-learn-board .flow { fill: none; stroke: var(--blue); stroke-width: 2; stroke-dasharray: 2 10; stroke-linecap: round; animation: tn-flow 1.6s linear infinite; }
.tn-learn-board .word { font: 800 15px Vazirmatn, Tahoma, sans-serif; fill: var(--violet); }
.tn-learn-board .core-t { font: 900 20px Vazirmatn, Tahoma, sans-serif; fill: #fff; }
.tn-learn-board .core-s { font: 700 12px Vazirmatn, Tahoma, sans-serif; fill: #b9c0e8; }

/* ---------- 7. privacy (ink): a drawn machine; text stays inside ---------- */
.tn-priv-board { width: min(500px, 100%); aspect-ratio: 16 / 11; position: relative; border: 2px solid rgba(185, 192, 232, .5); border-radius: 18px; }
.tn-priv-board::after { content: ""; position: absolute; left: 50%; bottom: -20px; width: 28%; height: 18px; margin-left: -14%; border: 2px solid rgba(185, 192, 232, .5); border-top: 0; border-radius: 0 0 10px 10px; }
.tn-priv-board .chip { position: absolute; top: 0; left: 0; padding: 5px 12px; border-radius: 8px; font-weight: 800; font-size: .95rem; color: #dfe4ff; border: 1px solid rgba(157, 182, 255, .45); background: rgba(11, 16, 48, .6); will-change: transform; }
.tn-priv-board .lock { position: absolute; left: 50%; top: 50%; width: 84px; height: 84px; margin: -42px 0 0 -42px; border-radius: 50%; border: 2px solid #8aa4ff; display: grid; place-items: center; }
.tn-priv-board .lock::before { content: ""; width: 38px; height: 38px; background: #8aa4ff; -webkit-mask: url(assets/icons/shield.svg) center / contain no-repeat; mask: url(assets/icons/shield.svg) center / contain no-repeat; }

/* ---------- 8. teams (paper): ruled lines + a margin note ---------- */
.tn-teams-cols { align-items: center !important; gap: clamp(28px, 6vw, 96px) !important; }
.tn-lines { list-style: none; margin: 0; padding: 0; }
.tn-lines li { padding: 18px 0; border-bottom: 1px solid var(--rule-paper); font-size: 1.02rem; color: var(--on-paper-2); line-height: 1.7; }
.tn-lines li:first-child { border-top: 1.5px solid var(--on-paper); }
.tn-lines li strong { display: block; color: var(--on-paper); font-size: clamp(1.15rem, 1.8vw, 1.45rem); font-weight: 900; }
.tn-hashiye { margin-top: 26px !important; padding-inline-start: 16px; transform: rotate(-1.5deg); transform-origin: right; font-size: .95rem; color: var(--on-paper-2); line-height: 1.85; max-width: 26em; }
.tn-hashiye strong { color: var(--on-paper); }
.tn-hashiye a { color: var(--blue); font-weight: 700; }

/* ---------- 9. pricing ledger (ink) ---------- */
.tn-ledger { gap: 0 !important; border-top: 1.5px solid rgba(238, 240, 255, .55); }
.tn-ledger > .wp-block-column { padding: 24px clamp(16px, 2.2vw, 30px) 6px; display: flex; flex-direction: column; }
.tn-ledger > .wp-block-column + .wp-block-column { border-inline-start: 1px solid var(--rule-ink); }
.tn-ledger h3 { margin: 0; font-size: 1.1rem; font-weight: 900; }
.tn-ledger .tn-price { font-size: clamp(1.6rem, 2.4vw, 2.2rem); font-weight: 900; margin: 8px 0 2px; color: #fff; font-variant-numeric: tabular-nums; }
.tn-ledger .tn-per { margin: 0 0 14px; font-size: .86rem; color: var(--on-ink-2); min-height: 3em; }
.tn-ledger ul { list-style: none; margin: 0 0 20px; padding: 0; flex: 1; display: grid; gap: 8px; align-content: start; color: var(--on-ink-2); font-size: .95rem; }
.tn-ledger li { position: relative; padding-inline-start: 20px; }
.tn-ledger li::before { content: ""; position: absolute; inset-inline-start: 0; top: .78em; width: 10px; height: 3.5px; border-radius: 1px 4px; background: #8aa4ff; transform: skewX(-25deg) rotate(-12deg); }
.tn-ledger .is-featured { position: relative; border-top: 4px solid var(--gold); margin-top: -2.5px; background: linear-gradient(rgba(245, 197, 66, .07), transparent 55%); }
.tn-ledger .wp-block-buttons { margin-top: auto; }
#pricing .tn-lead { margin-bottom: .8em; }
#pricing .tn-fine { margin: 12px 0 0; }

/* ---------- 10. final sheet (paper): questions + download ---------- */
.tn-faq .wp-block-details { border-bottom: 1px solid var(--rule-paper); padding: 14px 2px; }
.tn-faq summary { font-weight: 800; list-style: none; display: flex; justify-content: space-between; gap: 16px; align-items: center; color: var(--on-paper); min-height: 32px; }
.tn-faq summary::-webkit-details-marker { display: none; }
.tn-faq summary::after { content: ""; flex: none; width: 12px; height: 12px; border-bottom: 2px solid currentColor; border-inline-start: 2px solid currentColor; transform: rotate(-45deg) translateY(-3px); transition: transform .35s var(--ease-out); opacity: .7; }
.tn-faq details[open] summary::after { transform: rotate(135deg) translateY(-3px); }
.tn-faq .wp-block-details p { margin: 10px 0 0; color: var(--on-paper-2); line-height: 1.85; }
.tn-download-panel { padding-inline-start: clamp(20px, 3vw, 36px); border-inline-start: 1px solid var(--rule-paper); }
.tn-download-panel h3 { color: var(--on-paper); font-weight: 900; font-size: clamp(1.6rem, 2.8vw, 2.4rem); line-height: 1.3; margin: 0 0 10px; }
.tn-download-panel p { color: var(--on-paper-2); margin: 0 0 18px; }
.tn-download-panel .tn-fine { margin: 14px 0 0; }

/* ---------- footer ---------- */
.tn-footer { background: #070a22; color: var(--on-ink-2); padding-block: clamp(44px, 7vh, 72px) 26px; position: relative; overflow: hidden; }
.tn-footer > * { position: relative; z-index: 1; }
.tn-footer .tn-stroke { color: #6f86ff; width: min(420px, 80%); }
.tn-footer h2 { color: #fff; font-weight: 900; font-size: clamp(2.2rem, 5vw, 4rem); margin: 0; }
.tn-footer h4 { color: #fff; font-size: .95rem; font-weight: 800; margin: 0 0 12px; }
.tn-footer a { color: var(--on-ink); text-decoration: none; }
.tn-footer a:hover { color: #fff; text-decoration: underline; }
.tn-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.tn-footer .tn-foot-end { border-top: 1px solid var(--rule-ink); margin-top: clamp(26px, 4vh, 44px); padding-top: 16px; gap: 16px; align-items: center; }
.tn-footer .tn-legal { margin: 0; font-size: .82rem; }

/* ---------- motion: entrance per sheet (content visible by default, JS only) ---------- */
.tn-js .tn-sheet .tn-rise { opacity: 0; transform: translateY(24px); filter: blur(4px); transition: opacity .8s var(--ease-out), transform .8s var(--ease-out), filter .8s var(--ease-out); transition-delay: var(--d, 0ms); }
.tn-js .tn-sheet.is-here .tn-rise { opacity: 1; transform: none; filter: none; }
.tn-js .tn-notes--row.tn-rise { transform: translateY(24px) rotate(-1.2deg); }
.tn-js .is-here .tn-notes--row.tn-rise { transform: rotate(-1.2deg); }

@keyframes tn-caret { 50% { opacity: 0; } }
@keyframes tn-cue { 0% { background-position: center 8px; } 70% { background-position: center 20px; opacity: 1; } 100% { background-position: center 22px; opacity: 0; } }
@keyframes tn-spin { to { transform: rotate(360deg); } }
@keyframes tn-flow { to { stroke-dashoffset: -24; } }

/* ---------- responsive ---------- */
@media (max-width: 1000px) { .tn-rail { display: none; } }
@media (max-width: 781px) {
  :root { --header-h: 64px; }
  .tn-sheet { min-height: auto; padding-block: calc(var(--header-h) + 36px) 56px; }
  .tn-sheet.tn-hero { min-height: 100svh; }
  .tn-split--vf > .wp-block-column:first-child { order: 2; } /* one order on phones: text, then visual */
  .tn-ai-board { grid-template-columns: 1fr; }
  .tn-keys-board { grid-template-columns: repeat(5, 54px); gap: 8px; }
  .tn-k { width: 54px; height: 54px; }
  .tn-k b, .tn-k i { font-size: 1.2rem; border-radius: 11px; }
  .tn-ledger > .wp-block-column + .wp-block-column { border-inline-start: 0; border-top: 1px solid var(--rule-ink); }
  .tn-notes--row { transform: none; }
  .tn-hashiye { transform: none; }
  .tn-pen-right { padding-inline-end: 54px; }
}
@media (max-width: 600px) { .admin-bar .wp-site-blocks > header { top: 0; } }

/* ---------- reduced motion: the settled state ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .tn-js .tn-sheet .tn-rise { opacity: 1; transform: none; filter: none; }
  .tn-js .tn-notes--row.tn-rise, .tn-js .is-here .tn-notes--row.tn-rise { transform: rotate(-1.2deg); }
  .tn-js .tn-stroke, .tn-js .tn-pen .tn-stroke { clip-path: none; }
  .tn-js .tn-pen .tn-pen-right { opacity: 1; transform: none; filter: none; }
  .tn-js .tn-pen .tn-pen-right::after { clip-path: none; }
  .tn-cand-bar i { transform: none !important; }
}

.tn-tok.is-resolved::after { transform: scaleX(1); height: 5px; border-radius: 1px 6px; }
@media (max-width: 781px) { .tn-ai-sentence { flex-wrap: wrap; white-space: normal; } }

/* pricing: the recommended plan's tag sits on the plan's top rule */
.tn-soon { margin-top: 18px !important; opacity: .75; }

/* ---------- new demos (v2.2): apps, ghost, letter, tone, speed ---------- */
/* apps (ink): app names as outlined tiles; the active one takes the ink-blue */
.tn-apps-board { width: min(460px, 100%); }
.tn-apps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.tn-app { display: grid; place-items: center; height: 64px; border: 1.5px solid var(--rule-ink); border-radius: 12px; color: var(--on-ink-2); font-weight: 800; font-size: .92rem; direction: ltr; transition: color .35s, border-color .35s, background-color .35s; }
.tn-app.is-on { color: #fff; border-color: #8aa4ff; background: rgba(31, 95, 232, .22); }
.tn-os { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 26px; border-top: 1px solid var(--rule-ink); }
.tn-os-item { display: grid; gap: 2px; padding: 14px 6px 0; text-align: center; color: var(--on-ink-2); }
.tn-os-item b { font-weight: 900; color: var(--on-ink); font-size: 1.05rem; }
.tn-os-item i { font-style: normal; font-size: .8rem; }
.tn-os-item.is-now i { color: #8aa4ff; font-weight: 800; }

/* ghost (paper): typed text, caret, then the model's grey continuation */
.tn-ghost-board { width: min(820px, 100%); margin-inline: auto; }
.tn-ghost-line { font-size: clamp(1.3rem, 2.6vw, 2.1rem); font-weight: 900; line-height: 1.7; color: var(--on-paper); margin: 0; min-height: 3.4em; border-bottom: 1.5px solid var(--rule-paper); padding-bottom: 12px; }
.tn-ghost-line .ghost { color: rgba(18, 23, 53, .3); transition: color .25s; }
.tn-ghost-line .ghost.is-taken { color: var(--on-paper); }
.tn-ghost-line .caret { display: inline-block; width: 2px; height: 1.1em; margin: 0 1px; vertical-align: -.15em; background: var(--blue); animation: tn-blink 1s steps(1) infinite; }
@keyframes tn-blink { 50% { opacity: 0; } }
.tn-ghost-hint { display: flex; align-items: center; gap: 10px; margin: 16px 0 0; color: var(--on-paper-2); font-size: .92rem; }
.tn-ghost-hint kbd, .tn-letter-key kbd { font: 800 .85rem Vazirmatn, Tahoma, sans-serif; padding: 5px 14px; border-radius: 7px; border: 1.5px solid currentColor; direction: ltr; transition: background-color .2s, color .2s; }
.tn-ghost-hint.is-pressed kbd { background: var(--blue); border-color: var(--blue); color: #fff; }

/* letter (ink): the casual line, the shortcut, then the formal letter on a paper leaf */
.tn-letter-board { width: min(460px, 100%); }
.tn-letter-msg { margin: 0; font-weight: 700; color: var(--on-ink); font-size: 1.05rem; transition: opacity .4s; }
.tn-letter-key { margin: 12px 0 16px; color: var(--on-ink-2); }
.tn-letter-board.is-pressed .tn-letter-key kbd { background: #8aa4ff; border-color: #8aa4ff; color: var(--ink); }
.tn-letter-board.is-done .tn-letter-msg { opacity: .45; text-decoration: line-through; text-decoration-color: #ffa3a3; }
.tn-letter-paper { background: var(--paper); color: var(--on-paper); border-radius: 4px; padding: 22px 24px; line-height: 1.95; opacity: 0; transform: translateY(14px); transition: opacity .6s var(--ease-out), transform .6s var(--ease-out); }
.tn-letter-board.is-done .tn-letter-paper { opacity: 1; transform: none; }
.tn-letter-paper p { margin: 0 0 6px; font-size: .95rem; }
.tn-letter-paper .tn-l-h { font-weight: 900; border-bottom: 1px solid var(--rule-paper); padding-bottom: 8px; margin-bottom: 10px; }
.tn-letter-paper .tn-l-s { text-align: left; font-weight: 800; margin: 10px 0 0; }

/* tone (paper): three registers, the chosen one underlined with the nib */
.tn-tone-board { width: min(820px, 100%); margin-inline: auto; text-align: center; }
.tn-tone-tabs { display: inline-flex; gap: 6px; padding: 5px; border: 1.5px solid var(--rule-paper); border-radius: 999px; }
.tn-tone-tab { padding: 6px 20px; border-radius: 999px; font-weight: 800; color: var(--on-paper-2); transition: background-color .3s, color .3s; }
.tn-tone-tab.is-on { background: var(--ink); color: #fff; }
.tn-tone-out { margin: 28px 0 0; min-height: 2.6em; font-size: clamp(1.25rem, 2.4vw, 1.9rem); font-weight: 900; line-height: 1.6; color: var(--on-paper); opacity: 0; transform: translateY(8px); transition: opacity .5s var(--ease-out), transform .5s var(--ease-out); }
.tn-tone-out.is-in { opacity: 1; transform: none; }

/* speed (ink): score ring, words per minute, seven-day marks */
.tn-speed-board { position: relative; width: min(340px, 100%); margin-inline: auto; text-align: center; }
.tn-gauge { width: 200px; height: 200px; display: block; margin: 0 auto; transform: rotate(-90deg); }
.tn-gauge circle { fill: none; stroke-width: 10; }
.tn-gauge .track { stroke: var(--rule-ink); }
.tn-gauge .val { stroke: #8aa4ff; stroke-linecap: round; }
.tn-speed-num { position: absolute; top: 62px; inset-inline: 0; margin: 0; font-size: 3.4rem; font-weight: 900; color: #fff; line-height: 1; }
.tn-speed-sub { margin: 14px 0 18px; color: var(--on-ink-2); font-size: .92rem; }
.tn-speed-bars { display: flex; align-items: flex-end; justify-content: center; gap: 12px; height: 64px; }
.tn-speed-bars i { width: 16px; height: var(--h); background: rgba(138, 164, 255, .35); border-radius: 3px 3px 0 0; transform: scaleY(0); transform-origin: bottom; transition: transform .8s var(--ease-out); }
.tn-speed-bars i:last-child { background: #8aa4ff; }
.tn-speed-board.is-in .tn-speed-bars i { transform: none; }
.tn-speed-note { margin: 10px 0 0; font-size: .78rem; color: var(--on-ink-2); }
@media (max-width: 781px) { .tn-app { height: 52px; font-size: .8rem; } .tn-apps { gap: 8px; } }
.tn-sheet--ink .tn-lines li { color: var(--on-ink-2); border-bottom-color: var(--rule-ink); }
.tn-sheet--ink .tn-lines li:first-child { border-top-color: var(--on-ink-2); }
.tn-sheet--ink .tn-lines li strong { color: var(--on-ink); }
.tn-header .tn-brand { margin-inline-end: clamp(28px, 4vw, 64px); }
.tn-header .tn-nav-group { gap: clamp(20px, 2.6vw, 40px); }
.tn-header .wp-block-navigation .wp-block-navigation__container { gap: clamp(18px, 2vw, 30px); }

/* pricing: the recommended plan is marked on its own top rule; nothing inside the column moves */
.tn-ledger .tn-badge { position: absolute; top: -2px; inset-inline-start: 50%; transform: translate(50%, -50%); margin: 0 !important; padding: 2px 14px; border-radius: 4px; background: var(--gold); color: var(--ink); font-size: .78rem; font-weight: 900; white-space: nowrap; line-height: 1.7; }
.tn-ledger .is-featured .tn-price { color: var(--gold); }
@media (min-width: 782px) { .tn-ledger li, .tn-ledger .tn-per { white-space: nowrap; } }

/* footer: white one-colour mark beside the wordmark (the logo's silhouette, via mask) */
.tn-footer .tn-foot-title { display: flex; align-items: center; gap: 16px; }
.tn-footer .tn-foot-title::before { content: ""; flex: none; width: 1.05em; height: 1.05em; background: #fff; -webkit-mask: url(assets/logo.png) center / contain no-repeat; mask: url(assets/logo.png) center / contain no-repeat; }
/* back to top */
.tn-footer .tn-totop { margin: 0; }
.tn-footer .tn-totop a { display: inline-flex; align-items: center; gap: 10px; padding: 9px 18px; border: 1.5px solid var(--rule-ink); border-radius: 999px; color: var(--on-ink); font-weight: 800; font-size: .9rem; text-decoration: none; transition: border-color .25s, background-color .25s; }
.tn-footer .tn-totop a::before { content: ""; width: 8px; height: 8px; border-top: 2px solid currentColor; border-left: 2px solid currentColor; transform: translateY(2px) rotate(45deg); }
.tn-footer .tn-totop a:hover { border-color: #8aa4ff; background: rgba(31, 95, 232, .18); }
.tn-ledger .tn-price { white-space: nowrap; font-size: clamp(1.5rem, 2.3vw, 2.1rem) !important; }

/* download button: one line on every width */
.tn-btn-download .wp-block-button__link,.tn-hero .wp-block-button__link{white-space:nowrap}
@media (max-width:420px){.tn-hero .wp-block-button__link{padding-inline:1.1em;font-size:.95rem}}

/* pricing on phones: room between stacked plans */
@media (max-width:781px){.tn-ledger>.wp-block-column{padding:28px 16px 26px}.tn-ledger .is-featured{margin-top:34px !important;border-inline-start:0}.tn-ledger .tn-per{min-height:0}.tn-ledger ul{margin-bottom:18px}.tn-ledger .wp-block-button__link{white-space:nowrap}}
