/* ==========================================================================
   Modern layer — loaded after theme-terminal.css. Keeps the dark base and
   the aurora background, but drops the scanlines, glitch text and glow
   borders for a calmer, more professional surface: one accent gradient
   taken from the aurora, hairline glass cards, and one hero entrance.
   ========================================================================== */

@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Geist+Mono:wght@400;500&display=swap");

:root:root, :root:root[data-theme] {
  --paper: #060809;
  --surface: rgba(11, 17, 16, .78);
  --surface-solid: #0b1110;
  --ink: #d5e6dd;
  --muted: #7f958b;
  --line: #17302a;
  --line-strong: #2a4a40;
  --accent: #3df09a;
  --accent-2: #3df09a;
  --spruce: #3df09a;          /* existing rules use --spruce: map it to the new accent */
  --spruce-soft: rgba(61, 240, 154, .10);
  --berry: #3df09a;
  --berry-ink: #03120b;
  --grad: linear-gradient(120deg, #3df09a 0%, #1fb6c9 100%);
  --glow: 0 0 0 1px rgba(61, 240, 154, .25), 0 18px 40px -22px rgba(61, 240, 154, .35);
  --font-display: "Space Grotesk", "IBM Plex Sans Arabic", system-ui, sans-serif;
  --font-body: "Space Grotesk", "IBM Plex Sans Arabic", system-ui, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, monospace;
  --radius-m: 16px;
  --radius-s: 10px;
}
:root:root:lang(ar), :root:root[data-theme]:lang(ar) {
  --font-display: "Readex Pro", "IBM Plex Sans Arabic", system-ui, sans-serif;
  --font-body: "IBM Plex Sans Arabic", "Readex Pro", system-ui, sans-serif;
}

/* Background: the aurora canvas (see bg.php). The terminal grid is off. */
body {
  background:
    radial-gradient(900px 500px at 85% -5%, rgba(61, 240, 154, .08), transparent 60%),
    var(--paper);
}
body::before { content: none; }

/* Glitch title is gone: the title is set once, cleanly. */
.hero-title[data-text]::before, .hero-title[data-text]::after { content: none; display: none; }

/* Header */
.site-header { background: rgba(6, 8, 9, .6); border-bottom: 1px solid var(--line); }
.brand { font-weight: 600; letter-spacing: -0.01em; }
.brand::before { content: none; }
.brand-mark, .brand i { background: var(--grad); }
.nav a, .nav li > a {
  position: relative; text-transform: none; letter-spacing: 0; font-size: .9rem; font-weight: 500;
  font-family: var(--font-display); color: var(--muted); text-shadow: none;
}
.nav a::after {
  content: ""; position: absolute; inset-inline: 0; bottom: -6px; height: 1px;
  background: var(--grad); transform: scaleX(0); transform-origin: left; transition: transform .25s;
}
.nav a:hover, .nav a:focus-visible { color: var(--ink); text-shadow: none; }
.nav a:hover::after, .nav a:focus-visible::after { transform: scaleX(1); }
.lang-switch { border-radius: 999px; border-color: var(--line-strong); font-family: var(--font-display); padding: 6px 12px; }
.lang-switch:hover { border-color: var(--accent); color: var(--accent); }

/* Buttons */
.btn {
  border-radius: 999px; border-color: var(--line-strong); color: var(--ink);
  font-family: var(--font-display); font-weight: 500; font-size: .92rem; letter-spacing: 0;
  padding: 11px 20px; background: rgba(255, 255, 255, .03);
  transition: background .2s, border-color .2s, color .2s, transform .2s;
}
.btn:hover { background: rgba(255, 255, 255, .07); color: var(--ink); border-color: rgba(255, 255, 255, .3); box-shadow: none; transform: translateY(-1px); }
.btn-primary { background: var(--grad); border-color: transparent; color: var(--berry-ink); font-weight: 600; }
.btn-primary:hover { background: var(--grad); color: var(--berry-ink); border-color: transparent; filter: brightness(1.08); }
.link { color: var(--accent); }
.link:hover { color: var(--ink); }
.tag { border-radius: 999px; border-color: var(--line-strong); background: rgba(255, 255, 255, .04); color: var(--ink); font-family: var(--font-display); font-size: .78rem; }
.chip { border-radius: 999px; border-color: var(--line-strong); font-family: var(--font-display); font-size: .85rem; }
.chip[aria-pressed="true"] { background: var(--grad); color: var(--berry-ink); border-color: transparent; }

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

/* Hero */
.hero-status { font-size: .85rem; letter-spacing: 0; text-transform: none; color: var(--muted); }
.hero-greeting { color: var(--accent); font-size: 1rem; font-weight: 500; }
.hero-title { font-size: clamp(2.5rem, 6.4vw, 4.9rem); font-weight: 600; letter-spacing: -0.035em; line-height: 1.02; max-width: 15ch; }
.hero-subtitle { color: var(--ink); font-size: clamp(1.05rem, 1.6vw, 1.25rem); font-weight: 400; opacity: .9; }
.hero-bio { color: var(--muted); font-size: 1.05rem; line-height: 1.7; }
.hero-cv { color: var(--accent); font-size: .92rem; }

.hero-term {
  background: rgba(10, 13, 20, .78); border: 1px solid var(--line-strong); border-radius: 18px;
  box-shadow: 0 40px 80px -40px rgba(0, 0, 0, .9), inset 0 1px 0 rgba(255, 255, 255, .05);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  font-family: var(--font-mono); font-size: .85rem;
}
.term-bar { border-bottom-color: var(--line); }
.term-bar i:nth-child(1), .term-bar i:nth-child(2), .term-bar i:nth-child(3) { background: rgba(255, 255, 255, .14); }
.term-prompt { color: var(--accent-2); }
.term-cursor::after { color: var(--accent-2); }

/* One orchestrated entrance for the hero, nothing else moves on its own. */
@media (prefers-reduced-motion: no-preference) {
  .hero-status, .hero-greeting, .hero-title, .hero-subtitle, .hero-bio, .hero-actions, .hero-term {
    animation: rise .8s cubic-bezier(.2, .7, .2, 1) both;
  }
  .hero-greeting { animation-delay: .05s; }
  .hero-title { animation-delay: .12s; }
  .hero-subtitle { animation-delay: .2s; }
  .hero-bio { animation-delay: .26s; }
  .hero-actions { animation-delay: .32s; }
  .hero-term { animation-delay: .18s; }
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* Sections */
.section + .section { border-top: 1px solid var(--line); }
.section-title { font-size: clamp(1.8rem, 3.6vw, 2.5rem); font-weight: 600; letter-spacing: -0.025em; }
:lang(en) .section-title::before { content: none; }

/* Cards: glass surface, hairline edge, no lift, no glow on every hover */
.service, .project, .quote, .skill-group, .process-step, .post-card, .cert, .repo {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .03);
  transition: border-color .25s, background .25s;
}
.service:hover, .project:hover, .quote:hover, .skill-group:hover, .process-step:hover {
  border-color: rgba(61, 240, 154, .35); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05);
  background: rgba(18, 23, 36, .85);
}
.service-icon { color: var(--accent); background: var(--spruce-soft); border-radius: 12px; }
.project-media img { filter: none; }
.project:hover .project-media img { transform: scale(1.02); }
.project-placeholder { color: var(--accent); }

/* Process: steps keep their order; the number is a quiet label, not a badge */
.process-step { box-shadow: none; }
.process-step:hover { box-shadow: none; }
.step-num { color: var(--accent-2); font-family: var(--font-mono); font-size: .8rem; letter-spacing: 0; }

/* Stats band: real figures, a single gradient on the numbers */
.stats-band { background: rgba(10, 13, 20, .5); border-block-color: var(--line); }
.stats-band .num {
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: none; font-weight: 600; letter-spacing: -0.02em;
}
.stats-band .lbl { font-size: .92rem; }

/* Footer */
.site-footer { background: rgba(6, 8, 9, .85); border-top: 1px solid var(--line); }
.socials a { font-family: var(--font-display); font-size: .9rem; color: var(--ink); }
.socials a:hover { color: var(--accent); }
.to-top { color: var(--accent); }

/* Terminal-style code is still mono, but everything else reads as product UI */
code, kbd, pre { font-family: var(--font-mono); }

/* Experience timeline */
.timeline { list-style: none; margin: 0; padding: 0 0 0 0; border-inline-start: 1px solid var(--line-strong); margin-inline-start: 5px; }
.timeline-item { position: relative; padding: 0 0 30px 26px; }
.timeline-item::before {
  content: ""; position: absolute; inset-inline-start: -5px; top: 7px; width: 9px; height: 9px; border-radius: 50%;
  background: var(--grad); box-shadow: 0 0 0 4px var(--paper);
}
.timeline-kind { font-size: .78rem; color: var(--accent-2); }
.timeline-item h3 { font-size: 1.1rem; margin: 6px 0 4px; }
.timeline-item p { margin: 0; }
.timeline-org { color: var(--ink); font-weight: 500; }
.timeline-period { color: var(--muted); font-size: .9rem; }
.timeline-text { color: var(--muted); margin-top: 8px; line-height: 1.7; }

/* Blog search */
.blog-tools { margin-bottom: 22px; display: grid; gap: 8px; }
.blog-search {
  width: min(100%, 380px); padding: 11px 16px; border-radius: 999px; font: inherit;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
}
.blog-search::placeholder { color: var(--muted); }
.blog-search:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
.blog-empty { color: var(--muted); margin: 0; }

/* Skill bars fill as they scroll into view (browsers that support scroll timelines) */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .bar > span { animation: fill-bar linear both; animation-timeline: view(); animation-range: entry 0% cover 45%; }
  }
}
@keyframes fill-bar { from { width: 0; } to { width: var(--w, 0%); } }

/* Icons: sizes and alignment for brand glyphs and UI glyphs */
.icon { flex: none; }
.socials a { display: inline-flex; align-items: center; gap: 8px; }
.socials .icon { width: 18px; height: 18px; }
.socials a:hover .icon { color: var(--accent-2); }
.wa-icon, .contact-list .icon { width: 18px; height: 18px; }
.btn .icon, .link .icon, .copy-link .icon { width: 16px; height: 16px; vertical-align: -3px; margin-inline-end: 6px; }
.link .icon-arrow { margin-inline: 6px 0; transition: transform .2s; }
.link:hover .icon-arrow { transform: translateX(3px); }
:lang(ar) .link:hover .icon-arrow { transform: translateX(-3px) scaleX(-1); }
:lang(ar) .link .icon-arrow { transform: scaleX(-1); }
.wa-fab { display: inline-flex; align-items: center; gap: 8px; }
.wa-fab .icon { width: 18px; height: 18px; }
