/* =====================================================================
   Abdul Basit — Portfolio
   Design system: professional blue accent · warm off-white / deep charcoal
   Type: Plus Jakarta Sans (display) · Inter (body) · JetBrains Mono (utility)
   ===================================================================== */

/* ----- Design tokens ----- */
:root {
  /* Light mode */
  --bg:          #FBFAF8;
  --bg-alt:      #F4F5F7;
  --surface:     #FFFFFF;
  --surface-2:   #F7F8FA;
  --text:        #14181F;
  --heading:     #0F1319;
  --muted:       #5A6472;
  --border:      #E6E8EC;
  --border-2:    #DCDFE5;
  --primary:     #2050C8;
  --primary-ink: #1A44AC;
  --primary-soft:#EAF0FE;
  --on-primary:  #FFFFFF;
  --shadow-sm: 0 1px 2px rgba(15, 19, 25, .05), 0 1px 3px rgba(15, 19, 25, .06);
  --shadow-md: 0 6px 20px rgba(15, 19, 25, .07), 0 2px 6px rgba(15, 19, 25, .05);
  --shadow-lg: 0 20px 50px rgba(15, 19, 25, .12), 0 6px 16px rgba(15, 19, 25, .08);

  /* Type */
  --font-display: "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif;
  --font-body:    "Inter", ui-sans-serif, system-ui, sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, "SFMono-Regular", monospace;

  /* Layout */
  --container: 1200px;
  --radius:    14px;
  --radius-sm: 10px;
  --radius-lg: 22px;
  --gutter:    clamp(20px, 5vw, 40px);
  --section-y: clamp(64px, 9vw, 128px);

  --ease: cubic-bezier(.22, .61, .36, 1);
  --dur:  .45s;
}

[data-theme="dark"] {
  --bg:          #0E1116;
  --bg-alt:      #12161D;
  --surface:     #161A21;
  --surface-2:   #1B2029;
  --text:        #E7EAF0;
  --heading:     #F3F5F8;
  --muted:       #97A1B0;
  --border:      #262C36;
  --border-2:    #313947;
  --primary:     #6E9BFF;
  --primary-ink: #86ACFF;
  --primary-soft:#182236;
  --on-primary:  #0B1220;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow-md: 0 8px 24px rgba(0,0,0,.45);
  --shadow-lg: 0 24px 60px rgba(0,0,0,.55);
}

/* ----- Reset / base ----- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color .4s var(--ease), color .4s var(--ease);
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--heading); line-height: 1.12; letter-spacing: -.02em; margin: 0; font-weight: 700; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
:focus-visible { outline: 2.5px solid var(--primary); outline-offset: 3px; border-radius: 4px; }

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.mono { font-family: var(--font-mono); }

.section { padding-block: var(--section-y); }
.section-head { max-width: 720px; margin-bottom: clamp(36px, 5vw, 60px); }

.eyebrow {
  font-family: var(--font-mono);
  font-size: .8rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 16px;
  display: flex; align-items: center; gap: 10px;
}
.eyebrow::before { content: ""; width: 26px; height: 1.5px; background: var(--primary); display: inline-block; }

h1 { font-size: clamp(2.3rem, 5.4vw, 3.9rem); font-weight: 800; }
.section h2 { font-size: clamp(1.8rem, 3.6vw, 2.7rem); }
.section-sub { color: var(--muted); font-size: 1.08rem; margin-top: 16px; }

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 200;
  background: var(--primary); color: var(--on-primary);
  padding: 10px 16px; border-radius: 8px; transition: top .2s;
}
.skip-link:focus { top: 12px; }

/* ----- Buttons ----- */
.btn {
  --btn-pad-y: 13px; --btn-pad-x: 22px;
  display: inline-flex; align-items: center; gap: 9px;
  padding: var(--btn-pad-y) var(--btn-pad-x);
  border-radius: 10px; border: 1px solid transparent;
  font-weight: 600; font-size: .97rem; letter-spacing: -.01em;
  transition: transform .25s var(--ease), background-color .25s, border-color .25s, color .25s, box-shadow .25s;
  will-change: transform;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: var(--on-primary); box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--primary-ink); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.btn-ghost { background: transparent; color: var(--heading); border-color: var(--border-2); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-2px); }
.btn-block { width: 100%; justify-content: center; }
.btn-arrow { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .25s var(--ease); }
.btn:hover .btn-arrow { transform: translateX(4px); }

/* ----- Scroll progress ----- */
.scroll-progress { position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 120; background: transparent; pointer-events: none; }
.scroll-progress span { display: block; height: 100%; width: 0; background: var(--primary); transition: width .1s linear; }

/* =====================================================================
   HEADER
   ===================================================================== */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(150%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, background-color .3s, box-shadow .3s;
}
.site-header.scrolled { border-bottom-color: var(--border); box-shadow: var(--shadow-sm); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 72px; gap: 20px; }

.brand { display: inline-flex; align-items: center; gap: 11px; font-family: var(--font-display); font-weight: 700; color: var(--heading); }
.brand-mark {
  width: 38px; height: 38px; display: grid; place-items: center;
  background: var(--primary); color: var(--on-primary);
  border-radius: 10px; font-size: .95rem; font-weight: 800; letter-spacing: .02em;
}
.brand-name { font-size: 1.05rem; letter-spacing: -.02em; }

.nav-list { display: flex; align-items: center; gap: 4px; }
.nav-link {
  position: relative; padding: 8px 14px; border-radius: 8px;
  font-size: .95rem; font-weight: 500; color: var(--muted);
  transition: color .2s, background-color .2s;
}
.nav-link::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 4px; height: 2px;
  background: var(--primary); border-radius: 2px; transform: scaleX(0); transform-origin: left;
  transition: transform .25s var(--ease);
}
.nav-link:hover { color: var(--heading); }
.nav-link.active { color: var(--heading); }
.nav-link.active::after { transform: scaleX(1); }

.header-actions { display: flex; align-items: center; gap: 10px; }
.theme-toggle {
  width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--border-2);
  background: var(--surface); display: grid; place-items: center; color: var(--heading);
  transition: border-color .2s, transform .2s, background-color .2s;
}
.theme-toggle:hover { border-color: var(--primary); transform: translateY(-1px); }
.theme-toggle svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: none; }
[data-theme="dark"] .icon-moon { display: block; }

.nav-toggle { display: none; width: 42px; height: 42px; border-radius: 10px; border: 1px solid var(--border-2); background: var(--surface); position: relative; }
.nav-toggle span { position: absolute; left: 11px; right: 11px; height: 2px; background: var(--heading); border-radius: 2px; transition: transform .3s var(--ease), opacity .2s; }
.nav-toggle span:nth-child(1) { top: 14px; }
.nav-toggle span:nth-child(2) { top: 20px; }
.nav-toggle span:nth-child(3) { top: 26px; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.nav-scrim { position: fixed; inset: 0; background: rgba(10,14,20,.5); z-index: 95; }

/* =====================================================================
   HERO
   ===================================================================== */
.hero { padding-block: clamp(48px, 7vw, 96px) clamp(56px, 8vw, 108px); position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; top: -20%; right: -10%; width: 640px; height: 640px;
  background: radial-gradient(circle, color-mix(in srgb, var(--primary) 12%, transparent), transparent 68%);
  filter: blur(10px); z-index: -1; pointer-events: none;
}
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(36px, 5vw, 72px); align-items: center; }
.hero-title { margin: 12px 0 20px; max-width: 15ch; }
.hero-lead { color: var(--muted); font-size: 1.14rem; max-width: 52ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 30px; }

.hero-facts { display: grid; grid-template-columns: repeat(4, auto); gap: clamp(18px, 3vw, 40px); margin-top: 44px; padding-top: 30px; border-top: 1px solid var(--border); }
.hero-facts dt { font-family: var(--font-mono); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 5px; }
.hero-facts dd { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: .98rem; color: var(--heading); }

/* Hero visual — layered browser composition */
.hero-visual { position: relative; min-height: 440px; }
.mock { position: absolute; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); overflow: hidden; }
.mock-bar { display: flex; align-items: center; gap: 6px; padding: 11px 14px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.mock-bar span { width: 9px; height: 9px; border-radius: 50%; background: var(--border-2); }
.mock-bar span:first-child { background: #E06C6C; }
.mock-bar span:nth-child(2) { background: #E3B34E; }
.mock-bar span:nth-child(3) { background: #5FB56F; }
.mock-bar em { margin-left: 10px; font-family: var(--font-mono); font-style: normal; font-size: .62rem; color: var(--muted); letter-spacing: .04em; }

.mock-back { top: 0; right: 0; width: 74%; transform: rotate(3deg); }
.mock-back .mock-body { padding: 16px; }
.mock-store-hero { height: 62px; border-radius: 8px; background: linear-gradient(120deg, var(--primary), color-mix(in srgb, var(--primary) 55%, #7aa2ff)); margin-bottom: 14px; }
.mock-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mock-card { height: 46px; border-radius: 7px; background: var(--bg-alt); border: 1px solid var(--border); }

.mock-front { bottom: 6%; left: 0; width: 66%; transform: rotate(-2.5deg); z-index: 2; }
.mock-front .mock-body { padding: 16px 18px 20px; }
.mock-nav { display: flex; gap: 8px; margin-bottom: 16px; }
.mock-nav i { height: 6px; width: 26px; border-radius: 3px; background: var(--border-2); }
.mock-nav i:first-child { width: 34px; background: var(--primary); }
.mock-h1 { height: 15px; width: 78%; border-radius: 4px; background: var(--heading); opacity: .82; margin-bottom: 12px; }
.mock-p { height: 8px; width: 92%; border-radius: 4px; background: var(--border-2); margin-bottom: 8px; }
.mock-p.short { width: 66%; }
.mock-btn { margin-top: 14px; height: 26px; width: 96px; border-radius: 7px; background: var(--primary); }

.mock-phone { bottom: 0; right: 2%; width: 118px; z-index: 3; border-radius: 20px; padding: 8px; background: var(--heading); border: none; }
.mock-phone-notch { width: 40px; height: 5px; border-radius: 3px; background: rgba(255,255,255,.3); margin: 2px auto 8px; }
.mock-phone-body { background: var(--surface); border-radius: 13px; padding: 12px; }
.mock-ph-hero { height: 48px; border-radius: 8px; background: linear-gradient(120deg, var(--primary), color-mix(in srgb, var(--primary) 50%, #7aa2ff)); margin-bottom: 10px; }
.mock-ph-line { height: 7px; border-radius: 4px; background: var(--border-2); margin-bottom: 6px; }
.mock-ph-line.short { width: 60%; }
.mock-ph-btn { margin-top: 10px; height: 20px; border-radius: 6px; background: var(--primary-soft); border: 1px solid var(--primary); }

.mock-tag {
  position: absolute; top: 20%; left: -6%; z-index: 4;
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--border);
  box-shadow: var(--shadow-md); border-radius: 10px; padding: 9px 13px;
  font-family: var(--font-mono); font-size: .72rem; color: var(--heading);
}
.mock-tag span { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; background: var(--primary-soft); color: var(--primary); font-weight: 500; }

/* =====================================================================
   CREDIBILITY STRIP
   ===================================================================== */
.strip { border-block: 1px solid var(--border); background: var(--bg-alt); }
.strip-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: clamp(16px, 4vw, 44px); padding-block: 22px; }
.strip-inner span { font-family: var(--font-mono); font-size: .82rem; letter-spacing: .04em; color: var(--muted); position: relative; }
.strip-inner span:not(:last-child)::after { content: "/"; margin-left: clamp(16px, 4vw, 44px); color: var(--border-2); }

/* =====================================================================
   ABOUT
   ===================================================================== */
.about-grid { display: grid; grid-template-columns: .82fr 1.18fr; gap: clamp(36px, 5vw, 72px); align-items: center; }
.about-media { position: relative; }
.portrait {
  margin: 0; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--border);
  background: linear-gradient(150deg, var(--surface-2), var(--bg-alt)); box-shadow: var(--shadow-md);
  aspect-ratio: 5 / 6;
}
.portrait img { width: 100%; height: 100%; object-fit: cover; }
.portrait img.img-missing { display: none; }
.portrait.is-placeholder { display: grid; place-items: center; position: relative; }
.portrait.is-placeholder::after {
  content: attr(data-mark); font-family: var(--font-display); font-weight: 800;
  font-size: 5rem; color: var(--primary); opacity: .18;
}
.about-badge {
  position: absolute; bottom: -22px; right: -14px; max-width: 240px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-md);
  border-radius: 12px; padding: 14px 16px; font-size: .86rem; color: var(--muted); line-height: 1.4;
}
.about-badge .mono { display: block; color: var(--primary); font-weight: 500; font-size: .78rem; letter-spacing: .06em; margin-bottom: 4px; }
.about-copy h2 { margin-bottom: 20px; }
.about-copy p { color: var(--muted); margin-bottom: 16px; max-width: 58ch; }
.about-copy .btn { margin-top: 12px; }

/* =====================================================================
   CARDS (shared)
   ===================================================================== */
.cards { display: grid; gap: 20px; }
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px;
  transition: transform .3s var(--ease), border-color .3s, box-shadow .3s;
}
.services-grid, .why-grid { grid-template-columns: repeat(3, 1fr); }
.skills-grid { grid-template-columns: repeat(3, 1fr); }

.service-card { position: relative; overflow: hidden; }
.service-card:hover { transform: translateY(-5px); border-color: var(--border-2); box-shadow: var(--shadow-md); }
.card-index { position: absolute; top: 22px; right: 24px; font-size: .82rem; color: var(--border-2); font-weight: 500; }
.card-icon { display: grid; place-items: center; width: 50px; height: 50px; border-radius: 12px; background: var(--primary-soft); color: var(--primary); margin-bottom: 20px; }
.card-icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.service-card h3 { font-size: 1.16rem; margin-bottom: 10px; }
.service-card p { color: var(--muted); font-size: .96rem; }

/* Skills */
.skill-group h3 { font-size: 1.05rem; margin-bottom: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags li {
  font-family: var(--font-mono); font-size: .78rem; color: var(--text);
  background: var(--bg-alt); border: 1px solid var(--border); border-radius: 7px; padding: 6px 10px;
  transition: border-color .2s, color .2s, background-color .2s;
}
.skill-group:hover .tags li { border-color: var(--border-2); }
.tags li:hover { color: var(--primary); border-color: var(--primary); background: var(--primary-soft); }

/* =====================================================================
   PROJECTS
   ===================================================================== */
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 34px; }
.filter {
  padding: 9px 18px; border-radius: 999px; border: 1px solid var(--border-2);
  background: var(--surface); color: var(--muted); font-size: .9rem; font-weight: 500;
  transition: color .2s, border-color .2s, background-color .2s, transform .2s;
}
.filter:hover { color: var(--heading); border-color: var(--primary); transform: translateY(-1px); }
.filter.is-active { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }

.projects-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.project-card {
  grid-column: span 1;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column; text-align: left;
  transition: transform .35s var(--ease), border-color .3s, box-shadow .35s, opacity .3s;
}
.project-card.is-featured { grid-column: span 2; }
.project-card:hover { transform: translateY(-5px); border-color: var(--border-2); box-shadow: var(--shadow-lg); }
.project-card.is-hidden { display: none; }

.project-thumb {
  position: relative; aspect-ratio: 16 / 10; overflow: hidden;
  background: linear-gradient(145deg, var(--surface-2), var(--bg-alt));
  border-bottom: 1px solid var(--border);
}
.project-card.is-featured .project-thumb { aspect-ratio: 16 / 8; }
.project-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.project-card:hover .project-thumb img { transform: scale(1.045); }
.project-thumb img.img-missing { display: none; }
/* Placeholder shown when screenshot is absent */
.thumb-placeholder { position: absolute; inset: 0; display: grid; place-content: center; gap: 8px; text-align: center; padding: 20px; }
.thumb-placeholder .tp-mark { font-family: var(--font-display); font-weight: 800; font-size: 2.2rem; color: var(--primary); opacity: .22; }
.thumb-placeholder .tp-note { font-family: var(--font-mono); font-size: .68rem; letter-spacing: .06em; color: var(--muted); text-transform: uppercase; }
.project-card:hover .thumb-placeholder { opacity: .9; }

.project-body { padding: 22px 22px 24px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.project-cat { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--primary); }
.project-name { font-size: 1.18rem; }
.project-card.is-featured .project-name { font-size: 1.5rem; }
.project-desc { color: var(--muted); font-size: .95rem; }
.project-tech { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.project-tech span { font-family: var(--font-mono); font-size: .7rem; color: var(--muted); border: 1px solid var(--border); border-radius: 6px; padding: 3px 8px; }
.project-actions { display: flex; align-items: center; gap: 16px; margin-top: auto; padding-top: 14px; }
.project-detail-btn { font-weight: 600; font-size: .92rem; color: var(--heading); display: inline-flex; align-items: center; gap: 7px; }
.project-detail-btn:hover { color: var(--primary); }
.project-visit { margin-left: auto; font-weight: 600; font-size: .9rem; color: var(--primary); display: inline-flex; align-items: center; gap: 6px; }
.project-visit svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s; }
.project-visit:hover svg { transform: translate(2px, -2px); }

/* =====================================================================
   EXPERIENCE TIMELINE
   ===================================================================== */
.experience { background: var(--bg-alt); border-block: 1px solid var(--border); }
.timeline { position: relative; max-width: 760px; margin-inline: auto; padding-left: 34px; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--border-2); }
.timeline-item { position: relative; padding-bottom: 34px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot { position: absolute; left: -34px; top: 4px; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); border: 3px solid var(--primary); box-shadow: 0 0 0 4px var(--bg-alt); }
.timeline-item h3 { font-size: 1.15rem; margin-bottom: 6px; }
.timeline-item p { color: var(--muted); font-size: .98rem; max-width: 60ch; }

/* =====================================================================
   BEYOND THE PAGE BUILDER
   ===================================================================== */
.beyond-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(36px, 5vw, 64px); align-items: center; }
.beyond-copy p { color: var(--muted); max-width: 52ch; margin-top: 18px; }
.beyond-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; }
.beyond-list li { font-family: var(--font-mono); font-size: .8rem; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 7px 12px; }
.beyond-list li::before { content: "→ "; color: var(--primary); }

.code-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-md); }
.code-bar { display: flex; align-items: center; gap: 6px; padding: 12px 16px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.code-bar span { width: 10px; height: 10px; border-radius: 50%; background: var(--border-2); }
.code-bar span:first-child { background: #E06C6C; }
.code-bar span:nth-child(2) { background: #E3B34E; }
.code-bar span:nth-child(3) { background: #5FB56F; }
.code-bar em { margin-left: 10px; font-style: normal; font-size: .74rem; color: var(--muted); }
.code-card pre { margin: 0; padding: 22px; overflow-x: auto; font-size: .82rem; line-height: 1.75; color: var(--text); }
.code-card code { font-family: var(--font-mono); }
.code-card .c { color: var(--muted); }
.code-card .k { color: var(--primary); }
.code-card .s { color: #2f9e6b; }
[data-theme="dark"] .code-card .s { color: #6cd6a0; }
.code-card .fn { color: var(--heading); font-weight: 500; }

/* =====================================================================
   PROCESS
   ===================================================================== */
.process-steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 18px; counter-reset: none; }
.process-step { position: relative; padding: 26px 22px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); transition: transform .3s var(--ease), box-shadow .3s; }
.process-step:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.process-num { display: inline-block; font-size: .9rem; color: var(--primary); font-weight: 500; margin-bottom: 16px; padding: 4px 9px; border: 1px solid var(--primary); border-radius: 7px; }
.process-step h3 { font-size: 1.1rem; margin-bottom: 8px; }
.process-step p { color: var(--muted); font-size: .9rem; }

/* =====================================================================
   WHY + RELATIONSHIP
   ===================================================================== */
.why-card { padding: 26px; }
.why-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--border-2); }
.why-card h3 { font-size: 1.1rem; margin-bottom: 10px; }
.why-card h3::before { content: ""; display: block; width: 30px; height: 3px; background: var(--primary); border-radius: 3px; margin-bottom: 14px; }
.why-card p { color: var(--muted); font-size: .95rem; }

.relationship {
  margin-top: 30px; text-align: center;
  background: var(--primary); color: var(--on-primary);
  border-radius: var(--radius-lg); padding: clamp(34px, 5vw, 56px);
}
.relationship h3 { color: var(--on-primary); font-size: clamp(1.4rem, 2.6vw, 2rem); margin-bottom: 14px; }
.relationship p { color: color-mix(in srgb, var(--on-primary) 82%, transparent); max-width: 60ch; margin-inline: auto; font-size: 1.05rem; }

/* =====================================================================
   FAQ
   ===================================================================== */
.faq-wrap { max-width: 820px; }
.accordion { border-top: 1px solid var(--border); }
.acc-item { border-bottom: 1px solid var(--border); }
.acc-trigger {
  width: 100%; text-align: left; background: none; border: none;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 22px 4px; font-family: var(--font-display); font-weight: 700; font-size: 1.08rem; color: var(--heading);
}
.acc-trigger:hover { color: var(--primary); }
.acc-icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .3s var(--ease); }
.acc-trigger[aria-expanded="true"] .acc-icon { transform: rotate(180deg); color: var(--primary); }
.acc-panel { overflow: hidden; max-height: 0; transition: max-height .35s var(--ease); }
.acc-panel p { color: var(--muted); padding: 0 4px 24px; max-width: 68ch; }
.acc-panel a { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }

/* =====================================================================
   CONTACT
   ===================================================================== */
.contact { background: var(--bg-alt); border-top: 1px solid var(--border); }
.contact-head { max-width: 640px; }
.contact-grid { display: grid; grid-template-columns: .82fr 1.18fr; gap: clamp(32px, 4vw, 56px); align-items: start; }

.contact-info { display: flex; flex-direction: column; gap: 12px; }
.contact-line {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 15px 16px;
  transition: border-color .2s, transform .2s, box-shadow .2s;
}
.contact-line:hover { border-color: var(--primary); transform: translateX(3px); box-shadow: var(--shadow-sm); }
.contact-ic { display: grid; place-items: center; width: 42px; height: 42px; flex: none; border-radius: 10px; background: var(--primary-soft); color: var(--primary); }
.contact-ic svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.contact-meta { display: flex; flex-direction: column; min-width: 0; }
.contact-meta em { font-style: normal; font-family: var(--font-mono); font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.contact-meta strong { font-weight: 600; font-size: .96rem; color: var(--heading); overflow-wrap: anywhere; }
.copy-hint { margin-left: auto; font-size: .66rem; color: var(--muted); border: 1px solid var(--border); border-radius: 6px; padding: 3px 7px; transition: color .2s, border-color .2s; }
.contact-line:hover .copy-hint { color: var(--primary); border-color: var(--primary); }
.contact-cta-row { margin-top: 8px; }
.contact-cta-row .btn { width: 100%; justify-content: center; }

/* Form */
.contact-form { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: clamp(24px, 3vw, 34px); box-shadow: var(--shadow-sm); }
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 18px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field label { font-size: .86rem; font-weight: 600; color: var(--heading); }
.field input, .field select, .field textarea {
  width: 100%; font: inherit; font-size: .96rem; color: var(--text);
  background: var(--bg); border: 1px solid var(--border-2); border-radius: 10px; padding: 12px 14px;
  transition: border-color .2s, box-shadow .2s; appearance: none;
}
.field textarea { resize: vertical; min-height: 120px; }
.field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235A6472' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 18px; padding-right: 40px;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: #d9534f; }
.field-error { font-size: .8rem; color: #d9534f; min-height: 0; }
.form-note { margin-top: 14px; font-size: .9rem; color: var(--muted); min-height: 1.2em; }
.form-note.is-success { color: var(--primary); font-weight: 500; }

/* =====================================================================
   FOOTER
   ===================================================================== */
.site-footer { background: var(--surface); border-top: 1px solid var(--border); padding-top: clamp(48px, 6vw, 72px); }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 40px; padding-bottom: 44px; }
.footer-brand .brand { margin-bottom: 16px; }
.footer-role { font-family: var(--font-mono); font-size: .82rem; color: var(--primary); margin-bottom: 12px; }
.footer-desc { color: var(--muted); font-size: .95rem; max-width: 42ch; }
.footer-nav h4, .footer-contact h4 { font-size: .82rem; font-family: var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 16px; }
.footer-nav ul, .footer-contact ul { display: flex; flex-direction: column; gap: 10px; }
.footer-nav a, .footer-contact a { color: var(--text); font-size: .95rem; transition: color .2s; }
.footer-nav a:hover, .footer-contact a:hover { color: var(--primary); }
.footer-bottom { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-block: 24px; border-top: 1px solid var(--border); color: var(--muted); font-size: .88rem; }
.footer-legal a { color: var(--muted); transition: color .2s; }
.footer-legal a:hover { color: var(--primary); }

/* =====================================================================
   BACK TO TOP
   ===================================================================== */
.to-top {
  position: fixed; right: 22px; bottom: 22px; z-index: 90;
  width: 46px; height: 46px; border-radius: 12px; border: 1px solid var(--border-2);
  background: var(--surface); color: var(--heading); display: grid; place-items: center;
  box-shadow: var(--shadow-md); opacity: 0; visibility: hidden; transform: translateY(10px);
  transition: opacity .3s, transform .3s, visibility .3s, border-color .2s;
}
.to-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
.to-top:hover { border-color: var(--primary); color: var(--primary); }
.to-top svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* =====================================================================
   MODAL
   ===================================================================== */
.modal { position: fixed; inset: 0; z-index: 150; display: grid; place-items: center; padding: 20px; }
.modal[hidden] { display: none; }
.modal-scrim { position: absolute; inset: 0; background: rgba(9,12,18,.62); backdrop-filter: blur(3px); opacity: 0; transition: opacity .3s; }
.modal.open .modal-scrim { opacity: 1; }
.modal-card {
  position: relative; width: min(720px, 100%); max-height: 88vh; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); transform: translateY(16px) scale(.98); opacity: 0;
  transition: transform .35s var(--ease), opacity .3s;
}
.modal.open .modal-card { transform: translateY(0) scale(1); opacity: 1; }
.modal-close { position: absolute; top: 16px; right: 16px; z-index: 2; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--border-2); background: var(--surface); display: grid; place-items: center; color: var(--heading); }
.modal-close:hover { border-color: var(--primary); color: var(--primary); }
.modal-close svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.modal-body { padding: 34px; }
.modal-thumb { height: 150px; border-radius: 12px; margin-bottom: 22px; display: grid; place-items: center; background: linear-gradient(145deg, var(--primary-soft), var(--bg-alt)); border: 1px solid var(--border); }
.modal-thumb span { font-family: var(--font-display); font-weight: 800; font-size: 2.4rem; color: var(--primary); opacity: .5; }
.modal-cat { font-family: var(--font-mono); font-size: .74rem; letter-spacing: .06em; text-transform: uppercase; color: var(--primary); }
.modal-body h3 { font-size: clamp(1.5rem, 3vw, 2rem); margin: 8px 0 16px; }
.modal-section { margin-bottom: 20px; }
.modal-section h4 { font-family: var(--font-mono); font-size: .76rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.modal-section p { color: var(--text); }
.modal-section ul { display: flex; flex-direction: column; gap: 7px; }
.modal-section ul li { color: var(--text); padding-left: 20px; position: relative; }
.modal-section ul li::before { content: ""; position: absolute; left: 0; top: 10px; width: 7px; height: 7px; border-radius: 50%; background: var(--primary); }
.modal-tech { display: flex; flex-wrap: wrap; gap: 7px; }
.modal-tech span { font-family: var(--font-mono); font-size: .74rem; color: var(--muted); border: 1px solid var(--border); border-radius: 6px; padding: 4px 9px; }
.modal-visit { margin-top: 10px; }

/* =====================================================================
   SCROLL REVEAL
   ===================================================================== */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

body.no-scroll { overflow: hidden; }

/* =====================================================================
   RESPONSIVE
   ===================================================================== */
@media (max-width: 1080px) {
  .services-grid, .why-grid, .skills-grid { grid-template-columns: repeat(2, 1fr); }
  .process-steps { grid-template-columns: repeat(3, 1fr); }
  .projects-grid { grid-template-columns: repeat(2, 1fr); }
  .project-card.is-featured { grid-column: span 2; }
}

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { min-height: 380px; max-width: 460px; margin-top: 12px; }
  .about-grid { grid-template-columns: 1fr; gap: 44px; }
  .about-media { max-width: 400px; }
  .beyond-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  .nav {
    position: fixed; inset: 72px 0 auto 0; z-index: 96;
    background: var(--surface); border-bottom: 1px solid var(--border);
    max-height: 0; overflow: hidden; transition: max-height .4s var(--ease);
    box-shadow: var(--shadow-lg);
  }
  .nav.open { max-height: 420px; }
  .nav-list { flex-direction: column; align-items: stretch; gap: 2px; padding: 14px var(--gutter) 22px; }
  .nav-link { padding: 13px 12px; font-size: 1.05rem; border-radius: 10px; }
  .nav-link::after { display: none; }
  .nav-link:hover, .nav-link.active { background: var(--primary-soft); color: var(--primary); }
  .nav-toggle { display: block; }
  .header-cta { display: none; }

  .process-steps { grid-template-columns: 1fr 1fr; }
  .hero-facts { grid-template-columns: 1fr 1fr; gap: 20px; }
}

@media (max-width: 560px) {
  body { font-size: 16px; }
  .services-grid, .why-grid, .skills-grid, .projects-grid, .process-steps { grid-template-columns: 1fr; }
  .project-card.is-featured { grid-column: span 1; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .about-badge { position: static; margin-top: 26px; max-width: none; }
  .footer-grid { grid-template-columns: 1fr; }
  .strip-inner span:not(:last-child)::after { content: none; }
  .modal-body { padding: 26px 22px; }
  .hero-visual { min-height: 340px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}
