/*
Theme Name: Torban AI Portfolio
Theme URI: https://www.torban.me
Author: Ruslan Torban
Author URI: https://www.torban.me
Description: Custom single-page portfolio theme for Ruslan Torban — Program & PMO leadership, AI-augmented delivery. Built to work alongside the existing All in One SEO (AIOSEO) plugin, which continues to own meta tags, schema, and the XML sitemap.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
License: Unlicense
Text Domain: torban-ai
*/

/* ---------- Design tokens ---------- */
:root {
  --bg: #0b0c10;
  --bg-elevated: #14161d;
  --bg-card: #15171f;
  --border: #262935;
  --text: #eceef2;
  --text-dim: #9a9dab;
  --text-faint: #686c7a;
  --accent: #7c5cff;
  --accent-2: #22d3ee;
  --accent-contrast: #0b0c10;
  --radius: 14px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --max-w: 1100px;
}

:root[data-theme="light"] {
  --bg: #f7f7fb;
  --bg-elevated: #ffffff;
  --bg-card: #ffffff;
  --border: #e4e4ec;
  --text: #14151a;
  --text-dim: #53565f;
  --text-faint: #8a8d99;
  --accent-contrast: #ffffff;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f7f7fb;
    --bg-elevated: #ffffff;
    --bg-card: #ffffff;
    --border: #e4e4ec;
    --text: #14151a;
    --text-dim: #53565f;
    --text-faint: #8a8d99;
    --accent-contrast: #ffffff;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  transition: background .25s ease, color .25s ease;
}

.wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--accent);
  color: #fff;
  padding: 10px 16px;
  border-radius: 0 0 8px 0;
  z-index: 100;
}
.skip-link:focus { left: 0; }

/* ---------- Background mesh ---------- */
.bg-mesh {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(600px 400px at 15% 0%, rgba(124, 92, 255, 0.25), transparent 60%),
    radial-gradient(500px 400px at 85% 15%, rgba(34, 211, 238, 0.16), transparent 60%),
    radial-gradient(700px 500px at 50% 100%, rgba(124, 92, 255, 0.10), transparent 60%);
}
:root[data-theme="light"] .bg-mesh { opacity: 0.6; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .bg-mesh { opacity: 0.6; }
}

/* ---------- Typography ---------- */
h1, h2, h3 { font-weight: 650; letter-spacing: -0.02em; margin: 0 0 0.5em; }
h1 { font-size: clamp(2.4rem, 5vw, 4rem); line-height: 1.05; }
h2 { font-size: clamp(1.6rem, 3vw, 2.25rem); }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; color: var(--text-dim); }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-2);
  margin: 0 0 0.75em;
  text-align: center;
}

.gradient-text {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  gap: 24px;
}
.logo {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.logo-dot { color: var(--accent-2); }

.site-nav {
  display: flex;
  gap: 28px;
  flex: 1;
  justify-content: center;
}
.site-nav a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.92rem;
  transition: color .15s ease;
}
.site-nav a:hover { color: var(--text); }

.header-actions { display: flex; align-items: center; gap: 14px; }

.theme-toggle {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  width: 36px; height: 36px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.theme-toggle svg { width: 17px; height: 17px; }
.theme-toggle .icon-moon { display: none; }
:root[data-theme="light"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: block; }

.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  width: 36px; height: 36px;
  border-radius: 10px;
  align-items: center; justify-content: center;
  cursor: pointer;
}
.nav-toggle svg { width: 18px; height: 18px; }
.nav-toggle .icon-close { display: none; }
.nav-toggle[aria-expanded="true"] .icon-menu { display: none; }
.nav-toggle[aria-expanded="true"] .icon-close { display: block; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 24px;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-sm { padding: 9px 18px; font-size: 0.85rem; }

.btn-primary {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 8px 24px -8px rgba(124, 92, 255, 0.55);
}
.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover { border-color: var(--accent-2); }

/* ---------- Hero ---------- */
.hero { padding: 110px 0 80px; }
.hero-inner { text-align: center; max-width: 780px; }
.hero-sub {
  font-size: 1.15rem;
  max-width: 640px;
  margin: 24px auto 36px;
}
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

.hero-stats {
  margin: 64px auto 0;
  display: flex;
  justify-content: center;
  gap: 48px;
  flex-wrap: wrap;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}
.hero-stats dt {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  margin-bottom: 6px;
}
.hero-stats dd { margin: 0; font-weight: 600; }

.stat-row {
  display: flex;
  justify-content: center;
  gap: 48px;
  flex-wrap: wrap;
  margin-top: 40px;
}
.stat-row > div { text-align: center; }
.stat-row dt {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  margin-bottom: 6px;
}
.stat-row dd { margin: 0; font-weight: 600; }

/* ---------- Sections ---------- */
.section { padding: 88px 0; }
.section-alt { background: var(--bg-elevated); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-head { max-width: 640px; margin: 0 auto 48px; text-align: center; }
.section-intro { font-size: 1.05rem; }

.two-col {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 56px;
}
.col-label { text-align: center; }
.col-body p { font-size: 1.05rem; }

.testimonial-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  align-items: start;
}
.testimonial-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 26px;
}
.testimonial-quote {
  font-size: 0.98rem;
  line-height: 1.6;
  color: var(--text-dim);
  margin: 0 0 16px;
}
.testimonial-attribution {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-faint);
  margin: 0;
}

.pill-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.pill-list li {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.card-grid-5 { grid-template-columns: repeat(5, 1fr); }
.card-grid-2 { grid-template-columns: repeat(2, 1fr); }

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 22px;
  transition: border-color .2s ease, transform .2s ease;
}
.card:hover { border-color: var(--accent); transform: translateY(-3px); }
.card p { font-size: 0.92rem; margin-bottom: 0; }
.card-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
  color: var(--accent-2);
  background: color-mix(in srgb, var(--accent-2) 12%, transparent);
}
.card-icon svg { width: 20px; height: 20px; }

.section-note {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-faint);
  margin: 36px 0 0;
}
.section-note a { color: var(--accent-2); text-decoration: underline; }

/* ---------- Writing list ---------- */
.writing-list { list-style: none; padding: 0; margin: 0; }
.writing-list li { border-bottom: 1px solid var(--border); }
.writing-list li:first-child { border-top: 1px solid var(--border); }
.writing-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 4px;
  color: var(--text);
  text-decoration: none;
  font-size: 1.02rem;
  transition: color .15s ease, padding-left .15s ease;
}
.writing-list a:hover { color: var(--accent-2); padding-left: 8px; }
.writing-list a svg { width: 18px; height: 18px; flex-shrink: 0; color: var(--text-faint); }
.writing-list a:hover svg { color: var(--accent-2); }

/* ---------- Logo marquee ---------- */
.logo-marquee {
  overflow: hidden;
  cursor: grab;
  -webkit-mask-image: linear-gradient(90deg, transparent, black 8%, black 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, black 8%, black 92%, transparent);
}
.logo-marquee.is-dragging { cursor: grabbing; }
.logo-track {
  display: flex;
  align-items: center;
  gap: 24px;
  width: max-content;
  will-change: transform;
}
.logo-chip {
  flex-shrink: 0;
  width: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 64px;
  padding: 14px 20px;
  background: #ffffff;
  border-radius: 10px;
}
.logo-chip img {
  max-height: 28px;
  max-width: 120px;
  width: auto;
  height: auto;
  object-fit: contain;
  filter: grayscale(1);
  opacity: 0.75;
  transition: opacity .2s ease, filter .2s ease;
  -webkit-user-drag: none;
  user-select: none;
  pointer-events: none;
}
.logo-chip:hover img { filter: none; opacity: 1; }

/* ---------- Contact ---------- */
.contact-section { text-align: center; }
.contact-inner p { font-size: 1.1rem; margin-bottom: 32px; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); padding: 32px 0; }
.footer-inner {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.85rem;
  color: var(--text-faint);
}
.footer-inner a { color: var(--text-faint); text-decoration: none; }
.footer-inner a:hover { color: var(--text); }

/* ---------- Reveal-on-scroll ---------- */
.card, .writing-list li {
  opacity: 0;
  transform: translateY(14px);
  animation: reveal 0.6s ease forwards;
  animation-play-state: paused;
}
.is-visible { animation-play-state: running !important; }

@keyframes reveal {
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .card, .writing-list li { animation: none; opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Responsive ---------- */
@media (max-width: 880px) {
  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    padding: 4px 24px 12px;
  }
  .site-nav.is-open { display: flex; }
  .site-nav a { padding: 12px 0; border-bottom: 1px solid var(--border); }
  .site-nav a:last-child { border-bottom: none; }
  .nav-toggle { display: flex; }
  .two-col { grid-template-columns: 1fr; gap: 20px; }
  .card-grid, .card-grid-5 { grid-template-columns: 1fr 1fr; }
  .testimonial-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .hero { padding: 80px 0 56px; }
  .card-grid, .card-grid-5, .card-grid-2 { grid-template-columns: 1fr; }
  .hero-stats { gap: 28px; }
  .header-actions .btn-sm { display: none; }
  .stat-row { flex-direction: column; align-items: center; gap: 20px; }
}

/* ---------- Legacy plugin cleanup ---------- */
/* Hides the "Mobile Menu" plugin's hamburger/overlay from the old design.
   The theme has its own mobile nav toggle above; this plugin is unused now. */
.mob-menu-header-holder,
.mobmenu-overlay,
.mobmenur-container {
  display: none !important;
}

/* The "Mobile Menu" plugin also ships a hardcoded list of generic theme
   selectors it force-hides below 480px (targeting Astra/Divi/Genesis/etc.),
   and ".site-header" happens to be on that list. This restores our header
   with higher selector specificity so it wins over that rule. */
@media (max-width: 479px) {
  body header.site-header {
    display: block !important;
  }
}
