/*
  Mohamed Elhawawshi — Portfolio Design System
*/

:root {
  --bg: #ffffff;
  --bg-subtle: #fafafa;
  --text: #111111;
  --text-muted: #6b6b6b;
  --border: rgba(0, 0, 0, 0.09);
  --accent: #0f9d64;
  --radius: 10px;
  --transition: all 0.2s ease;
}

body.dark-mode {
  --bg: #0b0b0c;
  --bg-subtle: #131314;
  --text: #f2f2f2;
  --text-muted: #9a9a9a;
  --border: rgba(255, 255, 255, 0.1);
  --accent: #34d399;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
  max-width: 920px;
  margin: 0 auto;
  padding: 0 1.75rem;
}

.container-narrow {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 1.75rem;
}

a {
  color: inherit;
}

img {
  max-width: 100%;
  display: block;
}

/* Nav */
#navbar {
  position: sticky;
  top: 0;
  width: 100%;
  z-index: 100;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 920px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.75rem;
}

.logo {
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  letter-spacing: -0.01em;
}

.nav-controls {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.lang-switcher {
  display: flex;
  gap: 0.6rem;
}

.lang-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.2rem;
}

.lang-btn.active {
  color: var(--text);
}

.theme-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
}

.theme-btn:hover {
  border-color: var(--text-muted);
}

.icon-sun::before { content: "\2600"; }
body.dark-mode .icon-sun::before { content: "\263D"; }

/* Sections */
section {
  padding: 5rem 0;
  border-bottom: 1px solid var(--border);
}

section:last-of-type {
  border-bottom: none;
}

.section-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 2.5rem;
}

/* Hero */
.hero {
  padding-top: 6rem;
  padding-bottom: 5rem;
}

.eyebrow {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 1rem;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 2.9rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  max-width: 14ch;
  margin-bottom: 1.25rem;
}

.hero-desc {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 42ch;
  margin-bottom: 2.25rem;
}

.hero-actions {
  display: flex;
  gap: 0.85rem;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  padding: 0.75rem 1.4rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  transition: var(--transition);
  cursor: pointer;
}

.btn-primary {
  background: var(--text);
  color: var(--bg);
}

.btn-primary:hover {
  opacity: 0.85;
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: var(--text-muted);
}

/* ── iPhone mockup ── */
.iphone-mockup {
  position: relative;
  width: 100%;
  max-width: 200px;
  aspect-ratio: 9 / 19.5;
  background: #0a0a0a;
  border-radius: 2.5rem;
  padding: 10px;
  box-shadow: 0 25px 50px -18px rgba(0, 0, 0, 0.4);
  flex-shrink: 0;
}

.iphone-mockup::before {
  content: '';
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 38%;
  height: 18px;
  background: #0a0a0a;
  border-radius: 0 0 14px 14px;
  z-index: 2;
}

.iphone-mockup .screen {
  width: 100%;
  height: 100%;
  border-radius: 1.9rem;
  overflow: hidden;
  background: var(--bg-subtle);
}

.iphone-mockup .screen img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}

.iphone-mockup.large {
  max-width: 260px;
}

/* ── Apps grid (home) ── */
.apps-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.app-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  text-decoration: none;
  color: inherit;
  padding: 2.5rem 1.5rem;
  border: 1px solid var(--border);
  border-radius: 1.25rem;
  background: var(--bg-subtle);
  transition: var(--transition);
}

.app-card:hover {
  border-color: var(--text-muted);
  transform: translateY(-4px);
}

.app-card .iphone-mockup {
  margin-bottom: 1.75rem;
}

.app-card-name {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 0.4rem;
}

.app-card-tagline {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.app-card-cta {
  margin-top: 1.25rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
}

/* ── App detail page ── */
.app-hero {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 3.5rem;
  align-items: center;
  padding-top: 4rem;
}

.app-hero-media {
  display: flex;
  justify-content: center;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  margin-bottom: 2rem;
}

.back-link:hover {
  color: var(--text);
}

.app-icon-lg {
  width: 60px;
  height: 60px;
  border-radius: 15px;
  margin-bottom: 1.25rem;
}

.app-hero-info h1 {
  font-size: 2.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.6rem;
}

.app-hero-info .tagline {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 1.5rem;
}

.app-description {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text-muted);
  max-width: 52ch;
  margin-bottom: 2rem;
}

.install-row {
  display: flex;
  gap: 0.85rem;
  flex-wrap: wrap;
  margin-bottom: 1.75rem;
}

.install-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 1.3rem;
  border-radius: 0.65rem;
  background: var(--text);
  color: var(--bg);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
}

.install-btn i {
  font-size: 1.05rem;
}

.install-btn:hover {
  opacity: 0.85;
}

.legal-row {
  display: flex;
  gap: 1.1rem;
  flex-wrap: wrap;
  font-size: 0.88rem;
}

.legal-row a {
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid var(--text);
}

.legal-row a:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* About */
.about-text {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 56ch;
}

/* Contact */
.contact .container-narrow {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.contact .section-label {
  margin-bottom: 0.75rem;
}

.contact-desc {
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.social-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.85rem;
}

.social-row a {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--text);
  font-size: 1.05rem;
  transition: var(--transition);
}

.social-row a:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

/* Footer */
footer {
  padding: 2.5rem 0;
}

.footer-inner {
  color: var(--text-muted);
  font-size: 0.85rem;
  text-align: center;
}

/* Legal pages */
.legal-page {
  padding-top: 3.5rem;
}

.legal-page h1 {
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.6rem;
}

.legal-page .last-updated {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.legal-page .app-identity {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-bottom: 2.5rem;
}

.legal-content h2 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 2.25rem 0 0.9rem;
}

.legal-content p {
  color: var(--text-muted);
  margin-bottom: 1rem;
  line-height: 1.75;
}

.legal-content ul {
  padding-inline-start: 1.25rem;
  margin-bottom: 1rem;
}

.legal-content li {
  color: var(--text-muted);
  line-height: 1.75;
  margin-bottom: 0.5rem;
}

.legal-content strong {
  color: var(--text);
}

.legal-content a {
  color: var(--accent);
  font-weight: 600;
}

/* RTL */
html[dir="rtl"] .eyebrow,
html[dir="rtl"] .hero h1,
html[dir="rtl"] .hero-desc,
html[dir="rtl"] .about-text,
html[dir="rtl"] .app-description {
  max-width: none;
}

html[dir="rtl"] .iphone-mockup::before {
  left: 50%;
}

html[dir="rtl"] .back-link i {
  transform: scaleX(-1);
}

/* Responsive */
@media (max-width: 680px) {
  .apps-grid {
    grid-template-columns: 1fr;
  }

  .app-hero {
    grid-template-columns: 1fr;
    gap: 2rem;
    text-align: center;
    padding-top: 2.5rem;
  }

  .app-hero-info .app-icon-lg {
    margin-left: auto;
    margin-right: auto;
  }

  .app-description {
    margin-left: auto;
    margin-right: auto;
  }

  .install-row,
  .legal-row {
    justify-content: center;
  }
}


/* Motion and polish */
:root {
  --accent-soft: color-mix(in srgb, var(--accent) 12%, transparent);
  --shadow-card: 0 24px 70px -42px rgba(15, 157, 100, 0.42);
}

#navbar {
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(0.8rem, 2.2vw, 1.6rem);
  margin-left: auto;
  margin-right: 2rem;
}

.nav-links a {
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s ease;
}

.nav-links a:hover, .nav-links a:focus-visible { color: var(--accent); }
.logo-dot { color: var(--accent); }

.hero {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  min-height: min(76svh, 740px);
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  z-index: -1;
  width: min(66vw, 760px);
  aspect-ratio: 1;
  right: -22%;
  top: -26%;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-soft) 0%, color-mix(in srgb, var(--accent-soft) 45%, transparent) 42%, transparent 70%);
  animation: hero-drift 12s ease-in-out infinite alternate;
}

.hero h1 { font-size: clamp(2.6rem, 7vw, 4.7rem); max-width: 13ch; }
.hero-desc { font-size: clamp(1rem, 1.6vw, 1.15rem); }

.btn-primary { box-shadow: 0 8px 24px -14px var(--accent); }
.btn-primary:hover { opacity: 1; transform: translateY(-2px); box-shadow: 0 12px 28px -12px var(--accent); }
.btn-ghost:hover { transform: translateY(-2px); }

.app-card {
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 0 transparent;
  transition: transform 0.45s cubic-bezier(.2,.75,.25,1), border-color 0.3s ease, box-shadow 0.4s ease, background-color 0.3s ease;
}
.app-card::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle at 50% 0%, var(--accent-soft), transparent 54%);
  transition: opacity 0.4s ease;
}
.app-card:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  transform: translateY(-8px);
  box-shadow: var(--shadow-card);
}
.app-card:hover::before { opacity: 1; }
.app-card > * { position: relative; }
.app-card .iphone-mockup { transition: transform 0.55s cubic-bezier(.2,.75,.25,1); }
.app-card:hover .iphone-mockup { transform: translateY(-5px) rotate(-2deg) scale(1.025); }
.app-card:nth-child(even):hover .iphone-mockup { transform: translateY(-5px) rotate(2deg) scale(1.025); }

.social-row a:hover { transform: translateY(-4px) scale(1.06); box-shadow: 0 8px 22px -14px var(--accent); }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 70%, white); outline-offset: 4px; }

.motion-ready [data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.48s cubic-bezier(.2,.75,.25,1), transform 0.48s cubic-bezier(.2,.75,.25,1);
  transition-delay: var(--reveal-delay, 0ms);
}
.motion-ready [data-reveal].is-visible { opacity: 1; transform: translateY(0); }

@keyframes hero-drift {
  from { transform: translate3d(-3%, 1%, 0) scale(0.94); }
  to { transform: translate3d(3%, -2%, 0) scale(1.06); }
}

@media (max-width: 680px) {
  .nav-inner { flex-wrap: wrap; gap: 0.65rem; }
  .nav-links { order: 3; width: 100%; justify-content: center; margin: 0; padding-top: 0.35rem; }
  .nav-controls { margin-left: auto; gap: 0.8rem; }
  .hero { min-height: 66svh; padding-top: 4rem; }
  .hero::before { width: 110vw; right: -52%; top: -10%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .motion-ready [data-reveal] { opacity: 1; transform: none; }
}

/* A small 3D studio scene for the portfolio hero. */
.scroll-progress {
  position: fixed;
  inset: 0 auto auto 0;
  z-index: 1001;
  width: 100%;
  height: 3px;
  transform: scaleX(0);
  transform-origin: left center;
  background: linear-gradient(90deg, #34d399, #a3f5ca 55%, #d6ffe8);
  box-shadow: 0 0 14px rgba(52, 211, 153, .55);
  pointer-events: none;
}

html[dir="rtl"] .scroll-progress { transform-origin: right center; }

body.home-page .hero .container {
  width: 100%;
  max-width: 1100px;
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(320px, .98fr);
  align-items: center;
  gap: clamp(1rem, 5vw, 5rem);
}

.hero-copy { position: relative; z-index: 1; }
.hero-visual { position: relative; width: min(100%, 430px); aspect-ratio: 1; margin-inline: auto; perspective: 1100px; transform-style: preserve-3d; }
.hero-visual-inner { position: absolute; inset: 0; transform-style: preserve-3d; transform: rotateX(-5deg) rotateY(-8deg); transition: transform 420ms cubic-bezier(.2,.7,.2,1); }
.hero-visual.is-tilting .hero-visual-inner { transform: rotateX(var(--tilt-x)) rotateY(var(--tilt-y)); }
.visual-glow { position: absolute; inset: 18%; border-radius: 50%; background: radial-gradient(circle, rgba(52,211,153,.22), rgba(52,211,153,.07) 42%, transparent 70%); filter: blur(18px); transform: translateZ(-65px); animation: visual-breathe 5s ease-in-out infinite alternate; }
.visual-orbit { position: absolute; inset: 9%; border: 1px solid rgba(119,232,183,.22); border-radius: 50%; transform-style: preserve-3d; box-shadow: inset 0 0 35px rgba(52,211,153,.035), 0 0 35px rgba(52,211,153,.035); }
.visual-orbit-a { transform: rotateX(67deg) rotateZ(-25deg) translateZ(-5px); animation: orbit-turn 22s linear infinite; }
.visual-orbit-b { inset: 17%; border-color: rgba(210,255,232,.11); transform: rotateY(67deg) rotateZ(30deg) translateZ(-15px); animation: orbit-turn 29s linear infinite reverse; }
.visual-monogram { padding: 0; cursor: pointer; appearance: none; font: inherit; position: absolute; left: 50%; top: 49%; width: 42%; aspect-ratio: 1; display: grid; place-items: center; border: 1px solid rgba(182,255,219,.45); border-radius: 31%; color: #f1fff7; background: linear-gradient(145deg, rgba(63,192,139,.88), rgba(14,57,41,.96) 55%, rgba(8,22,17,.98)); box-shadow: 0 28px 75px rgba(0,0,0,.48), inset 3px 3px 0 rgba(255,255,255,.2), inset -8px -10px 24px rgba(0,0,0,.32), 0 0 50px rgba(52,211,153,.23); transform: translate(-50%,-50%) translateZ(62px) rotateX(8deg) rotateY(-10deg); animation: monogram-float 5s ease-in-out infinite; }
.visual-monogram:focus-visible { outline: 3px solid #a6f5ca; outline-offset: 8px; }
.visual-monogram.is-celebrating { animation: logo-celebrate .55s cubic-bezier(.2,.8,.25,1); }
.visual-monogram::before { content: ''; position: absolute; inset: 8px; border: 1px solid rgba(222,255,238,.18); border-radius: 26%; }
.visual-monogram span { font-size: clamp(4rem, 9vw, 6.8rem); line-height: 1; font-weight: 650; letter-spacing: -.1em; padding-right: .1em; text-shadow: 0 5px 18px rgba(0,0,0,.38); }
.visual-monogram i { position: absolute; width: 12px; height: 12px; top: 15%; right: 16%; border-radius: 50%; background: #c2ffdc; box-shadow: 0 0 22px #67efab; }
.visual-chip { position: absolute; z-index: 2; display: flex; align-items: center; gap: .65rem; padding: .65rem .85rem; border: 1px solid rgba(255,255,255,.16); border-radius: 14px; color: #edf9f2; background: linear-gradient(140deg, rgba(35,43,39,.92), rgba(16,20,18,.82)); box-shadow: 0 18px 38px rgba(0,0,0,.34), inset 0 1px rgba(255,255,255,.1); font-size: .72rem; font-weight: 700; letter-spacing: .12em; backdrop-filter: blur(12px); transform-style: preserve-3d; }
.chip-icon { display: grid; place-items: center; width: 29px; height: 29px; border-radius: 9px; color: #071c12; background: linear-gradient(145deg,#a6f5ca,#47d49a); font-size: .78rem; }
.chip-zikr { top: 18%; left: 4%; transform: translateZ(90px) rotate(-9deg); animation: chip-float 5.2s ease-in-out infinite; }
.chip-kinto { right: 0; bottom: 22%; transform: translateZ(110px) rotate(7deg); animation: chip-float 6s -1.8s ease-in-out infinite; }
.chip-web { right: 11%; top: 12%; transform: translateZ(75px) rotate(7deg); animation: chip-float 5.8s -2.4s ease-in-out infinite; }
.visual-caption { position: absolute; left: 50%; bottom: 7%; display: flex; align-items: center; gap: .55rem; padding: .55rem .85rem; border: 1px solid rgba(255,255,255,.09); border-radius: 99px; color: rgba(237,249,242,.72); background: rgba(16,20,18,.65); font-size: .62rem; letter-spacing: .12em; text-transform: uppercase; white-space: nowrap; transform: translateX(-50%) translateZ(50px); backdrop-filter: blur(10px); }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #65e5a4; box-shadow: 0 0 12px #65e5a4; }
.visual-spark { position: absolute; color: #a6f5ca; text-shadow: 0 0 18px rgba(102,229,164,.8); transform: translateZ(75px); animation: spark-float 3.2s ease-in-out infinite; }
.spark-one { right: 15%; top: 19%; font-size: 1.5rem; }
.spark-two { left: 14%; bottom: 18%; color: #f4df9c; font-size: 1rem; animation-delay: -1.2s; }

.app-card { perspective: 1000px; }
.app-card-inner { position: relative; z-index: 1; width: 100%; transform-style: preserve-3d; transition: transform 220ms cubic-bezier(.2,.7,.2,1); }
.app-card.is-tilting .app-card-inner { transform: rotateX(var(--tilt-x)) rotateY(var(--tilt-y)); }
.app-card::after { content: ''; position: absolute; inset: 0; z-index: 2; border-radius: inherit; opacity: 0; pointer-events: none; background: radial-gradient(circle at var(--shine-x,50%) var(--shine-y,50%), rgba(255,255,255,.12), transparent 38%); transition: opacity 180ms ease; }
.app-card.is-tilting::after { opacity: 1; }
.app-card .iphone-mockup, .app-card-name, .app-card-tagline { transform: translateZ(22px); }

@keyframes monogram-float { 0%,100% { margin-top: 0; } 50% { margin-top: -10px; } }
@keyframes chip-float { 0%,100% { translate: 0 0; } 50% { translate: 0 -9px; } }
@keyframes orbit-turn { from { rotate: 0deg; } to { rotate: 360deg; } }
@keyframes spark-float { 0%,100% { translate: 0 0; opacity: .7; } 50% { translate: 0 -8px; opacity: 1; } }
@keyframes logo-celebrate { 0%,100% { scale: 1; } 45% { scale: 1.11; filter: brightness(1.3); } 72% { scale: .97; } }
.game-particle { position: absolute; z-index: 5; left: 50%; top: 49%; width: 8px; height: 8px; border-radius: 2px; pointer-events: none; background: #a6f5ca; box-shadow: 0 0 14px rgba(102,229,164,.85); animation: game-burst .82s cubic-bezier(.15,.7,.25,1) forwards; }
.game-particle:nth-of-type(3n) { width: 5px; height: 5px; background: #fff0a8; box-shadow: 0 0 12px rgba(255,240,168,.8); }
@keyframes game-burst { 0% { opacity: 0; transform: rotate(var(--angle)) translateY(8px) scale(.2); } 18% { opacity: 1; } 100% { opacity: 0; transform: rotate(var(--angle)) translateY(calc(-1 * var(--distance))) rotate(150deg) scale(.05); } }
@keyframes visual-breathe { from { scale: .92; opacity: .6; } to { scale: 1.08; opacity: 1; } }

@media (max-width: 760px) {
  .projects, .services, .approach { padding-top: 6.25rem; }
  body.home-page .hero .container { grid-template-columns: 1fr; gap: 1.5rem; }
  .hero-visual { width: min(78vw, 360px); grid-row: 1; margin-bottom: .3rem; }
  .hero { padding-top: 3rem; }
  .hero h1 { font-size: clamp(2.3rem, 10vw, 3.6rem); }
}

@media (prefers-reduced-motion: reduce) {
  .hero-visual-inner, .app-card-inner { transform: none !important; }
  .visual-orbit-a, .visual-orbit-b, .visual-monogram, .visual-chip, .visual-spark, .visual-glow { animation: none !important; }
}

/* Centered frosted-glass navigation, with no full-width header bar. */
#navbar {
  position: fixed;
  inset: 1rem 0 auto;
  width: auto;
  z-index: 100;
  border: 0;
  background: transparent;
  backdrop-filter: none;
  pointer-events: none;
}

.nav-inner {
  width: max-content;
  max-width: calc(100vw - 1.5rem);
  margin-inline: auto;
  padding: .55rem .8rem;
  justify-content: center;
  gap: 1.2rem;
  border: 1px solid color-mix(in srgb, var(--text) 13%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  box-shadow: 0 14px 45px rgba(0,0,0,.16), inset 0 1px rgba(255,255,255,.13);
  backdrop-filter: blur(22px) saturate(155%);
  -webkit-backdrop-filter: blur(22px) saturate(155%);
  pointer-events: auto;
}

.nav-inner .logo { display: none; }
.nav-links { margin: 0; gap: clamp(.65rem, 1.8vw, 1.2rem); }
.nav-links a { color: var(--text); opacity: .76; font-size: .78rem; font-weight: 600; }
.nav-links a:hover, .nav-links a.is-active { opacity: 1; }
.nav-links a { position: relative; }
.nav-links a::after { content: ""; position: absolute; left: 50%; right: 50%; bottom: -.32rem; height: 2px; border-radius: 2px; background: var(--accent); transition: left .24s ease,right .24s ease; }
.nav-links a:hover::after, .nav-links a.is-active::after { left: .1rem; right: .1rem; }
.nav-controls { gap: .8rem; }
.lang-switcher { gap: .35rem; }
.lang-btn { border-radius: 99px; padding: .32rem .4rem; transition: color .2s ease, background .2s ease; }
.lang-btn.active { background: var(--accent-soft); color: var(--accent); }
.theme-btn { border: 0; background: var(--accent-soft); }

body.home-page .hero .container {
  width: 100%;
  max-width: 1100px;
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(320px, .98fr);
  align-items: center;
  gap: clamp(1rem, 5vw, 5rem);
}

.hero-copy { position: relative; z-index: 1; }
.section-heading { max-width: 690px; margin-bottom: 2.7rem; }
.section-heading .eyebrow { margin-bottom: .7rem; }
.section-heading .section-label { color: var(--text); font-size: clamp(1.8rem, 4vw, 2.65rem); letter-spacing: -.055em; line-height: 1.08; text-transform: none; margin: 0 0 .8rem; }
.section-intro { max-width: 55ch; color: var(--text-muted); font-size: 1.02rem; }
.projects, .services, .approach { padding-block: clamp(5rem, 9vw, 8rem); scroll-margin-top: 5.5rem; }

.app-card {
  background: linear-gradient(145deg, color-mix(in srgb, var(--bg) 54%, transparent), color-mix(in srgb, var(--bg-subtle) 70%, transparent));
  border-color: color-mix(in srgb, var(--text) 11%, transparent);
  backdrop-filter: blur(18px) saturate(145%);
  -webkit-backdrop-filter: blur(18px) saturate(145%);
  box-shadow: 0 18px 60px rgba(0,0,0,.08), inset 0 1px rgba(255,255,255,.1);
}
.app-card-inner { display: flex; flex-direction: column; align-items: center; }
.project-preview { width: 100%; margin-bottom: 1.35rem; transform: translateZ(20px); }
.project-preview-device { height: 405px; display: grid; place-items: center; }
.project-preview-device .iphone-mockup { max-width: 190px; margin: 0; }
.project-preview-cover { height: 255px; overflow: hidden; border-radius: 1.1rem; border: 1px solid color-mix(in srgb, var(--text) 12%, transparent); background: #101612; box-shadow: 0 18px 45px rgba(0,0,0,.24); }
.project-preview-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s cubic-bezier(.2,.7,.2,1); }
.app-card:hover .project-preview-cover img { transform: scale(1.045); }
.app-card-category { margin-bottom: .55rem; color: var(--accent); font-size: .66rem; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; }
.app-card-name { font-size: 1.55rem; margin-bottom: .35rem; }
.app-card-tagline { color: var(--text); font-size: .98rem; font-weight: 600; }
.app-card-description { max-width: 42ch; min-height: 4.6em; margin-top: .65rem; color: var(--text-muted); font-size: .85rem; line-height: 1.7; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.app-card-link { display: inline-flex; align-items: center; gap: .55rem; margin-top: 1.25rem; color: var(--accent); font-size: .82rem; font-weight: 700; }
.app-card-link i { transition: transform .2s ease; }
.app-card:hover .app-card-link i { transform: translateX(4px); }
html[dir="rtl"] .app-card:hover .app-card-link i { transform: translateX(-4px); }


.approach-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 1rem; }
.approach-card { position: relative; min-height: 250px; padding: 1.65rem; overflow: hidden; border: 1px solid color-mix(in srgb,var(--text) 11%,transparent); border-radius: 1.3rem; background: linear-gradient(145deg,color-mix(in srgb,var(--bg) 54%,transparent),color-mix(in srgb,var(--bg-subtle) 68%,transparent)); box-shadow: 0 18px 48px rgba(0,0,0,.07),inset 0 1px rgba(255,255,255,.11); backdrop-filter: blur(18px) saturate(145%); -webkit-backdrop-filter: blur(18px) saturate(145%); transition: transform .35s ease,border-color .3s ease,box-shadow .3s ease; }
.approach-card:hover { transform: translateY(-6px) rotateX(2deg); border-color: color-mix(in srgb,var(--accent) 44%,var(--border)); box-shadow: var(--shadow-card); }
.approach-number { position: absolute; top: 1.1rem; right: 1.25rem; color: color-mix(in srgb,var(--text) 23%,transparent); font-size: .75rem; font-weight: 700; letter-spacing: .1em; }
.approach-icon { display: grid; place-items: center; width: 46px; height: 46px; margin-bottom: 2.4rem; border: 1px solid color-mix(in srgb,var(--accent) 25%,transparent); border-radius: 14px; color: var(--accent); background: var(--accent-soft); font-size: 1rem; }
.approach-card h3 { margin-bottom: .55rem; font-size: 1.12rem; }
.approach-card p { max-width: 32ch; color: var(--text-muted); font-size: .9rem; line-height: 1.7; }

#about { scroll-margin-top: 5.5rem; }
#about .container-narrow { max-width: 920px; }
.about-panel { position: relative; padding: clamp(2rem,5vw,4rem); overflow: hidden; border: 1px solid color-mix(in srgb,var(--text) 12%,transparent); border-radius: 1.5rem; background: radial-gradient(ellipse at 90% 5%,color-mix(in srgb,var(--accent) 15%,transparent),transparent 44%),linear-gradient(145deg,color-mix(in srgb,var(--bg) 56%,transparent),color-mix(in srgb,var(--bg-subtle) 78%,transparent)); box-shadow: 0 22px 70px rgba(0,0,0,.09),inset 0 1px rgba(255,255,255,.12); backdrop-filter: blur(20px) saturate(145%); -webkit-backdrop-filter: blur(20px) saturate(145%); }
.about-title { max-width: 17ch; margin-bottom: 1rem; font-size: clamp(1.8rem,4.5vw,3rem); line-height: 1.08; letter-spacing: -.05em; }
.about-text { max-width: 58ch; font-size: 1rem; line-height: 1.8; }
.text-link { display: inline-flex; align-items: center; gap: .65rem; margin-top: 1.5rem; color: var(--accent); font-size: .9rem; font-weight: 700; text-decoration: none; }
.text-link i { transition: transform .2s ease; }
.text-link:hover i { transform: translateX(4px); }
.app-hero-cover { width: min(100%,420px); aspect-ratio: 1; overflow: hidden; border-radius: 1.5rem; box-shadow: 0 28px 70px rgba(0,0,0,.24); }
.app-hero-cover img { width: 100%; height: 100%; object-fit: cover; }
.contact .container-narrow { padding: clamp(2rem,5vw,3.5rem); border: 1px solid color-mix(in srgb,var(--text) 11%,transparent); border-radius: 1.5rem; background: radial-gradient(ellipse at 50% 0%,color-mix(in srgb,var(--accent) 13%,transparent),transparent 60%),color-mix(in srgb,var(--bg) 53%,transparent); box-shadow: 0 20px 65px rgba(0,0,0,.08),inset 0 1px rgba(255,255,255,.12); backdrop-filter: blur(18px) saturate(145%); -webkit-backdrop-filter: blur(18px) saturate(145%); }

@media (max-width: 760px) {
  .projects, .services, .approach { padding-top: 6.25rem; }
  body.home-page .hero .container { grid-template-columns: 1fr; }
  .hero-visual { grid-row: 1; }
  .approach-grid { grid-template-columns: 1fr; }
    .nav-inner { flex-wrap: nowrap; gap: .75rem; padding: .45rem .65rem; }
  .nav-links { order: initial; width: auto; gap: .55rem; padding: 0; margin: 0; }
  .nav-links a { font-size: .68rem; }
  .nav-controls { margin: 0; gap: .4rem; }
  .lang-switcher { gap: .1rem; }
  .lang-btn { font-size: .7rem; padding: .25rem .3rem; }
}

@media (prefers-reduced-motion: reduce) {
  .approach-card, .service-card, .project-preview-cover img, .app-card-link i, .text-link i { transition: none !important; }
}


.services { padding-block: clamp(4.5rem, 8vw, 7rem); scroll-margin-top: 5.5rem; border-block: 1px solid var(--border); background: radial-gradient(ellipse at 50% 45%,color-mix(in srgb,var(--accent) 6%,transparent),transparent 68%); }
.services-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 1rem; }
.service-card { position: relative; min-height: 255px; padding: 1.65rem; overflow: hidden; isolation: isolate; border: 1px solid color-mix(in srgb,var(--text) 11%,transparent); border-radius: 1.35rem; background: linear-gradient(145deg,color-mix(in srgb,var(--bg) 55%,transparent),color-mix(in srgb,var(--bg-subtle) 72%,transparent)); box-shadow: 0 18px 52px rgba(0,0,0,.08),inset 0 1px rgba(255,255,255,.12); backdrop-filter: blur(20px) saturate(150%); -webkit-backdrop-filter: blur(20px) saturate(150%); transition: transform .4s cubic-bezier(.2,.7,.2,1),border-color .3s ease,box-shadow .3s ease; }
.service-card:hover { transform: translateY(-7px) rotateX(2deg); border-color: color-mix(in srgb,var(--accent) 46%,var(--border)); box-shadow: 0 24px 70px rgba(0,0,0,.16),0 0 42px color-mix(in srgb,var(--accent) 10%,transparent); }
.service-icon { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 2rem; border: 1px solid color-mix(in srgb,var(--accent) 30%,transparent); border-radius: 15px; color: var(--accent); background: var(--accent-soft); font-size: 1.1rem; }
.service-index { position: absolute; top: 1.5rem; right: 1.5rem; color: color-mix(in srgb,var(--text) 25%,transparent); font-size: .72rem; font-weight: 700; letter-spacing: .12em; }
.service-card h3 { position: relative; z-index: 1; margin-bottom: .55rem; font-size: 1.12rem; }
.service-card p { position: relative; z-index: 1; max-width: 34ch; color: var(--text-muted); font-size: .88rem; line-height: 1.75; }
.service-orbit { position: absolute; z-index: -1; right: -44px; bottom: -72px; width: 190px; height: 190px; border: 1px solid color-mix(in srgb,var(--accent) 15%,transparent); border-radius: 50%; box-shadow: 0 0 0 22px color-mix(in srgb,var(--accent) 3%,transparent),0 0 0 48px color-mix(in srgb,var(--accent) 2%,transparent); transition: transform .7s ease; }
.service-card:hover .service-orbit { transform: scale(1.18) rotate(18deg); }
.app-hero-info .feature-list { display: flex; flex-wrap: wrap; gap: .55rem; margin: 1.15rem 0 1.5rem; padding: 0; list-style: none; }
.feature-list li { padding: .45rem .7rem; border: 1px solid color-mix(in srgb,var(--accent) 24%,transparent); border-radius: 99px; color: var(--text); background: color-mix(in srgb,var(--accent) 8%,transparent); font-size: .75rem; font-weight: 600; }
.app-gallery { grid-column: 1 / -1; margin-top: clamp(2rem,5vw,4rem); }
.app-gallery-heading { margin-bottom: 2rem; text-align: center; }
.app-gallery-heading .eyebrow { color: var(--accent); }
.app-gallery-heading h2 { margin: .5rem 0 0; font-size: clamp(1.65rem,3.5vw,2.5rem); letter-spacing: -.05em; }
.app-gallery-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); align-items: start; justify-items: center; gap: clamp(.7rem,3vw,2rem); }
.app-gallery-grid figure { width: min(100%,245px); padding: .65rem; border: 1px solid color-mix(in srgb,var(--text) 12%,transparent); border-radius: 2.3rem; background: linear-gradient(145deg,color-mix(in srgb,var(--bg) 55%,transparent),color-mix(in srgb,var(--bg-subtle) 75%,transparent)); box-shadow: 0 25px 70px rgba(0,0,0,.18),inset 0 1px rgba(255,255,255,.14); backdrop-filter: blur(18px); transition: transform .4s ease,box-shadow .4s ease; }
.app-gallery-grid figure:nth-child(2) { margin-top: 2.4rem; }
.app-gallery-grid figure:hover { transform: translateY(-8px) rotateY(3deg); box-shadow: 0 32px 85px rgba(0,0,0,.24); }
.app-gallery-grid .iphone-mockup { width: 100%; max-width: none; margin: 0; }
@media (max-width: 760px) { .services-grid { grid-template-columns: 1fr; } .service-card { min-height: 220px; } .app-gallery-grid figure { padding: .38rem; border-radius: 1.55rem; } .app-gallery-grid .iphone-mockup { border-radius: 1.35rem; } .app-gallery-grid .iphone-mockup::before { display: none; } .app-gallery-grid figure:nth-child(2) { margin-top: 1.1rem; } }

.contact-email { margin: .1rem 0 1.45rem; border-radius: 99px; box-shadow: 0 10px 32px color-mix(in srgb,var(--accent) 17%,transparent); }
.contact-email:hover { transform: translateY(-3px); box-shadow: 0 15px 40px color-mix(in srgb,var(--accent) 26%,transparent); }
@media (max-width: 420px) { .nav-inner { gap: .45rem; } .nav-links { gap: .4rem; } .nav-links a { font-size: .68rem; } .nav-controls { gap: .25rem; } .lang-btn { font-size: .68rem; padding: .2rem .24rem; } }
@media (max-width: 360px) {
  .nav-inner { width: calc(100vw - 1rem); flex-direction: column; gap: .25rem; padding: .4rem .55rem; border-radius: 18px; }
  .nav-links { width: 100%; justify-content: center; gap: .65rem; }
  .nav-links a { font-size: .66rem; white-space: nowrap; }
  .nav-controls { margin: 0 auto; gap: .45rem; }
  .lang-switcher { gap: .2rem; }
}

@media (max-width: 620px) {
  .nav-inner { width: min(calc(100vw - 1.25rem), 430px); flex-direction: column; gap: .38rem; padding: .55rem .8rem; border-radius: 22px; }
  .nav-links { width: 100%; justify-content: center; gap: clamp(.48rem, 2.4vw, .9rem); }
  .nav-links a { font-size: .96rem; white-space: nowrap; }
  .nav-controls { margin: 0 auto; gap: .65rem; }
  .lang-switcher { gap: .28rem; }
  .lang-btn { font-size: .88rem; padding: .38rem .45rem; }
  .theme-btn { width: 38px; height: 38px; }
  body.home-page .hero-visual { margin-top: .75rem; }
}
@media (prefers-reduced-motion: reduce) {
  .game-particle { display: none !important; }
  .visual-monogram.is-celebrating { animation: none !important; }
}

/* The page itself is now the entrance: no blocking splash screen. */
.home-page .hero .hero-copy [data-reveal].is-visible {
  animation: home-copy-in .78s cubic-bezier(.18,.72,.22,1) both;
  animation-delay: calc(var(--reveal-delay, 0ms) + 90ms);
}
.home-page .hero .hero-visual.is-visible {
  animation: home-scene-in 1s cubic-bezier(.18,.72,.22,1) both;
  animation-delay: 140ms;
}
@keyframes home-copy-in {
  from { opacity: 0; transform: translate3d(0, 28px, 0); filter: blur(10px); }
  72% { opacity: 1; transform: translate3d(0, -3px, 0); filter: blur(0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); filter: blur(0); }
}
@keyframes home-scene-in {
  from { opacity: 0; transform: translate3d(0, 16px, 0) scale(.91); filter: blur(12px); }
  72% { opacity: 1; transform: translate3d(0, -4px, 0) scale(1.015); filter: blur(0); }
  to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); filter: blur(0); }
}

/* More expressive scroll reveals throughout the portfolio. */
.motion-ready [data-reveal] {
  transform: translate3d(0, 26px, 0) scale(.985);
  filter: blur(7px);
  transition: opacity .68s cubic-bezier(.18,.72,.22,1), transform .68s cubic-bezier(.18,.72,.22,1), filter .68s ease;
}
.motion-ready [data-reveal].is-visible { transform: translate3d(0,0,0) scale(1); filter: blur(0); }
.section-heading { position: relative; }
.section-heading::after {
  content: '';
  display: block;
  width: 58px;
  height: 2px;
  margin-top: 1.2rem;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 8%, transparent));
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .75s cubic-bezier(.2,.75,.25,1) .2s;
}
.section-heading.is-visible::after { transform: scaleX(1); }
html[dir="rtl"] .section-heading::after { transform-origin: right center; }

/* Pointer-responsive light and depth for desktop; touch devices keep simple motion. */
.hero-visual::after {
  content: '';
  position: absolute;
  inset: 4%;
  z-index: 0;
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  background: radial-gradient(circle at var(--shine-x,50%) var(--shine-y,50%), rgba(125,255,197,.13), transparent 38%);
  transition: opacity .35s ease;
}
.hero-visual.is-tilting::after { opacity: 1; }
.service-card, .approach-card { transform-style: preserve-3d; }
.service-card::after, .approach-card::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  opacity: 0;
  pointer-events: none;
  background: radial-gradient(circle at var(--shine-x,50%) var(--shine-y,50%), rgba(132,255,201,.13), transparent 48%);
  transition: opacity .25s ease;
}
.service-card.is-tilting, .approach-card.is-tilting {
  transform: perspective(900px) rotateX(var(--tilt-x)) rotateY(var(--tilt-y)) translateY(-4px);
  border-color: color-mix(in srgb,var(--accent) 46%,var(--border));
  box-shadow: 0 24px 70px rgba(0,0,0,.16),0 0 42px color-mix(in srgb,var(--accent) 10%,transparent);
}
.service-card.is-tilting::after, .approach-card.is-tilting::after { opacity: 1; }
.service-icon, .approach-icon, .approach-card h3, .approach-card p { position: relative; z-index: 1; }
.service-index, .approach-number { z-index: 1; }
.service-icon, .approach-icon { transition: transform .42s cubic-bezier(.2,.75,.25,1), box-shadow .35s ease; }
.service-card:hover .service-icon { transform: translateY(-4px) rotate(-7deg) scale(1.08); box-shadow: 0 9px 24px color-mix(in srgb,var(--accent) 22%,transparent); }
.approach-card:hover .approach-icon { transform: rotate(-9deg) scale(1.1); box-shadow: 0 8px 22px color-mix(in srgb,var(--accent) 18%,transparent); }
.service-orbit { animation: service-orbit-spin 28s linear infinite; }
@keyframes service-orbit-spin { to { rotate: 360deg; } }
.app-card:hover .app-card-name { color: var(--accent); transition: color .25s ease; }
.about-panel { transition: transform .55s cubic-bezier(.2,.75,.25,1), box-shadow .45s ease; }
.about-panel:hover { transform: translateY(-5px); box-shadow: 0 28px 80px rgba(0,0,0,.14),inset 0 1px rgba(255,255,255,.14); }
.contact-email { position: relative; overflow: hidden; }
.contact-email::after {
  content: '';
  position: absolute;
  inset: -60% auto -60% -35%;
  width: 28%;
  transform: rotate(24deg) translateX(-220%);
  background: linear-gradient(90deg,transparent,rgba(255,255,255,.28),transparent);
  transition: transform .7s ease;
}
.contact-email:hover::after { transform: rotate(24deg) translateX(620%); }

@media (max-width: 760px) {
  .home-page .hero .hero-copy [data-reveal].is-visible { animation-duration: .62s; }
  .home-page .hero .hero-visual.is-visible { animation-duration: .72s; }
  .section-heading::after { margin-top: .95rem; }
  .service-orbit { animation-duration: 42s; }
  .about-panel:hover { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .home-page .hero .hero-copy [data-reveal].is-visible,
  .home-page .hero .hero-visual.is-visible { animation: none !important; }
  .motion-ready [data-reveal] { opacity: 1; transform: none; filter: none; transition: none; }
  .service-orbit { animation: none !important; }
  .contact-email::after { display: none; }
}

/* The mobile navigation keeps the same one-line glass pill as desktop. */
@media (max-width: 620px) {
  #navbar { inset: max(.65rem,env(safe-area-inset-top)) 0 auto; transition: transform .28s cubic-bezier(.2,.75,.25,1); }
  #navbar.nav-hidden { transform: translateY(calc(-100% - 1rem)); }
  .nav-inner {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    width: max-content;
    max-width: calc(100vw - .75rem);
    gap: clamp(.12rem, .8vw, .32rem);
    padding: .4rem .42rem;
    border-radius: 999px;
  }
  .nav-inner .logo { display: none; }
  .nav-links { display: flex; flex: 0 1 auto; align-items: center; justify-content: center; width: auto; gap: clamp(.24rem, 1vw, .48rem); margin: 0; padding: 0; }
  .nav-links a { white-space: nowrap; font-size: clamp(.72rem, 3.4vw, .86rem); }
  .nav-controls { display: flex; flex: 0 0 auto; align-items: center; margin: 0; gap: .1rem; }
  .lang-switcher { gap: 0; }
  .lang-btn { min-width: 27px; min-height: 32px; padding: .2rem .25rem; font-size: clamp(.67rem, 2.9vw, .74rem); }
  .theme-btn { flex: 0 0 auto; width: 32px; height: 32px; font-size: .78rem; }
}
@media (max-width: 360px) {
  .nav-inner { gap: .08rem; padding-inline: .32rem; }
  .nav-links { gap: .2rem; }
  .nav-links a { font-size: .68rem; }
  .nav-controls { gap: 0; }
  .lang-btn { min-width: 24px; padding-inline: .16rem; font-size: .62rem; }
  .theme-btn { width: 28px; height: 28px; }
}

/* A short, skippable opening sequence that leads into the actual home page. */
html.intro-active, html.intro-active body { overflow: hidden; }
.opening-screen {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: none;
  place-items: center;
  overflow: hidden;
  color: #f4faf6;
  background: #080b09;
  opacity: 1;
  transition: opacity .58s cubic-bezier(.2,.75,.25,1), transform .58s cubic-bezier(.2,.75,.25,1), visibility .58s;
}
html.intro-active .opening-screen { display: grid; }
.opening-screen::before {
  content: '';
  position: absolute;
  inset: -20%;
  opacity: .35;
  background-image: linear-gradient(rgba(144,255,198,.045) 1px,transparent 1px),linear-gradient(90deg,rgba(144,255,198,.045) 1px,transparent 1px);
  background-size: 54px 54px;
  mask-image: radial-gradient(ellipse at center,#000 0%,transparent 68%);
  animation: opening-grid-drift 22s linear infinite;
}
.opening-screen::after {
  content: '';
  position: absolute;
  width: min(78vw,760px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle,rgba(30,166,111,.15),rgba(15,89,58,.06) 38%,transparent 68%);
  filter: blur(18px);
  animation: opening-glow 2.2s ease-in-out infinite alternate;
}
.opening-frame {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto 1fr auto;
  width: min(calc(100% - 56px),1320px);
  height: min(calc(100svh - 48px),900px);
  padding: clamp(1.25rem,4vw,3.5rem);
  border: 1px solid rgba(205,255,226,.13);
  border-radius: 28px;
  background: linear-gradient(145deg,rgba(18,27,22,.6),rgba(7,11,9,.34));
  box-shadow: 0 32px 120px rgba(0,0,0,.3),inset 0 1px rgba(255,255,255,.045);
  animation: opening-frame-in .65s cubic-bezier(.2,.75,.25,1) both;
}
.opening-top,.opening-bottom { display:flex; align-items:center; justify-content:space-between; gap:1rem; color:rgba(228,244,234,.52); font-size:.7rem; font-weight:650; letter-spacing:.12em; text-transform:uppercase; }
.opening-brand { display:flex; align-items:center; gap:.65rem; color:rgba(244,250,246,.9); font-size:.77rem; letter-spacing:.02em; text-transform:none; }
.opening-mini-mark { display:grid; place-items:center; width:27px; height:27px; border:1px solid rgba(99,226,163,.55); border-radius:9px; color:#9af2c8; background:rgba(52,211,153,.12); font-size:.8rem; font-weight:800; }
.opening-index i,.opening-bottom i { color:#63e2a3; font-style:normal; }
.opening-skip { padding:.55rem .85rem; border:1px solid rgba(222,255,238,.16); border-radius:99px; color:#f4faf6; background:rgba(255,255,255,.035); font:inherit; font-size:.7rem; letter-spacing:.08em; text-transform:uppercase; cursor:pointer; transition:background .2s ease,border-color .2s ease,transform .2s ease; }
.opening-skip:hover { transform:translateY(-2px); border-color:rgba(99,226,163,.6); background:rgba(52,211,153,.1); }
.opening-center { align-self:center; display:flex; flex-direction:column; align-items:center; text-align:center; transform:translateY(-1.5%); }
.opening-kicker { color:#72e8ac; font-size:.68rem; font-weight:700; letter-spacing:.25em; opacity:0; animation:opening-rise .34s ease-out forwards; }
.opening-emblem { width:clamp(120px,20vw,190px); margin:clamp(1rem,3vh,2rem) 0 .8rem; filter:drop-shadow(0 0 30px rgba(66,221,151,.24)); }
.opening-emblem svg { display:block; width:100%; overflow:visible; }
.opening-emblem circle,.opening-emblem path { fill:none; stroke-linecap:round; stroke-linejoin:round; }
.opening-ring { stroke:rgba(89,225,159,.68); stroke-width:1.2; stroke-dasharray:296; stroke-dashoffset:296; animation:opening-draw .68s cubic-bezier(.2,.75,.25,1) forwards,opening-turn 20s .75s linear infinite; transform-origin:60px 60px; }
.opening-letter { stroke:#f3fff8; stroke-width:3.5; stroke-dasharray:190; stroke-dashoffset:190; animation:opening-draw .44s .12s cubic-bezier(.2,.75,.25,1) forwards; }
.opening-spark { stroke:#a6f5ca; stroke-width:2.8; stroke-dasharray:30; stroke-dashoffset:30; animation:opening-draw .2s .42s ease-out forwards; }
.opening-name { margin:.25rem 0 .15rem; color:#f5faf7; font-size:clamp(2.4rem,7vw,5.8rem); line-height:1; letter-spacing:-.075em; opacity:0; animation:opening-rise .42s .1s cubic-bezier(.2,.75,.25,1) forwards; }
.opening-name span { color:#a5f0c8; }
.opening-name i { color:#45d697; font-style:normal; }
.opening-subtitle { margin-top:.7rem; color:rgba(229,242,234,.55); font-size:clamp(.9rem,1.4vw,1.08rem); letter-spacing:.025em; opacity:0; animation:opening-rise .38s .2s ease-out forwards; }
.opening-progress { width:min(220px,48vw); height:2px; margin-top:clamp(1.3rem,4vh,2.3rem); overflow:hidden; border-radius:5px; background:rgba(255,255,255,.12); }
.opening-progress span { display:block; width:100%; height:100%; background:linear-gradient(90deg,#32c987,#b8f8d2); transform:scaleX(0); transform-origin:left; animation:opening-progress 2.8s .08s cubic-bezier(.6,0,.4,1) forwards; box-shadow:0 0 14px rgba(83,222,153,.8); }
.opening-bottom { font-size:.62rem; }
.opening-screen.is-leaving { opacity:0; transform:scale(1.018); visibility:hidden; pointer-events:none; }
@keyframes opening-draw { to { stroke-dashoffset:0; } }
@keyframes opening-rise { from { opacity:0; transform:translateY(16px); filter:blur(7px); } to { opacity:1; transform:translateY(0); filter:blur(0); } }
@keyframes opening-frame-in { from { opacity:0; transform:scale(.975); } to { opacity:1; transform:scale(1); } }
@keyframes opening-progress { to { transform:scaleX(1); } }
@keyframes opening-turn { to { rotate:360deg; } }
@keyframes opening-glow { from { scale:.88; opacity:.62; } to { scale:1.09; opacity:1; } }
@keyframes opening-grid-drift { to { transform:translate3d(54px,54px,0); } }
@media (max-width:620px) {
  .opening-frame { width:100%; height:100svh; min-height:100vh; padding:1.3rem 1.15rem; border:0; border-radius:0; background:radial-gradient(ellipse at 50% 46%,rgba(23,87,58,.18),transparent 62%),#080b09; }
  .opening-top { font-size:.58rem; }
  .opening-brand { font-size:.68rem; }
  .opening-mini-mark { width:24px; height:24px; }
  .opening-skip { padding:.5rem .7rem; font-size:.62rem; }
  .opening-center { transform:translateY(-3%); }
  .opening-kicker { font-size:.57rem; letter-spacing:.18em; }
  .opening-bottom { font-size:.52rem; letter-spacing:.08em; }
}
@media (prefers-reduced-motion:reduce) {
  .opening-screen { display:none; }
  html.intro-active,html.intro-active body { overflow:auto; }
}
