/* ============================================================
   Joseph Apps — presentation site
   Tokens · light/dark · type · components
   ============================================================ */

:root {
  /* Brand */
  --blue: #1f9bf0;
  --blue-strong: #0f86db;
  --navy: #1b2a8c;

  /* Type */
  --display: "Outfit", system-ui, sans-serif;
  --body: "Plus Jakarta Sans", system-ui, sans-serif;

  /* Radii / motion */
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 26px;
  --r-pill: 999px;
  --ease: cubic-bezier(.22,.61,.36,1);
  --maxw: 1200px;
}

/* ---- Light theme (warm, calm paper) ---- */
:root,
[data-theme="light"] {
  --bg: #f4f2ec;
  --bg-2: #efece4;
  --surface: #ffffff;
  --surface-2: #faf8f3;
  --ink: #181b22;
  --ink-soft: #3d434f;
  --muted: #767d8c;
  --line: #e4e0d6;
  --line-strong: #d6d1c4;
  --accent: var(--blue);
  --accent-ink: #ffffff;
  --jmark: var(--navy);
  --glow: rgba(31,155,240,.16);
  --shadow-sm: 0 1px 2px rgba(24,27,34,.04), 0 2px 8px rgba(24,27,34,.05);
  --shadow-md: 0 10px 30px -12px rgba(24,27,34,.16);
  --shadow-lg: 0 30px 60px -24px rgba(27,42,140,.22);
  --grain-op: .035;
}

/* ---- Dark theme (deep navy) ---- */
[data-theme="dark"] {
  --bg: #0c1322;
  --bg-2: #0a1020;
  --surface: #121c30;
  --surface-2: #16213a;
  --ink: #eef2f9;
  --ink-soft: #c2cad9;
  --muted: #8c99b3;
  --line: #213050;
  --line-strong: #2c3e63;
  --accent: #2fa6f5;
  --accent-ink: #06121f;
  --jmark: #eaf2ff;
  --glow: rgba(47,166,245,.22);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.3);
  --shadow-md: 0 14px 36px -16px rgba(0,0,0,.6);
  --shadow-lg: 0 36px 70px -28px rgba(0,0,0,.7);
  --grain-op: .05;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 88px; }

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

/* subtle page atmosphere */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none; z-index: 0;
  background:
    radial-gradient(60vw 50vh at 78% -8%, var(--glow), transparent 60%),
    radial-gradient(50vw 45vh at -6% 18%, var(--glow), transparent 55%);
  opacity: .9;
}

h1, h2, h3, h4 { font-family: var(--display); font-weight: 600; line-height: 1.06; letter-spacing: -.02em; margin: 0; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }

.wrap { width: min(100% - 48px, var(--maxw)); margin-inline: auto; position: relative; z-index: 1; }

.eyebrow {
  font-family: var(--body);
  font-weight: 700;
  font-size: .78rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent);
  display: inline-flex; align-items: center; gap: .55em;
}
.eyebrow::before { content: ""; width: 22px; height: 2px; background: var(--accent); border-radius: 2px; }

.lead { color: var(--ink-soft); font-size: 1.12rem; }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  --bg-btn: var(--accent);
  font-family: var(--display);
  font-weight: 600;
  font-size: .98rem;
  display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  padding: .85em 1.5em;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .25s, color .25s, border-color .25s;
  white-space: nowrap;
}
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 8px 22px -10px var(--accent); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 30px -10px var(--accent); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { transform: translateY(-2px); border-color: var(--accent); color: var(--accent); }
.btn-block { width: 100%; }

/* ============================================================
   Logo mark
   ============================================================ */
.logo { display: inline-flex; align-items: center; gap: .62rem; }
.logo-mark { height: 40px; width: auto; flex: none; display: block; }
.logo-word { display: flex; flex-direction: column; line-height: 1; }
.logo-word b { font-family: var(--display); font-weight: 600; font-size: 1.18rem; letter-spacing: -.01em; }
.logo-word span { font-family: var(--body); font-weight: 700; font-size: .56rem; letter-spacing: .15em; color: var(--accent); margin-top: 3px; white-space: nowrap; }

/* ============================================================
   Header / nav
   ============================================================ */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  transition: background .35s var(--ease), box-shadow .35s, border-color .35s, backdrop-filter .35s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: blur(14px) saturate(1.2);
  border-bottom-color: var(--line);
}
.nav-inner { display: flex; align-items: center; gap: 1.5rem; height: 72px; }
.nav-links { display: flex; align-items: center; gap: .35rem; margin-left: auto; }
.nav-links a {
  font-family: var(--display); font-weight: 500; font-size: .96rem; color: var(--ink-soft);
  padding: .5em .85em; border-radius: var(--r-pill); transition: color .2s, background .2s;
}
.nav-links a:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 6%, transparent); }
.nav-actions { display: flex; align-items: center; gap: .6rem; }

.icon-btn {
  width: 42px; height: 42px; border-radius: var(--r-pill);
  display: inline-grid; place-items: center;
  background: transparent; border: 1px solid var(--line-strong); color: var(--ink);
  cursor: pointer; transition: transform .25s var(--ease), border-color .25s, color .25s, background .25s;
}
.icon-btn:hover { transform: translateY(-2px); border-color: var(--accent); color: var(--accent); }
.icon-btn svg { width: 19px; height: 19px; }
.theme-toggle .moon { display: none; }
[data-theme="dark"] .theme-toggle .sun { display: none; }
[data-theme="dark"] .theme-toggle .moon { display: block; }

.nav-burger { display: none; }

/* ============================================================
   Hero (shared)
   ============================================================ */
.hero { position: relative; padding-top: 132px; padding-bottom: 84px; }
.hero-stage { position: relative; }

.hero-cta { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 36px; align-items: center; }
.hero-h1 { font-size: clamp(2.6rem, 6.4vw, 5.1rem); font-weight: 600; }
.hero-h1 .accent { color: var(--accent); }
.hero-note { margin-top: 20px; display: inline-flex; align-items: center; gap: .6em; font-size: .9rem; color: var(--muted); }
.hero-note .spark { width: 17px; height: 17px; color: var(--accent); flex: none; }
.hero-note b { color: var(--ink-soft); font-weight: 600; font-family: var(--display); }

.heroB { display: grid; grid-template-columns: 1.05fr .95fr; gap: 56px; align-items: center; }
.heroB .lead { margin-top: 22px; max-width: 520px; }

/* code-window visual */
.codewin {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg); overflow: hidden; transform: rotate(.4deg);
}
.codewin-bar { display: flex; align-items: center; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.codewin-bar i { width: 11px; height: 11px; border-radius: 50%; background: var(--line-strong); display: inline-block; }
.codewin-bar i:nth-child(1){ background:#e06c5b; } .codewin-bar i:nth-child(2){ background:#e3b341; } .codewin-bar i:nth-child(3){ background:#42b67a; }
.codewin-bar span { font-family: var(--body); font-size: .72rem; color: var(--muted); margin-left: auto; letter-spacing: .04em; }
.code { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: .82rem; line-height: 1.85; padding: 20px 22px; margin: 0; overflow-x: auto; }
.code .ln { display: block; opacity: 0; transform: translateY(4px); animation: typein .5s var(--ease) forwards; }
.code .k { color: var(--accent); } .code .s { color: #42b67a; } .code .c { color: var(--muted); } .code .f { color: var(--navy); }
[data-theme="dark"] .code .f { color: #c7b8ff; }
.code .n { color: #e3a341; }

.float { animation: float 7s ease-in-out infinite; }

/* ============================================================
   Section scaffolding
   ============================================================ */
.section { padding: 96px 0; position: relative; }
.section-head { max-width: 680px; margin-bottom: 56px; }
.section-head h2 { font-size: clamp(2rem, 4.4vw, 3.1rem); margin-top: 18px; }
.section-head p { margin-top: 18px; }
.section-alt { background: var(--bg-2); }
.section-alt::after, .section::after { content: ""; }

/* capability grid */
.cap-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.cap {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 28px 26px; box-shadow: var(--shadow-sm);
  transition: transform .3s var(--ease), box-shadow .3s, border-color .3s;
}
.cap:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.cap-ic {
  width: 48px; height: 48px; border-radius: 13px; display: grid; place-items: center; margin-bottom: 18px;
  background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent);
}
.cap-ic svg { width: 24px; height: 24px; }
.cap h3 { font-size: 1.22rem; margin-bottom: 8px; }
.cap p { color: var(--muted); font-size: .96rem; }
.cap ul { list-style: none; padding: 0; margin: 16px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.cap ul li { font-size: .8rem; color: var(--ink-soft); background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-pill); padding: .25em .75em; }

/* ============================================================
   Pricing
   ============================================================ */
.price-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; align-items: stretch; }
.price {
  position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 32px 30px 30px; display: flex; flex-direction: column; box-shadow: var(--shadow-sm);
  transition: transform .3s var(--ease), box-shadow .3s, border-color .3s;
}
.price:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); }
.price.featured { border-color: var(--accent); box-shadow: var(--shadow-md); }
.price-badge {
  position: absolute; top: -12px; left: 30px;
  font-family: var(--display); font-weight: 600; font-size: .72rem; letter-spacing: .04em;
  background: var(--accent); color: var(--accent-ink); padding: .35em .9em; border-radius: var(--r-pill);
}
.price-ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); margin-bottom: 18px; }
.price-ic svg { width: 22px; height: 22px; }
.price h3 { font-size: 1.34rem; }
.price .sub { color: var(--muted); font-size: .92rem; margin-top: 6px; min-height: 2.4em; }
.price .amount { display: flex; align-items: baseline; gap: .3em; margin: 22px 0 4px; }
.price .amount .num { font-family: var(--display); font-weight: 600; font-size: 2.7rem; letter-spacing: -.03em; }
.price .amount .per { color: var(--muted); font-size: .95rem; font-weight: 500; }
.price .note { color: var(--muted); font-size: .82rem; margin-bottom: 22px; }
.price ul { list-style: none; padding: 0; margin: 0 0 26px; display: flex; flex-direction: column; gap: 11px; }
.price ul li { display: flex; gap: .65em; font-size: .93rem; color: var(--ink-soft); align-items: flex-start; }
.price ul li svg { width: 18px; height: 18px; color: var(--accent); flex: none; margin-top: 3px; }
.price .btn { margin-top: auto; }
.price.cta-card { background: color-mix(in srgb, var(--accent) 8%, var(--surface)); border-style: dashed; border-color: var(--line-strong); }
.price.cta-card .price-ic { background: color-mix(in srgb, var(--accent) 18%, transparent); }
.price.cta-card p { color: var(--ink-soft); font-size: .96rem; margin-top: 10px; flex: 1; }

.quote-bar {
  margin-top: 26px; display: flex; align-items: center; gap: 26px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 26px 32px; box-shadow: var(--shadow-sm);
}
.quote-bar .qt { flex: 1 1 360px; }
.quote-bar h3 { font-size: 1.3rem; }
.quote-bar p { color: var(--muted); margin-top: 6px; }

/* ============================================================
   About
   ============================================================ */
.about-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 64px; align-items: center; }
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-top: 6px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 24px; box-shadow: var(--shadow-sm); }
.stat .num { font-family: var(--display); font-weight: 600; font-size: 2.4rem; color: var(--accent); letter-spacing: -.03em; line-height: 1; }
.stat .lbl { color: var(--muted); font-size: .9rem; margin-top: 8px; }
.values { display: flex; flex-direction: column; gap: 18px; margin-top: 30px; }
.value { display: flex; gap: 16px; }
.value .vic { width: 40px; height: 40px; flex: none; border-radius: 11px; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); }
.value .vic svg { width: 20px; height: 20px; }
.value h4 { font-size: 1.05rem; margin-bottom: 3px; }
.value p { color: var(--muted); font-size: .93rem; }
.products-note {
  margin-top: 30px; padding: 20px 24px; border-left: 3px solid var(--accent);
  background: var(--surface-2); border-radius: 0 var(--r-md) var(--r-md) 0;
}
.products-note strong { font-family: var(--display); }
.products-note p { color: var(--ink-soft); font-size: .96rem; margin-top: 4px; }

/* ============================================================
   Contact
   ============================================================ */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: start; }
.field { margin-bottom: 18px; }
.field label { display: block; font-family: var(--display); font-weight: 500; font-size: .88rem; margin-bottom: 7px; color: var(--ink-soft); }
.field input, .field textarea {
  width: 100%; font-family: var(--body); font-size: 1rem; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  padding: .8em 1em; transition: border-color .2s, box-shadow .2s; resize: vertical;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--glow); }
.field.invalid input, .field.invalid textarea { border-color: #e06c5b; }
.field .err { color: #e06c5b; font-size: .8rem; margin-top: 5px; display: none; }
.field.invalid .err { display: block; }
.form-ok { display: none; background: color-mix(in srgb, #42b67a 14%, transparent); border: 1px solid #42b67a; color: var(--ink); border-radius: var(--r-sm); padding: 14px 16px; font-size: .92rem; margin-bottom: 16px; }
.form-ok.show { display: block; animation: rise .4s var(--ease) both; }

.contact-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 34px; box-shadow: var(--shadow-sm); }
.contact-list { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.contact-row { display: flex; gap: 16px; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--line); }
.contact-row:last-child { border-bottom: 0; }
.contact-row .cic { width: 44px; height: 44px; flex: none; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); }
.contact-row .cic svg { width: 20px; height: 20px; }
.contact-row .ct { font-size: .8rem; color: var(--muted); }
.contact-row .cv { font-family: var(--display); font-weight: 500; font-size: 1.02rem; }
.book {
  margin-top: 24px; display: flex; gap: 16px; align-items: center;
  background: var(--surface-2); border: 1px dashed var(--line-strong); border-radius: var(--r-md); padding: 20px 22px;
}
.book .bt { flex: 1; }
.book h4 { font-size: 1.05rem; } .book p { color: var(--muted); font-size: .88rem; margin-top: 3px; }

/* ============================================================
   Footer
   ============================================================ */
.footer { padding: 64px 0 36px; border-top: 1px solid var(--line); background: var(--bg-2); }
.footer-top { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; }
.footer p { color: var(--muted); font-size: .94rem; margin-top: 16px; max-width: 34ch; }
.footer h5 { font-family: var(--display); font-size: .82rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 14px; }
.footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 9px; }
.footer ul a { color: var(--muted); font-size: .94rem; transition: color .2s; }
.footer ul a:hover { color: var(--accent); }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; }

/* ============================================================
   Reveal animation
   ============================================================ */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.reveal[data-delay="1"]{ transition-delay: .08s; }
.reveal[data-delay="2"]{ transition-delay: .16s; }
.reveal[data-delay="3"]{ transition-delay: .24s; }
.reveal[data-delay="4"]{ transition-delay: .32s; }
.reveal[data-delay="5"]{ transition-delay: .40s; }

@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes float { 0%,100% { transform: translateY(0) rotate(.4deg); } 50% { transform: translateY(-12px) rotate(.4deg); } }
@keyframes typein { to { opacity: 1; transform: none; } }
@keyframes drawb { from { stroke-dashoffset: 280; } to { stroke-dashoffset: 0; } }

/* ============================================================
   Mobile menu
   ============================================================ */
.mobile-menu {
  position: fixed; inset: 0; z-index: 60; background: var(--bg);
  display: flex; flex-direction: column; padding: 24px;
  transform: translateY(-100%); transition: transform .4s var(--ease); visibility: hidden;
}
.mobile-menu.open { transform: none; visibility: visible; }
.mobile-menu .mm-top { display: flex; align-items: center; justify-content: space-between; }
.mobile-menu nav { display: flex; flex-direction: column; gap: 6px; margin-top: 40px; }
.mobile-menu nav a { font-family: var(--display); font-weight: 600; font-size: 1.6rem; padding: .35em 0; border-bottom: 1px solid var(--line); }
.mobile-menu .mm-cta { margin-top: auto; display: flex; flex-direction: column; gap: 12px; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 980px) {
  .heroB, .about-grid, .contact-grid { grid-template-columns: 1fr; gap: 40px; }
  .heroB .codewin { max-width: 520px; }
  .cap-grid, .price-grid { grid-template-columns: 1fr 1fr; }
  .footer-top { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .nav-links { display: none; }
  .nav-burger { display: inline-grid; }
  .nav .btn-book { display: none; }
  .cap-grid, .price-grid, .stat-grid, .footer-top { grid-template-columns: 1fr; }
  .section { padding: 72px 0; }
  .hero { padding-top: 116px; }
}

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