/* =========================================================================
   s7b.me — Flagship Swiss Precision Monolith (Production Stylesheet)
   Architectural hairlines, zero clutter, smooth GPU transitions, dark mode
   ========================================================================= */

:root {
  --bg: #F6EFE2;
  --bg-2: #ECE1CD;
  --surface: #FDF9F1;
  --ink: #3E271B;
  --ink-2: #6B4A36;
  --ink-soft: #8C705D;
  --accent: #D2702A;
  --accent-soft: rgba(210, 112, 42, 0.12);
  --border: rgba(62, 39, 27, 0.11);
  --border-strong: rgba(62, 39, 27, 0.24);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

html[data-theme="dark"] {
  --bg: #120D0A;
  --bg-2: #1B130E;
  --surface: #17110D;
  --ink: #F2E7D8;
  --ink-2: #C7B29B;
  --ink-soft: #8C7562;
  --accent: #E5833B;
  --accent-soft: rgba(229, 131, 59, 0.15);
  --border: rgba(242, 231, 216, 0.09);
  --border-strong: rgba(242, 231, 216, 0.2);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body {
  font-family: "IBM Plex Sans Arabic", system-ui, sans-serif;
  background: var(--bg); color: var(--ink); min-height: 100vh; line-height: 1.55;
  transition: background-color 0.32s var(--ease), color 0.28s;
  overflow-x: hidden;
}
#dot-canvas { position: fixed; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 95; }
button, a { font: inherit; color: inherit; }
button { background: none; border: none; cursor: pointer; }
a { text-decoration: none; }
button:focus-visible, a:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
svg { stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* Maintenance Screen */
.maintenance-screen { min-height: 100vh; display: grid; place-items: center; }
.maint-inner { display: flex; flex-direction: column; align-items: center; gap: 20px; }
.maint-logo { width: 220px; aspect-ratio: 2 / 1; direction: ltr; }

/* Architectural Sticky Top Bar */
.mono-bar {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.mono-bar-in {
  max-width: 980px; margin: 0 auto; padding: 11px 22px;
  display: flex; align-items: center; justify-content: space-between;
}
.bar-brand {
  display: inline-flex; align-items: center; padding: 1px 2px; border-radius: 6px;
}
.bar-logo-anim {
  width: 58px; height: 29px; display: block; direction: ltr;
}
.bar-logo-anim .s7b-mark-svg { width: 100%; height: 100%; }
.bar-logo-anim .s7b-mark-svg path { stroke-width: 5.4; }

/* Keep English strings crisp inside fixed RTL layout without mirroring geometry */
html[lang="en"] h1,
html[lang="en"] h2,
html[lang="en"] h3,
html[lang="en"] p,
html[lang="en"] .build-mile,
html[lang="en"] .nl-title,
html[lang="en"] .avail-chip { unicode-bidi: plaintext; }

.bar-utils { display: flex; align-items: center; gap: 5px; }
.util-btn, .util-lang {
  height: 30px; border-radius: 7px; display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--border); color: var(--ink-2);
  transition: border-color 0.15s, color 0.15s, background-color 0.15s;
}
.util-btn { width: 30px; }
.util-btn svg { width: 14px; height: 14px; }
.util-lang { padding: 0 9px; font-family: "IBM Plex Mono", monospace; font-size: 11px; font-weight: 600; }
.util-btn:hover, .util-lang:hover { border-color: var(--border-strong); color: var(--ink); }
.util-btn[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
.u-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); transition: opacity 0.2s; }
.util-btn[aria-pressed="false"] .u-dot { opacity: 0.28; }
.ic-on, html[data-theme="dark"] .ic-moon, html[data-theme="light"] .ic-sun { display: none; }
.util-btn[aria-pressed="true"] .ic-off { display: none; }
.util-btn[aria-pressed="true"] .ic-on { display: block; }

/* Main Grid Container */
.container { max-width: 980px; margin: 0 auto; padding: 0 22px 68px; }

/* Studio Client Focus Header (Zero Noise) */
.client-header {
  display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 16px;
  padding: 40px 0 24px; border-bottom: 1px solid var(--border);
}
.ch-owner { font-size: 13px; color: var(--accent); font-weight: 600; display: block; margin-bottom: 4px; }
.client-header h1 { font-size: clamp(26px, 4vw, 36px); font-weight: 600; letter-spacing: -0.025em; line-height: 1.15; }
.ch-right { display: flex; align-items: center; gap: 8px; }

/* Asymmetric Swiss Hero */
.hero {
  display: grid; grid-template-columns: 1.35fr 0.85fr; align-items: center; gap: 32px;
  padding: 52px 0 44px; border-bottom: 1px solid var(--border);
}
.hero-copy { display: flex; flex-direction: column; gap: 13px; }
.avail-chip {
  display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--ink-soft);
}
.live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: pulse 2.4s infinite; }
.hero h1 { font-size: clamp(32px, 5vw, 46px); font-weight: 700; letter-spacing: -0.03em; line-height: 1.12; }
.hero-sub { font-size: 16px; color: var(--ink-2); font-weight: 500; }
.hero-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding-top: 6px; }

.mail-pill {
  height: 36px; padding: 0 14px; border-radius: 8px;
  background: var(--ink); color: var(--bg);
  font-family: "IBM Plex Mono", monospace; font-size: 12.5px; direction: ltr;
  display: inline-flex; align-items: center; transition: background-color 0.18s, transform 0.18s var(--ease);
}
.mail-pill:hover { background: var(--accent); color: #FFFDF8; }
.mail-pill:active { transform: scale(0.98); }

.soc-icons { display: flex; gap: 6px; }
.soc-icons a {
  width: 36px; height: 36px; border-radius: 8px; display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--border); color: var(--ink-2);
  transition: border-color 0.16s, color 0.16s, transform 0.16s var(--ease);
}
.soc-icons a:hover { border-color: var(--ink); color: var(--ink); transform: translateY(-1px); }
.soc-icons a svg { width: 15px; height: 15px; fill: currentColor; stroke: none; }

.hero-logo { width: min(260px, 100%); aspect-ratio: 2 / 1; direction: ltr; justify-self: end; border-radius: 12px; }

/* Sections */
.sec { padding: 36px 0; border-bottom: 1px solid var(--border); }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 16px; }
.sec-head h2 { font-size: 14px; font-weight: 600; color: var(--ink); }
.mono-kicker { font-family: "IBM Plex Mono", monospace; font-size: 10.5px; letter-spacing: 0.08em; color: var(--ink-soft); }

/* Active Builds 3-Column Hairline Progress Strip */
.builds-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--surface);
  contain: layout style;
}
.build-card {
  text-align: start; padding: 18px 20px;
  border-inline-end: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 11px;
  transition: background-color 0.16s;
}
.build-card:last-child { border-inline-end: none; }
.build-card:hover { background: color-mix(in srgb, var(--bg) 55%, var(--surface)); }
.build-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.build-id { display: flex; align-items: center; gap: 9px; min-width: 0; }
.build-id strong { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.build-icon { width: 22px; height: 22px; border-radius: 6px; object-fit: cover; flex-shrink: 0; }
.build-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.build-pct { font-family: "IBM Plex Mono", monospace; font-size: 12px; font-weight: 500; color: var(--accent); font-variant-numeric: tabular-nums; }
.prog-track { height: 3px; border-radius: 3px; background: var(--bg-2); overflow: hidden; width: 100%; }
.prog-track i { display: block; height: 100%; background: var(--accent); border-radius: 3px; transition: width 0.5s var(--ease); }
.prog-track.thin { margin-top: 8px; height: 2.5px; }
.build-mile { font-size: 12px; color: var(--ink-soft); }

/* Segmented Filter Toolbar (Rock-steady — zero layout shift on tab change!) */
.sec-toolbar {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
  gap: 10px; min-height: 44px; margin-bottom: 20px;
}
.seg-nav { display: inline-flex; flex-wrap: wrap; gap: 3px; padding: 3px; border-radius: 9px; background: var(--surface); border: 1px solid var(--border); }
.cat-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 6px;
  font-size: 13px; font-weight: 500; color: var(--ink-soft); transition: background-color 0.16s, color 0.16s;
}
.cat-btn:hover { color: var(--ink); }
.cat-btn.active { background: var(--ink); color: var(--bg); font-weight: 600; }
.cat-cnt { font-family: "IBM Plex Mono", monospace; font-size: 10.5px; opacity: 0.65; }

.share-inline {
  display: flex; align-items: center; gap: 6px;
  transition: opacity 0.18s var(--ease), visibility 0.18s;
}
.share-inline.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.client-act {
  padding: 6px 12px; border-radius: 7px; font-size: 12.5px; font-weight: 600;
  background: var(--surface); border: 1px solid var(--border-strong); color: var(--ink-2);
  transition: border-color 0.15s, color 0.15s, background-color 0.15s;
}
.client-act:hover { border-color: var(--ink); color: var(--ink); }
.client-act.solid { background: var(--accent); border-color: var(--accent); color: #FFFDF8; }

/* Clean 16:9 Cinema Media Grid (Zero-flash pooled DOM nodes) */
.media-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px;
  contain: layout style;
}
.media-grid.is-focus-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); padding-top: 24px; }
.media-card {
  display: flex; flex-direction: column; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden;
  transition: border-color 0.2s, transform 0.22s var(--ease);
}
.media-card:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.media-card:hover .media-play span { transform: scale(1.08); background: var(--accent); color: #FFFDF8; }
.mc-frame { position: relative; aspect-ratio: 16 / 9; background: var(--bg-2); overflow: hidden; border-bottom: 1px solid var(--border); }
.mc-frame > img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.42s var(--ease); }
.media-card:hover .mc-frame > img { transform: scale(1.025); }
.mc-meta { padding: 13px 15px 14px; }
.mc-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.mc-row h3 { font-size: 14.5px; font-weight: 600; line-height: 1.35; }
.mc-stats { font-family: "IBM Plex Mono", monospace; font-size: 11px; color: var(--ink-soft); white-space: nowrap; direction: ltr; font-variant-numeric: tabular-nums; }
.mc-stats.accent { color: var(--accent); font-weight: 600; }
.mc-sub { font-size: 12.5px; color: var(--ink-soft); margin-top: 2px; }
.more-wrap { display: flex; justify-content: center; margin-top: 20px; }

/* Minimal Single-Line Notes Index */
.notes-index { display: flex; flex-direction: column; }
.note-line {
  display: grid; grid-template-columns: 34px 1fr auto; align-items: baseline; gap: 14px;
  padding: 13px 10px; border-bottom: 1px solid var(--border); text-align: start;
  border-radius: 8px; transition: background-color 0.15s;
}
.note-line:last-child { border-bottom: none; }
.note-line:hover { background: var(--surface); }
.nl-num { font-family: "IBM Plex Mono", monospace; font-size: 12px; color: var(--accent); }
.nl-title { font-size: 14.5px; font-weight: 500; }
.nl-meta { font-family: "IBM Plex Mono", monospace; font-size: 11.5px; color: var(--ink-soft); }

.foot {
  padding-top: 24px; display: flex; justify-content: space-between; align-items: center;
  font-family: "IBM Plex Mono", monospace; font-size: 11.5px; color: var(--ink-soft); direction: ltr;
}

@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }
@keyframes cardIn { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .media-card { animation: none; }
  .live-dot { animation: none; }
}

@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; padding: 34px 0; }
  .hero-logo { justify-self: start; width: 200px; }
  .builds-grid { grid-template-columns: 1fr; }
  .build-card { border-inline-end: none; border-bottom: 1px solid var(--border); }
  .build-card:last-child { border-bottom: none; }
  .media-grid, .media-grid.is-focus-grid { grid-template-columns: 1fr; }
}
