/* Layout: 1160px column on deep navy; violet gradient accent; panels separated by faint borders (modelled on the reference design Shahab chose). Single dark theme by choice. */
:root {
  --bg: #070a1a;
  --bg-2: #0b0f24;
  --panel: #0f1430;
  --panel-2: #141a3d;
  --line: #1f2752;
  --fg: #f2f3fb;
  --muted: #9aa0c3;
  --violet: #7c5cff;
  --violet-2: #5b6cff;
  --violet-soft: #2a2360;
  --violet-text: #a993ff;
  --profit: #3fd29a;
  --loss: #ff7a6b;
  --star: #f5b82e;
  --code-key: #8fb4ff;
  --code-str: #ff9f6b;
  --code-num: #3fd29a;
  --grad: linear-gradient(135deg, var(--violet) 0%, var(--violet-2) 100%);

  --font-body: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --radius: 14px;
  --max: 1160px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--violet-text); outline-offset: 3px; border-radius: 8px; }
h1, h2, h3 { margin: 0; line-height: 1.15; text-wrap: balance; letter-spacing: -0.02em; }
p { margin: 0; }
svg { flex-shrink: 0; }

.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: clamp(16px, 4vw, 32px); }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tag {
  display: inline-block; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--violet-text); background: var(--violet-soft); border: 1px solid color-mix(in srgb, var(--violet) 40%, transparent);
  padding: 0.3rem 0.7rem; border-radius: 6px;
}
.kicker { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--violet-text); }
.section { padding-block: clamp(3.5rem, 8vw, 5.5rem); border-top: 1px solid var(--line); }
.section-alt { background: var(--bg-2); }
.center-head { text-align: center; display: grid; gap: 0.5rem; justify-items: center; margin-bottom: clamp(2rem, 5vw, 3rem); }
.center-head h2 { font-size: clamp(1.6rem, 3.4vw, 2.2rem); font-weight: 700; }
.center-head p { color: var(--muted); max-width: 52ch; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.55rem;
  padding: 0.8rem 1.35rem; border-radius: 8px; font-weight: 600; font-size: 0.95rem; text-decoration: none;
  border: 1px solid transparent; transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 10px 30px -12px var(--violet); }
.btn-primary:hover { box-shadow: 0 14px 36px -10px var(--violet); }
.btn-outline { border-color: color-mix(in srgb, var(--fg) 40%, transparent); color: var(--fg); background: transparent; }
.btn-outline:hover { border-color: var(--fg); background: color-mix(in srgb, var(--fg) 6%, transparent); }
.btn-sm { padding: 0.55rem 1rem; font-size: 0.88rem; }

/* Nav */
.nav {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: 0.85rem; position: relative; }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; font-weight: 700; font-size: 1.1rem; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: var(--grad); color: #fff; font-size: 0.85rem; font-weight: 800; }
.nav-links { display: flex; align-items: center; gap: 1.8rem; list-style: none; margin: 0; padding: 0; }
.nav-links a:not(.btn) { text-decoration: none; font-size: 0.92rem; font-weight: 500; color: var(--muted); padding-block: 0.3rem; border-bottom: 2px solid transparent; }
.nav-links a:not(.btn):hover { color: var(--fg); }
.nav-links a.active { color: var(--fg); border-bottom-color: var(--violet); }
.nav-cta { display: flex; }
.nav-toggle { display: none; background: none; border: 1px solid var(--line); border-radius: 8px; color: var(--fg); font: inherit; font-weight: 600; padding: 0.4rem 0.8rem; cursor: pointer; }
@media (max-width: 860px) {
  .nav-toggle { display: inline-block; }
  .nav-cta { display: none; }
  .nav-links {
    display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0;
    background: var(--panel); border-bottom: 1px solid var(--line); padding: 0.5rem clamp(16px, 4vw, 32px) 1rem;
  }
  .nav-links.open { display: flex; }
  .nav-links li a:not(.btn) { display: block; padding: 0.7rem 0; border-bottom: 0; }
  .nav-links .btn { width: 100%; margin-top: 0.5rem; }
}
@media (min-width: 861px) { .nav-links .mobile-only { display: none; } }

/* Hero */
.hero { position: relative; overflow: hidden; padding-block: clamp(3rem, 7vw, 5rem) clamp(3rem, 6vw, 4.5rem); }
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(600px 400px at 78% 40%, color-mix(in srgb, var(--violet) 22%, transparent), transparent 70%);
}
.hero-grid { position: relative; display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(2rem, 5vw, 3rem); align-items: center; }
.hero-grid > * { min-width: 0; }
.hero h1 { font-size: clamp(2.6rem, 6.5vw, 4rem); font-weight: 700; margin-top: 1.25rem; }
.hero .subhead { font-size: clamp(1.5rem, 3.6vw, 2.3rem); font-weight: 600; margin-top: 0.4rem; }
.hero .intro { color: var(--muted); font-size: 1.05rem; max-width: 48ch; margin-top: 1.25rem; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 0.85rem; margin-top: 2rem; }
.platforms { margin-top: 2.5rem; }
.platforms p { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.9rem; }
.platforms ul { display: flex; flex-wrap: wrap; gap: 0.6rem; list-style: none; margin: 0; padding: 0; }
.platforms li { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.85rem; font-weight: 600; padding: 0.45rem 0.8rem; border-radius: 8px; background: var(--panel); border: 1px solid var(--line); }
.platforms .dot { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; font-size: 0.7rem; font-weight: 800; color: #fff; }

.hero-visual { position: relative; min-height: 440px; display: grid; place-items: center start; }
.portrait {
  position: relative; width: min(400px, 80vw); margin-left: 6%; aspect-ratio: 1; max-width: 100%; border-radius: 50%;
  background: radial-gradient(circle at 30% 25%, #9b82ff, var(--violet) 45%, #3b2aa8 100%);
  box-shadow: 0 30px 80px -20px color-mix(in srgb, var(--violet) 70%, transparent);
  overflow: hidden; display: grid; place-items: center;
}
.portrait .initials { font-size: clamp(4rem, 10vw, 6.5rem); font-weight: 800; color: rgba(255,255,255,0.92); letter-spacing: -0.04em; }
.portrait img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 20%; }
.dots { position: absolute; top: 4%; right: 6%; width: 80px; height: 60px; background-image: radial-gradient(color-mix(in srgb, var(--violet-text) 70%, transparent) 1.5px, transparent 1.5px); background-size: 12px 12px; opacity: 0.6; }

.code-card {
  position: absolute; right: -2%; bottom: -6%; width: min(270px, 56%);
  background: color-mix(in srgb, var(--panel) 92%, transparent); backdrop-filter: blur(8px);
  border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 24px 60px -20px rgba(0,0,0,0.7);
  font-family: var(--font-mono); font-size: 0.74rem; line-height: 1.7;
}
.code-card header { display: flex; justify-content: space-between; align-items: center; padding: 0.55rem 0.9rem; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 0.7rem; }
.code-card header i { width: 8px; height: 8px; border-radius: 50%; background: var(--profit); box-shadow: 0 0 10px var(--profit); }
.code-card pre { margin: 0; padding: 0.8rem 0.9rem 0.9rem; white-space: pre-wrap; color: var(--fg); font: inherit; }
.code-card .k { color: var(--code-key); }
.code-card .s { color: var(--code-str); }
.code-card .n { color: var(--code-num); }
.code-card .c { color: var(--muted); }

.float-chip {
  position: absolute; left: -4%; bottom: 6%; display: flex; align-items: center; gap: 0.7rem;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 0.7rem 0.95rem;
  box-shadow: 0 20px 50px -20px rgba(0,0,0,0.7); text-decoration: none;
}
.float-chip .stars { font-size: 0.85rem; }
.float-chip strong { display: block; font-size: 0.95rem; }
.float-chip span.sub { font-size: 0.78rem; color: var(--muted); }

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { min-height: 0; padding-block: 1rem 0; }
  .hero-visual { place-items: center; }
  .code-card { position: relative; bottom: auto; right: auto; width: 100%; max-width: 360px; margin-top: -3rem; justify-self: end; }
  .float-chip { position: relative; left: auto; bottom: auto; justify-self: start; margin-top: 1rem; }
}

/* About + stats */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.about-grid > * { min-width: 0; }
.about-copy { display: grid; gap: 1.1rem; justify-items: start; }
.about-copy h2 { font-size: clamp(1.6rem, 3.4vw, 2.2rem); font-weight: 700; }
.about-copy p { color: var(--muted); max-width: 54ch; }
.stats { display: grid; grid-template-columns: 1fr 1fr; }
.stat { display: flex; gap: 1rem; align-items: center; padding: 1.5rem 1.25rem; min-width: 0; }
.stat:nth-child(odd) { border-right: 1px solid var(--line); }
.stat:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
.icon-box { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; background: var(--grad); color: #fff; }
.icon-box.soft { background: var(--violet-soft); color: var(--violet-text); border: 1px solid color-mix(in srgb, var(--violet) 40%, transparent); }
.stat strong { display: block; font-size: 1.75rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat span { font-size: 0.88rem; color: var(--muted); }

/* Skills */
.skills { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; }
.skill { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; display: grid; gap: 0.8rem; align-content: start; transition: border-color 0.2s ease, transform 0.2s ease; }
.skill:hover { border-color: color-mix(in srgb, var(--violet) 60%, transparent); transform: translateY(-3px); }
.skill-top { display: flex; align-items: center; gap: 0.8rem; }
.skill h3 { font-size: 1.05rem; font-weight: 700; }
.skill p { color: var(--muted); font-size: 0.92rem; }
.skill .line { height: 4px; border-radius: 999px; background: var(--grad); width: 48px; }

/* Automation */
.brand-by { color: var(--violet-text); font-weight: 500; }
.auto-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.auto-grid .skill-top { flex-direction: column; align-items: flex-start; }
@media (max-width: 900px) {
  .auto-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) { .auto-grid { grid-template-columns: 1fr; } }

.n8n-shot { margin: 0 0 1.5rem; }
.n8n-frame { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: #1f1f1f; box-shadow: 0 30px 70px -30px color-mix(in srgb, var(--violet) 55%, transparent); }
.n8n-frame img { width: 100%; height: auto; }
.n8n-shot figcaption { margin-top: 0.8rem; font-size: 0.9rem; color: var(--muted); max-width: 80ch; }
.n8n-shot figcaption strong { color: var(--fg); }

/* Featured work */
.work-card { display: grid; grid-template-columns: 1.15fr 1fr; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.work-card > * { min-width: 0; }
.work-media { background: var(--bg); border-right: 1px solid var(--line); display: grid; align-content: center; }
.work-media figure { margin: 0; position: relative; background: #fff; }
.work-media figure + figure { border-top: 1px solid var(--line); }
.work-media img { width: 100%; height: auto; }
.work-media .ads img { aspect-ratio: 2000 / 450; object-fit: cover; object-position: top left; }
.work-media .lp img { aspect-ratio: 2000 / 1049; object-fit: cover; object-position: top; }
.work-media:has(.lp:only-child) { align-content: stretch; }
.work-media .lp { height: 100%; }
.work-media .lp img { height: 100%; min-height: 260px; object-position: 20% center; }
.work-media figcaption { position: absolute; left: 0.75rem; bottom: 0.75rem; font-size: 0.72rem; font-weight: 600; background: color-mix(in srgb, var(--bg) 85%, transparent); color: var(--fg); padding: 0.25rem 0.55rem; border-radius: 6px; }
.work-body { padding: clamp(1.5rem, 3.5vw, 2.25rem); display: grid; gap: 1.25rem; align-content: start; }
.work-num { font-family: var(--font-mono); font-size: 0.8rem; color: var(--muted); }
.work-body h3 { font-size: clamp(1.35rem, 2.6vw, 1.7rem); font-weight: 700; }
.work-body > p { color: var(--muted); }
.work-body > p a { color: var(--violet-text); }
.roas-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.6rem; font-variant-numeric: tabular-nums; }
.roas-line .before { color: var(--loss); font-size: 1.4rem; font-weight: 600; text-decoration: line-through; }
.roas-line .arrow { color: var(--muted); }
.roas-line .after { font-size: clamp(2.6rem, 6vw, 3.4rem); font-weight: 800; line-height: 1; }
.roas-line .unit { color: var(--muted); font-size: 0.9rem; }
.work-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; }
.work-steps li { display: grid; grid-template-columns: auto 1fr; gap: 0.75rem; align-items: start; font-size: 0.93rem; color: var(--muted); }
.work-steps li strong { color: var(--fg); }
.work-steps .check { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; background: var(--violet-soft); color: var(--violet-text); margin-top: 0.1rem; }
.metrics { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 0.8fr); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin: 0; }
.metrics div { padding: 0.75rem 0.85rem; border-right: 1px solid var(--line); }
.metrics div:last-child { border-right: 0; }
.metrics dt { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 600; }
.metrics dd { margin: 0.2rem 0 0; font-weight: 700; font-variant-numeric: tabular-nums; font-size: 0.95rem; }

/* ROAS chart, one scale 0–2.0 */
.chart { margin-top: 1.5rem; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem 1.5rem; }
.chart-title { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-bottom: 1rem; }
.chart-rows { display: grid; gap: 0.85rem; }
.chart-row { display: grid; grid-template-columns: 9rem 1fr; gap: 0.85rem; align-items: center; }
.chart-row span { font-size: 0.85rem; color: var(--muted); }
.track { height: 30px; background-image: linear-gradient(to right, var(--line) 1px, transparent 1px); background-size: 25% 100%; border-right: 1px solid var(--line); }
.bar { height: 100%; border-radius: 0 6px 6px 0; display: flex; align-items: center; padding-inline: 0.5rem; font-weight: 700; font-size: 0.85rem; white-space: nowrap; transform-origin: left; font-variant-numeric: tabular-nums; }
.bar-before { background: color-mix(in srgb, var(--loss) 25%, transparent); color: var(--loss); }
.bar-mid { background: color-mix(in srgb, var(--muted) 22%, transparent); color: var(--muted); }
.bar-after { background: var(--grad); color: #fff; justify-content: flex-end; }
.axis { display: grid; grid-template-columns: 9rem 1fr; gap: 0.85rem; margin-top: 0.4rem; }
.axis ol { display: flex; justify-content: space-between; list-style: none; margin: 0; padding: 0; font-size: 0.72rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.axis li:first-child { transform: translateX(-30%); }
.axis li:last-child { transform: translateX(30%); }
.chart-note { font-size: 0.8rem; color: var(--muted); margin-top: 0.75rem; }
@media (prefers-reduced-motion: no-preference) {
  .chart.animate .bar { animation: grow 1s cubic-bezier(.2,.7,.2,1) both; }
  .chart.animate .bar-mid { animation-delay: 0.15s; }
  .chart.animate .bar-after { animation-delay: 0.3s; }
}
@keyframes grow { from { transform: scaleX(0.02); } to { transform: scaleX(1); } }

/* Reviews */
.stars { color: var(--star); letter-spacing: 0.12em; }
.reviews { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; }
.review { margin: 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; display: flex; flex-direction: column; gap: 0.9rem; }
.review.featured { background: var(--grad); border-color: transparent; }
.review.featured blockquote { color: #fff; font-size: 1.2rem; font-weight: 700; line-height: 1.35; }
.review.featured .who span { color: rgba(255,255,255,0.8); }
.review.featured .stars { color: #fff; }
.review.featured .avatar { background: rgba(255,255,255,0.2); }
.review blockquote { margin: 0; color: color-mix(in srgb, var(--fg) 88%, transparent); font-size: 0.93rem; }
.who { display: flex; align-items: center; gap: 0.7rem; margin-top: auto; }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #fff; font-size: 0.95rem; }
.who strong { display: block; font-size: 0.9rem; }
.who span { font-size: 0.8rem; color: var(--muted); }
.reviews-more { display: flex; justify-content: center; margin-top: 2rem; }

/* Contact block (3 columns like the reference footer) */
.contact-grid { display: grid; grid-template-columns: 1fr 1.1fr 0.8fr; gap: clamp(1.5rem, 4vw, 3rem); align-items: start; }
.contact-grid > * { min-width: 0; }
.contact-cta { display: grid; gap: 0.9rem; justify-items: start; }
.contact-cta h2 { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 700; }
.contact-cta p { color: var(--muted); max-width: 40ch; }
.hire-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; display: grid; gap: 1rem; }
.hire-card .row { display: flex; align-items: center; gap: 0.9rem; }
.hire-card strong { font-size: 1.05rem; display: block; }
.hire-card .row span { font-size: 0.85rem; color: var(--muted); }
.hire-card p { color: var(--muted); font-size: 0.92rem; }
.follow h3 { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--violet-text); margin-bottom: 1rem; }
.socials { display: grid; gap: 0.75rem; list-style: none; margin: 0; padding: 0; }
.socials a { display: inline-flex; align-items: center; gap: 0.75rem; text-decoration: none; color: var(--muted); font-size: 0.93rem; }
.socials a:hover { color: var(--fg); }
.socials .s-ico { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; background: var(--panel); border: 1px solid var(--line); color: var(--fg); font-weight: 800; font-size: 0.85rem; }

footer { border-top: 1px solid var(--line); padding-block: 1.4rem; color: var(--muted); font-size: 0.82rem; }
footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem; }
footer .heart { color: var(--loss); }

/* Entrance: visible at rest; JS only adds the animation */
@media (prefers-reduced-motion: no-preference) {
  .reveal.in { animation: rise 0.6s ease both; }
}
@keyframes rise { from { opacity: 0.001; transform: translateY(14px); } to { opacity: 1; transform: none; } }

@media (max-width: 900px) {
  .about-grid, .work-card, .contact-grid { grid-template-columns: 1fr; }
  .work-media { border-right: 0; border-bottom: 1px solid var(--line); }
  .skills, .reviews { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .skills, .reviews { grid-template-columns: 1fr; }
  .chart-row, .axis { grid-template-columns: 6.5rem 1fr; }
  .stat { padding: 1.1rem 0.6rem; gap: 0.7rem; }
  .stat strong { font-size: 1.4rem; }
  .icon-box { width: 40px; height: 40px; }
  .metrics { grid-template-columns: 1fr; }
  .metrics div { border-right: 0; border-bottom: 1px solid var(--line); }
  .metrics div:last-child { border-bottom: 0; }
}
