/* =========================================================
   Isdin Aghmir - Platform Engineer · LLMOps / AIOps
   x.ai-inspired theme: pure black, white, minimal.
   ========================================================= */

/* ---------- Design tokens ---------- */
:root {
  --bg: #000000;
  --bg-elev: #0a0a0a;
  --bg-card: #0d0d0d;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #f5f5f5;
  --text-dim: #a1a1aa;
  --text-mute: #6b7280;
  --white: #ffffff;
  --accent: #ffffff;
  --radius: 14px;
  --radius-sm: 10px;
  --maxw: 1180px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-soft: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- Reset ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul { list-style: none; margin: 0; padding: 0; }

h1, h2, h3, h4 {
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.08;
}

::selection { background: #ffffff; color: #000000; }

/* ---------- Layout helpers ---------- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 110px 0;
  position: relative;
}

.section-sm { padding: 72px 0; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-mute);
  margin-bottom: 22px;
}

.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: var(--border-strong);
}

.section-title {
  font-size: clamp(30px, 4vw, 46px);
  max-width: 720px;
  margin-bottom: 20px;
}

.section-lead {
  color: var(--text-dim);
  max-width: 620px;
  font-size: 18px;
}

/* ---------- Background parallax layers ---------- */
.bg-grid {
  position: fixed;
  top: -15%;
  left: 0;
  right: 0;
  height: 130%;
  z-index: -2;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 55% at 50% 15%, #000 40%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 80% 55% at 50% 15%, #000 40%, transparent 100%);
  pointer-events: none;
  will-change: transform;
}

.bg-glow {
  position: fixed;
  top: -260px;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 600px;
  z-index: -2;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.10), transparent 62%);
  filter: blur(30px);
  pointer-events: none;
  will-change: transform;
}

/* Second, opposite-moving glow blob for layered depth */
.bg-orb {
  position: fixed;
  bottom: -280px;
  right: -180px;
  width: 760px;
  height: 760px;
  z-index: -2;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.055), transparent 60%);
  filter: blur(50px);
  pointer-events: none;
  will-change: transform;
}

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  transition: background 0.3s ease, border-color 0.3s ease, backdrop-filter 0.3s ease;
  border-bottom: 1px solid transparent;
}

.site-header.scrolled {
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  letter-spacing: -0.01em;
  font-size: 16px;
}

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--white);
  color: #000;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -0.03em;
}

.brand-mark svg { width: 17px; height: 17px; }

.brand small {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-mute);
  font-weight: 400;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 34px;
}

.nav-links a {
  font-size: 14.5px;
  color: var(--text-dim);
  transition: color 0.2s ease;
}

.nav-links a:hover { color: var(--text); }

.nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.lang-switch {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--text-mute);
  border: 1px solid var(--border);
  padding: 6px 10px;
  border-radius: 8px;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.lang-switch:hover { color: var(--text); border-color: var(--border-strong); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 15px;
  font-weight: 500;
  padding: 12px 20px;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  white-space: nowrap;
}

.btn svg { width: 16px; height: 16px; }

.btn-primary {
  background: var(--white);
  color: #000;
}
.btn-primary:hover { transform: translateY(-2px); background: #e6e6e6; }

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-ghost:hover { border-color: var(--white); transform: translateY(-2px); }

.btn-sm { padding: 9px 15px; font-size: 14px; }

/* ---------- Hero ---------- */
.hero {
  padding: 190px 0 120px;
  position: relative;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 6px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13px;
  color: var(--text-dim);
  background: var(--bg-elev);
  margin-bottom: 30px;
}

.hero-badge .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
}

.hero h1 {
  font-size: clamp(40px, 7vw, 84px);
  letter-spacing: -0.035em;
  max-width: 15ch;
  margin-bottom: 26px;
}

.hero h1 .muted { color: var(--text-mute); }

.hero-sub {
  font-size: clamp(17px, 2vw, 21px);
  color: var(--text-dim);
  max-width: 60ch;
  margin-bottom: 38px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 56px;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 48px;
  padding-top: 40px;
  border-top: 1px solid var(--border);
}

.stat .num {
  font-size: 34px;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.stat .label {
  font-size: 13.5px;
  color: var(--text-mute);
  margin-top: 4px;
}

/* ---------- Marquee (dual, counter-scrolling) ---------- */
.marquee-wrap {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.marquee {
  padding: 22px 0;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}

.marquee--alt {
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.015);
}

.marquee-track {
  display: flex;
  gap: 56px;
  width: max-content;
  animation: scroll-x 55s linear infinite;
}

/* Second row scrolls the opposite way at a different speed */
.marquee-track.rev {
  animation-name: scroll-x-rev;
  animation-duration: 46s;
}

.marquee--alt .marquee-track span { color: var(--text-mute); }

.marquee-wrap:hover .marquee-track { animation-play-state: paused; }

.marquee-track span {
  font-family: var(--mono);
  font-size: 15px;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 56px;
}

.marquee-track span::after {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text-mute);
}

@keyframes scroll-x {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@keyframes scroll-x-rev {
  from { transform: translateX(-50%); }
  to { transform: translateX(0); }
}

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 64px;
  align-items: start;
}

.about-grid p {
  color: var(--text-dim);
  font-size: 18px;
  margin: 0 0 20px;
}

.about-grid p strong { color: var(--text); font-weight: 600; }

.about-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  padding: 28px;
}

.about-panel h4 {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-mute);
  margin-bottom: 20px;
  font-weight: 400;
}

.about-list li {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 15.5px;
}
.about-list li:first-child { border-top: none; padding-top: 0; }

.about-list svg {
  width: 18px;
  height: 18px;
  flex: none;
  margin-top: 3px;
  color: var(--white);
}

/* ---------- Services / expertise cards ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 56px;
}

.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  padding: 30px;
  transition: border-color 0.25s ease, transform 0.25s ease, background 0.25s ease;
  position: relative;
  overflow: hidden;
}

.card:hover {
  border-color: var(--border-strong);
  transform: translateY(-4px);
  background: #111;
}

.card-icon {
  width: 46px;
  height: 46px;
  border-radius: 11px;
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  margin-bottom: 22px;
  background: var(--bg-elev);
}
.card-icon svg { width: 22px; height: 22px; color: var(--white); }

.card h3 {
  font-size: 20px;
  margin-bottom: 10px;
}

.card p {
  color: var(--text-dim);
  font-size: 15px;
  margin: 0 0 18px;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.card-tags span {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text-mute);
  border: 1px solid var(--border);
  padding: 4px 9px;
  border-radius: 7px;
}

/* ---------- Work / case studies ---------- */
.work-list {
  margin-top: 48px;
  border-top: 1px solid var(--border);
}

.work-item {
  display: grid;
  grid-template-columns: 60px 1fr auto;
  gap: 28px;
  align-items: center;
  padding: 30px 6px;
  border-bottom: 1px solid var(--border);
  transition: padding 0.25s ease, background 0.25s ease;
}

.work-item:hover { padding-left: 20px; padding-right: 20px; background: var(--bg-elev); }

.work-num {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-mute);
}

.work-body h3 { font-size: 22px; margin-bottom: 8px; }
.work-body p { color: var(--text-dim); font-size: 15.5px; margin: 0; max-width: 62ch; }

.work-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  max-width: 260px;
}
.work-meta span {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text-dim);
  border: 1px solid var(--border);
  padding: 4px 9px;
  border-radius: 7px;
}

/* ---------- Process ---------- */
.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-top: 52px;
}

.step {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  background: var(--bg-card);
}

.step .step-n {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-mute);
  margin-bottom: 26px;
}

.step h4 { font-size: 18px; margin-bottom: 8px; }
.step p { color: var(--text-dim); font-size: 14.5px; margin: 0; }

/* ---------- CTA / contact ---------- */
.contact-card {
  border: 1px solid var(--border);
  border-radius: 24px;
  background:
    radial-gradient(ellipse 60% 100% at 50% 0%, rgba(255, 255, 255, 0.06), transparent 70%),
    var(--bg-card);
  padding: 72px 40px;
  text-align: center;
}

.contact-card h2 {
  font-size: clamp(30px, 4.5vw, 52px);
  margin-bottom: 18px;
}

.contact-card p {
  color: var(--text-dim);
  font-size: 18px;
  max-width: 52ch;
  margin: 0 auto 34px;
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
}

.contact-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  justify-content: center;
  margin-top: 44px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.contact-meta a, .contact-meta span {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--text-dim);
  font-size: 15px;
  transition: color 0.2s ease;
}
.contact-meta a:hover { color: var(--text); }
.contact-meta svg { width: 17px; height: 17px; color: var(--text-mute); }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 48px 0 40px;
}

.footer-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: center;
  justify-content: space-between;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
}

.footer-copy { color: var(--text-mute); font-size: 14px; }

.footer-social { display: flex; gap: 12px; }

.footer-social a {
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 9px;
  display: grid;
  place-items: center;
  color: var(--text-dim);
  transition: border-color 0.2s ease, color 0.2s ease;
}
.footer-social a:hover { border-color: var(--white); color: var(--white); }
.footer-social svg { width: 18px; height: 18px; }

/* ---------- Mobile nav ---------- */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  padding: 6px;
}
.nav-toggle svg { width: 26px; height: 26px; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .about-grid { grid-template-columns: 1fr; gap: 36px; }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 780px) {
  .nav-links {
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: rgba(0, 0, 0, 0.96);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    padding: 8px 24px 20px;
    transform: translateY(-120%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s ease, opacity 0.3s ease;
  }
  .nav-links.open { transform: translateY(0); opacity: 1; pointer-events: auto; }
  .nav-links a { width: 100%; padding: 14px 0; border-bottom: 1px solid var(--border); font-size: 16px; }
  .nav-toggle { display: inline-flex; }
  .nav-right .btn { display: none; }
}

@media (max-width: 620px) {
  body { font-size: 16px; }
  .section { padding: 80px 0; }
  .hero { padding: 140px 0 90px; }
  .cards, .steps { grid-template-columns: 1fr; }
  .work-item { grid-template-columns: 1fr; gap: 12px; }
  .work-meta { justify-content: flex-start; max-width: none; }
  .hero-stats { gap: 30px; }
  .contact-card { padding: 48px 22px; }
}

/* =========================================================
   Apple-style motion layer
   ========================================================= */

/* Scroll progress bar */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0;
  background: linear-gradient(90deg, rgba(255,255,255,0.4), #fff);
  z-index: 200;
  pointer-events: none;
  transition: width 0.12s linear;
}

/* Header hide-on-scroll (transform added to existing transition via this rule) */
.site-header {
  will-change: transform;
  transition: transform 0.5s var(--ease), background 0.3s ease, border-color 0.3s ease, backdrop-filter 0.3s ease;
}
.site-header.hidden { transform: translateY(-100%); }

/* Reveal on scroll — smooth, blurred, spring-like easing */
.reveal {
  opacity: 0;
  transform: translateY(34px) scale(0.985);
  filter: blur(8px);
  transition:
    opacity 1s var(--ease),
    transform 1s var(--ease),
    filter 1s var(--ease);
  transition-delay: var(--reveal-delay, 0s);
  will-change: opacity, transform, filter;
}
.reveal.visible {
  opacity: 1;
  transform: none;
  filter: none;
}

/* Hero entrance (staggered) — only when JS is on */
html.js .hero-badge,
html.js .hero h1,
html.js .hero-sub,
html.js .hero-actions,
html.js .hero-stats {
  opacity: 0;
  transform: translateY(28px);
  filter: blur(6px);
}
body.loaded .hero-badge,
body.loaded .hero h1,
body.loaded .hero-sub,
body.loaded .hero-actions,
body.loaded .hero-stats {
  animation: heroIn 1.1s var(--ease) forwards;
}
body.loaded .hero-badge   { animation-delay: 0.05s; }
body.loaded .hero h1      { animation-delay: 0.15s; }
body.loaded .hero-sub     { animation-delay: 0.30s; }
body.loaded .hero-actions { animation-delay: 0.45s; }
body.loaded .hero-stats   { animation-delay: 0.60s; }

@keyframes heroIn {
  to { opacity: 1; transform: none; filter: none; }
}

/* Card cursor spotlight + smoother hover */
.card {
  transition:
    border-color 0.4s var(--ease),
    transform 0.5s var(--ease),
    background 0.4s var(--ease),
    box-shadow 0.5s var(--ease);
}
.card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, 0.09), transparent 62%);
  opacity: 0;
  transition: opacity 0.4s var(--ease);
  pointer-events: none;
}
.card:hover { box-shadow: 0 24px 60px -30px rgba(0, 0, 0, 0.9); }
.card:hover::after { opacity: 1; }

.card-icon { transition: transform 0.5s var(--ease), border-color 0.4s var(--ease); }
.card:hover .card-icon { transform: translateY(-3px) scale(1.06); border-color: var(--border-strong); }

/* Primary button light sheen */
.btn-primary { position: relative; overflow: hidden; }
.btn-primary::before {
  content: "";
  position: absolute;
  top: 0;
  left: -130%;
  width: 55%;
  height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.6), transparent);
  transform: skewX(-20deg);
  transition: left 0.7s var(--ease);
  pointer-events: none;
}
.btn-primary:hover::before { left: 150%; }

/* Magnetic hover helper */
.btn { will-change: transform; }

/* Work rows: smooth arrow reveal */
.work-item .work-body h3 { transition: transform 0.4s var(--ease); }
.work-item:hover .work-body h3 { transform: translateX(4px); }

/* Reduced motion: disable all the fancy stuff */
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
  .reveal { opacity: 1 !important; transform: none !important; filter: none !important; transition: none !important; }
  html.js .hero-badge,
  html.js .hero h1,
  html.js .hero-sub,
  html.js .hero-actions,
  html.js .hero-stats { opacity: 1; transform: none; filter: none; animation: none; }
  .marquee-track { animation: none !important; }
  .btn-primary::before, .card::after { display: none; }
}

/* =========================================================
   Content pages (services / case studies) + FAQ
   ========================================================= */
.container--narrow { max-width: 820px; }

.article { padding-top: 150px; }

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-mute);
  margin-bottom: 28px;
}
.breadcrumb a { color: var(--text-dim); transition: color 0.2s var(--ease); }
.breadcrumb a:hover { color: var(--white); }
.breadcrumb span { color: var(--text-mute); }

.article-title {
  font-size: clamp(30px, 5vw, 46px);
  margin: 14px 0 20px;
}

.article-tldr {
  font-size: clamp(18px, 2.4vw, 21px);
  line-height: 1.6;
  color: var(--text-dim);
  margin: 0 0 36px;
}

.brief {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  padding: 26px 28px;
  margin-bottom: 44px;
}
.brief-title {
  font-family: var(--mono);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-mute);
  margin-bottom: 14px;
}
.brief-list { display: grid; gap: 10px; margin-bottom: 18px; }
.brief-list li {
  position: relative;
  padding-left: 26px;
  color: var(--text);
}
.brief-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--white);
}

.prose { margin-bottom: 12px; }
.prose h2 {
  font-size: clamp(22px, 3.4vw, 30px);
  margin: 40px 0 14px;
}
.prose p {
  color: var(--text-dim);
  margin: 0 0 18px;
  line-height: 1.75;
}

.faq { margin-top: 48px; }
.faq-list {
  display: grid;
  gap: 16px;
  margin-top: 28px;
}
.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elev);
  padding: 22px 24px;
}
.faq-item h3 {
  font-size: 18px;
  margin-bottom: 8px;
}
.faq-item p {
  color: var(--text-dim);
  margin: 0;
  line-height: 1.7;
}
