/* =========================================================
   JKDevWorks — shared styles
   Plain CSS, no build step. Colors are tokens on :root;
   dark mode is automatic via prefers-color-scheme.
   ========================================================= */

:root {
  --bg: #f7f8fb;
  --surface: #ffffff;
  --surface-2: #eef1f7;
  --text: #121826;
  --text-muted: #4f5a6e;
  --border: #dde2ec;
  --brand: #1f4fd8;
  --brand-ink: #ffffff;
  --brand-soft: #e3eaff;
  --accent: #f28c28;
  --hero-from: #0d1b3e;
  --hero-to: #1f4fd8;
  --hero-text: #ffffff;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 8px 24px rgba(16, 24, 40, .06);
  --radius: 14px;
  --radius-sm: 8px;
  --max: 1160px;
  --gutter: 16px;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-head: "Space Grotesk", "Inter", system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0f19;
    --surface: #121827;
    --surface-2: #1a2235;
    --text: #e8ecf4;
    --text-muted: #a1abc0;
    --border: #263049;
    --brand: #6d93ff;
    --brand-ink: #0b0f19;
    --brand-soft: #1c2747;
    --accent: #ffa24d;
    --hero-from: #070b16;
    --hero-to: #15306f;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .3);
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(2.1rem, 5.5vw, 3.6rem); }
h2 { font-size: clamp(1.7rem, 3.6vw, 2.4rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
.muted { color: var(--text-muted); }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
@media (min-width: 768px) { :root { --gutter: 32px; } }

.skip-link { position: absolute; left: -999px; top: 8px; background: var(--brand); color: var(--brand-ink); padding: 8px 14px; border-radius: var(--radius-sm); z-index: 100; }
.skip-link:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  padding: .8em 1.4em; border-radius: 999px; font-weight: 600; font-size: 1rem;
  border: 2px solid transparent; cursor: pointer; transition: transform .15s, background .15s, color .15s;
  text-decoration: none !important; font-family: inherit;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: #1a1205; }
.btn-primary:hover { background: #ff9d3d; }
.btn-brand { background: var(--brand); color: var(--brand-ink); }
.btn-outline { border-color: currentColor; color: inherit; background: transparent; }
.btn-ghost { color: var(--brand); padding-left: 0; padding-right: 0; }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.logo { display: flex; align-items: center; gap: .55em; font-family: var(--font-head); font-weight: 700; font-size: 1.25rem; color: var(--text); }
.logo:hover { text-decoration: none; }
.logo-mark {
  width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand), var(--accent)); color: #fff; font-size: .9rem; letter-spacing: -.03em;
}
.logo span.dev { color: var(--brand); }

.nav-links { display: flex; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav-links a { color: var(--text); padding: 8px 12px; border-radius: var(--radius-sm); font-weight: 500; font-size: .95rem; }
.nav-links a:hover, .nav-links a[aria-current="page"] { background: var(--surface-2); text-decoration: none; }
.nav-links .btn { margin-left: 8px; padding: .55em 1.1em; }
.nav-links a.btn-primary, .nav-links a.btn-primary:hover { color: #1a1205; background: var(--accent); }

.nav-toggle { display: none; background: none; border: 0; color: var(--text); padding: 8px; cursor: pointer; border-radius: var(--radius-sm); }
.nav-toggle svg { width: 26px; height: 26px; }

@media (max-width: 899px) {
  .nav-toggle { display: inline-flex; }
  .nav-links {
    position: absolute; top: 68px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--surface); border-bottom: 1px solid var(--border); box-shadow: var(--shadow);
    padding: 8px var(--gutter) 16px; display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { display: block; padding: 14px 8px; font-size: 1.05rem; border-bottom: 1px solid var(--border); border-radius: 0; }
  .nav-links li:last-child a { border-bottom: 0; }
  .nav-links .btn { display: flex; margin: 14px 0 0; padding: .8em; border-radius: 999px; }
}

/* ---------- Hero ---------- */
.hero {
  background:
    radial-gradient(1200px 500px at 85% -10%, rgba(242, 140, 40, .28), transparent 60%),
    linear-gradient(135deg, var(--hero-from), var(--hero-to));
  color: var(--hero-text);
  padding: clamp(64px, 10vw, 120px) 0 clamp(56px, 8vw, 100px);
  position: relative; overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, #000 0%, transparent 85%);
}
.hero .container { position: relative; z-index: 1; }
.hero-grid { display: grid; gap: 48px; align-items: center; }
@media (min-width: 960px) { .hero-grid { grid-template-columns: 1.15fr .85fr; } }
.eyebrow {
  display: inline-block; font-size: .8rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 14px;
}
.hero .eyebrow { background: rgba(255,255,255,.1); padding: 6px 12px; border-radius: 999px; }
.hero p.lead { font-size: clamp(1.05rem, 2vw, 1.25rem); opacity: .9; max-width: 36em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 28px 40px; margin-top: 44px; padding-top: 28px; border-top: 1px solid rgba(255,255,255,.18); }
.hero-stats strong { display: block; font-family: var(--font-head); font-size: 1.6rem; }
.hero-stats span { font-size: .9rem; opacity: .8; }

/* Browser mockup in hero */
.mockup { background: #fff; border-radius: 14px; box-shadow: 0 30px 60px rgba(0,0,0,.35); overflow: hidden; color: #121826; transform: rotate(1.5deg); }
.mockup-bar { display: flex; gap: 6px; padding: 10px 12px; background: #eef1f7; }
.mockup-bar i { width: 10px; height: 10px; border-radius: 50%; background: #d0d6e2; }
.mockup-bar i:nth-child(1) { background: #ff6159; } .mockup-bar i:nth-child(2) { background: #ffbd2e; } .mockup-bar i:nth-child(3) { background: #28c941; }
.mockup-body { padding: 18px; display: grid; gap: 10px; }
.mk { background: #e8ecf4; border-radius: 6px; height: 12px; }
.mk.h { height: 22px; width: 70%; background: #1f4fd8; opacity: .85; }
.mk.w60 { width: 60%; } .mk.w80 { width: 80%; } .mk.w40 { width: 40%; }
.mk-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 6px; }
.mk-card { height: 64px; border-radius: 8px; background: linear-gradient(135deg, #e3eaff, #fde6cf); }
.mk.btn-mk { width: 110px; height: 26px; border-radius: 999px; background: #f28c28; }
@media (max-width: 959px) { .hero-visual { display: none; } }

/* ---------- Sections ---------- */
.section { padding: clamp(64px, 9vw, 110px) 0; }
.section.alt { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-head { max-width: 680px; margin-bottom: 44px; }
.section-head.center { text-align: center; margin-left: auto; margin-right: auto; }
.section-head p { color: var(--text-muted); font-size: 1.08rem; }

.grid { display: grid; gap: 20px; }
@media (min-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } .grid-4 { grid-template-columns: repeat(4, 1fr); } }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px; box-shadow: var(--shadow); transition: transform .2s, border-color .2s;
}
.section.alt .card { background: var(--bg); }
.card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--brand) 40%, var(--border)); }
.card p { color: var(--text-muted); margin-bottom: 0; }
.icon {
  width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand); margin-bottom: 18px;
}
.icon svg { width: 24px; height: 24px; }
.card ul.checks { margin-top: 14px; }

ul.checks { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
ul.checks li { position: relative; padding-left: 26px; color: var(--text-muted); font-size: .96rem; }
ul.checks li::before {
  content: ""; position: absolute; left: 0; top: .35em; width: 16px; height: 16px; border-radius: 50%;
  background: var(--brand-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231f4fd8' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E") center / 10px no-repeat;
}

/* ---------- Process ---------- */
.steps { counter-reset: step; }
.step { position: relative; padding-top: 8px; }
.step::before {
  counter-increment: step; content: "0" counter(step);
  font-family: var(--font-head); font-weight: 700; font-size: 2.6rem; color: var(--brand); opacity: .25; display: block; line-height: 1; margin-bottom: 12px;
}
.step p { color: var(--text-muted); }

/* ---------- Portfolio / project cards ---------- */
.project-card {
  display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); color: var(--text); transition: transform .2s;
}
.section.alt .project-card { background: var(--bg); }
.project-card:hover { transform: translateY(-4px); text-decoration: none; }
.project-thumb {
  aspect-ratio: 16 / 10; display: grid; place-items: center; position: relative; overflow: hidden;
  color: #fff; font-family: var(--font-head); font-weight: 700; font-size: 2.2rem; letter-spacing: -.02em;
}
.project-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.thumb-blue   { background: linear-gradient(135deg, #0d1b3e, #1f4fd8); }
.thumb-orange { background: linear-gradient(135deg, #7a2e00, #f28c28); }
.thumb-green  { background: linear-gradient(135deg, #0b3b2e, #1fa37a); }
.thumb-purple { background: linear-gradient(135deg, #2a0f4d, #7b4fd8); }
.thumb-slate  { background: linear-gradient(135deg, #1c2333, #55607a); }
.project-body { padding: 22px 24px 26px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.project-body h3 { margin: 0; }
.project-body p { color: var(--text-muted); margin: 0; font-size: .97rem; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 10px; }
.tag { font-size: .75rem; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); color: var(--text-muted); }
.status { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); }

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 32px; }
.filter-btn {
  border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-size: .9rem; font-weight: 500;
  padding: 8px 16px; border-radius: 999px; cursor: pointer;
}
.filter-btn[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.project-card[hidden] { display: none; }

/* ---------- Pricing ---------- */
.price-card { display: flex; flex-direction: column; }
.price-card.featured { border: 2px solid var(--brand); position: relative; }
.price-card.featured::before {
  content: "Most popular"; position: absolute; top: -13px; left: 28px; background: var(--brand); color: var(--brand-ink);
  font-size: .75rem; font-weight: 700; padding: 4px 12px; border-radius: 999px;
}
.price { font-family: var(--font-head); font-size: 2.3rem; font-weight: 700; color: var(--text); margin: 6px 0 2px; }
.price.quote { font-size: 1.6rem; color: var(--brand); }
.price small { font-size: .95rem; font-weight: 500; color: var(--text-muted); }
.price-card ul.checks { margin: 18px 0 24px; }
.price-card .btn { margin-top: auto; }

/* ---------- Testimonials ---------- */
.quote { font-size: 1.05rem; color: var(--text) !important; }
.quote-by { display: flex; align-items: center; gap: 12px; margin-top: 18px; }
.avatar { width: 42px; height: 42px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-weight: 700; }
.quote-by strong { display: block; font-size: .95rem; }
.quote-by span { font-size: .85rem; color: var(--text-muted); }

/* ---------- About ---------- */
.about-grid { display: grid; gap: 40px; align-items: center; }
@media (min-width: 900px) { .about-grid { grid-template-columns: .8fr 1.2fr; } }
.about-photo {
  aspect-ratio: 4 / 5; border-radius: var(--radius); background: linear-gradient(160deg, var(--brand), var(--accent));
  display: grid; place-items: center; color: #fff; font-family: var(--font-head); font-size: 4rem; font-weight: 700; box-shadow: var(--shadow);
  max-width: 380px; width: 100%; margin: 0 auto; overflow: hidden;
}
.about-photo img { width: 100%; height: 100%; object-fit: cover; }
.skills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }

/* ---------- FAQ ---------- */
.faq { max-width: 820px; margin: 0 auto; display: grid; gap: 12px; }
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0 22px; }
.section.alt .faq details { background: var(--bg); }
.faq summary { cursor: pointer; padding: 18px 0; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.4rem; line-height: 1; color: var(--brand); transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { color: var(--text-muted); padding-bottom: 18px; margin: 0; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; gap: 40px; }
@media (min-width: 900px) { .contact-grid { grid-template-columns: .9fr 1.1fr; } }
.contact-info { display: grid; gap: 18px; align-content: start; }
.contact-info .row { display: flex; gap: 14px; align-items: flex-start; }
.contact-info .icon { margin: 0; flex: none; }
form.contact { display: grid; gap: 16px; }
.field-row { display: grid; gap: 16px; }
@media (min-width: 640px) { .field-row { grid-template-columns: 1fr 1fr; } }
label { display: grid; gap: 6px; font-weight: 600; font-size: .92rem; }
input, select, textarea {
  font: inherit; font-weight: 400; font-size: 1rem; color: var(--text); background: var(--bg);
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; width: 100%;
}
textarea { min-height: 140px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: 0; border-color: var(--brand); }
.form-note { font-size: .85rem; color: var(--text-muted); margin: 0; }
.form-status { font-weight: 600; color: var(--brand); margin: 0; }

/* ---------- CTA band ---------- */
.cta-band {
  background: linear-gradient(135deg, var(--hero-from), var(--hero-to)); color: #fff; border-radius: var(--radius);
  padding: clamp(36px, 6vw, 64px); display: grid; gap: 24px; align-items: center;
}
@media (min-width: 800px) { .cta-band { grid-template-columns: 1fr auto; } }
.cta-band h2 { margin-bottom: .3em; }
.cta-band p { opacity: .85; margin: 0; }

/* ---------- Page header (inner pages) ---------- */
.page-hero { background: linear-gradient(135deg, var(--hero-from), var(--hero-to)); color: #fff; padding: clamp(48px, 8vw, 88px) 0; }
.page-hero p { opacity: .88; max-width: 40em; font-size: 1.1rem; margin: 0; }
.breadcrumb { font-size: .88rem; margin-bottom: 14px; opacity: .8; }
.breadcrumb a { color: #fff; }

/* ---------- Project detail page ---------- */
.project-layout { display: grid; gap: 40px; }
@media (min-width: 960px) { .project-layout { grid-template-columns: 1fr 320px; } }
.prose h2 { font-size: 1.6rem; margin-top: 1.6em; }
.prose h2:first-child { margin-top: 0; }
.prose ul { padding-left: 1.2em; }
.prose li { margin-bottom: .4em; }
.prose code { background: var(--surface-2); padding: 2px 6px; border-radius: 4px; font-size: .9em; }
.facts { align-self: start; }
@media (min-width: 960px) { .facts { position: sticky; top: 92px; } }
.facts dl { margin: 0; display: grid; gap: 14px; }
.facts dt { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); font-weight: 600; }
.facts dd { margin: 2px 0 0; font-weight: 500; }
.facts .btn { width: 100%; margin-top: 20px; }
.gallery { display: grid; gap: 12px; grid-template-columns: repeat(2, 1fr); margin: 0 0 32px; }
@media (min-width: 640px) { .gallery { grid-template-columns: repeat(4, 1fr); } }
.gallery .project-thumb { border-radius: var(--radius-sm); font-size: 1rem; }
.page-hero .hero-actions { margin-top: 24px; }
.shot { margin: 0 0 32px; }
.shot a { display: block; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); box-shadow: var(--shadow); transition: transform .2s; }
.shot a:hover { transform: translateY(-2px); }
.shot img { width: 100%; height: auto; }
.shot figcaption { font-size: .88rem; color: var(--text-muted); margin-top: 10px; }
.project-thumb.figure { aspect-ratio: 3 / 4; }
.project-thumb.figure img { object-fit: contain; padding: 12px 8px 0; object-position: center bottom; }

/* ---------- Privacy policies ---------- */
.policy-layout { display: grid; gap: 32px; }
@media (min-width: 960px) { .policy-layout { grid-template-columns: 260px 1fr; gap: 48px; } }
.policy-nav { display: flex; flex-direction: column; gap: 2px; padding: 20px; align-self: start; }
.policy-nav:hover { transform: none; }
.policy-nav a { color: var(--text-muted); padding: 6px 10px; border-radius: var(--radius-sm); font-size: .93rem; }
.policy-nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.policy-updated { font-size: .85rem; font-weight: 600; color: var(--text-muted); margin: 0 0 10px; padding: 0 10px; }
@media (min-width: 960px) { .policy-nav { position: sticky; top: 92px; } }
@media (max-width: 959px) {
  .policy-nav { flex-direction: row; flex-wrap: wrap; gap: 6px; }
  .policy-nav .policy-updated { flex-basis: 100%; padding: 0; }
  .policy-nav a { background: var(--surface-2); font-size: .85rem; }
}
.policy section { padding-bottom: 8px; scroll-margin-top: 88px; }
.policy h2 { font-size: 1.35rem; }
.policy p { color: var(--text-muted); }
.policy-link { color: var(--text); }
.policy-link:hover { text-decoration: none; }

/* ---------- 404 ---------- */
.not-found { min-height: 60vh; display: grid; place-items: center; text-align: center; padding-top: 80px; padding-bottom: 80px; }
.not-found .code { font-family: var(--font-head); font-size: clamp(4rem, 14vw, 8rem); font-weight: 700; line-height: 1; background: linear-gradient(135deg, var(--brand), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.not-found .hero-actions { justify-content: center; }

/* ---------- Footer ---------- */
.site-footer { background: var(--surface); border-top: 1px solid var(--border); padding: 56px 0 28px; font-size: .95rem; }
.footer-grid { display: grid; gap: 32px; }
@media (min-width: 768px) { .footer-grid { grid-template-columns: 1.5fr 1fr 1fr 1fr; } }
.site-footer h4 { font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); margin-bottom: 14px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.site-footer a { color: var(--text); }
.footer-bottom { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; color: var(--text-muted); font-size: .88rem; }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }
.no-js .reveal { opacity: 1; transform: none; }
