/* ===========================================================================
   jawaid.dev — Direction B ("engineered" look)
   Sans + monospace accents, cyan accent, dots texture, 12px radius.
   Dark default with a persisted light/dark toggle.
   =========================================================================== */

/* ---- Design tokens -------------------------------------------------------- */
:root {
  --bg: #08090c;
  --fg: #eef0f3;
  --muted: #8d929c;
  --line: rgba(255, 255, 255, 0.10);
  --line-strong: rgba(255, 255, 255, 0.20);
  --card: rgba(255, 255, 255, 0.032);
  --accent: oklch(0.74 0.145 200);
  --accent-soft: oklch(0.74 0.145 200 / 0.16);
  --shadow: 0 24px 60px -28px rgba(0, 0, 0, 0.8);

  --display: "Outfit", system-ui, sans-serif;
  --body: "Hanken Grotesk", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;

  --radius: 12px;
  --grid: radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1.5px);
  --glow: 1;
  --maxw: 1200px;
  --pad-x: clamp(18px, 4vw, 44px);
  --pad-y: clamp(64px, 9vw, 128px);
}

[data-theme="light"] {
  --bg: #f1f4f8;
  --fg: #13161c;
  --muted: #555b66;
  --line: rgba(10, 18, 30, 0.12);
  --line-strong: rgba(10, 18, 30, 0.24);
  --card: #ffffff;
  --accent: oklch(0.55 0.16 200);
  --accent-soft: oklch(0.55 0.16 200 / 0.10);
  --shadow: 0 24px 60px -30px rgba(10, 20, 40, 0.18);
  --grid: radial-gradient(rgba(10, 18, 30, 0.06) 1px, transparent 1.5px);
}

/* ---- Base ----------------------------------------------------------------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  /* background set instantly (not transitioned); only color animates */
  background-color: var(--bg);
  color: var(--fg);
  font-family: var(--body);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  transition: color 0.45s ease;
}
a { color: inherit; }
img { max-width: 100%; }
::selection { background: var(--accent-soft); }

/* ---- Layout helpers ------------------------------------------------------- */
.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding-left: var(--pad-x);
  padding-right: var(--pad-x);
}
.section { border-bottom: 1px solid var(--line); }
.section > .container { padding-top: var(--pad-y); padding-bottom: var(--pad-y); }
.section[id] { scroll-margin-top: 84px; }

/* ---- Typography ----------------------------------------------------------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: clamp(11px, 1.15vw, 12px);
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 18px;
}
.eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 2px;
  flex-shrink: 0;
}
.h2 {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.9rem, 3.4vw, 2.9rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0;
  text-wrap: balance;
}
.lead {
  margin: 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.4vw, 1.16rem);
  line-height: 1.7;
  text-wrap: pretty;
}

/* ---- Buttons -------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  font-weight: 600;
  border-radius: var(--radius);
  cursor: pointer;
}
.btn-solid {
  background: var(--fg);
  color: var(--bg);
  border: 1px solid var(--fg);
  font-size: 15px;
  padding: 14px 24px;
  transition: transform 0.2s, opacity 0.2s;
}
.btn-solid:hover { transform: translateY(-2px); opacity: 0.92; }
.btn-outline {
  background: transparent;
  color: var(--fg);
  font-size: 15px;
  padding: 14px 22px;
  border: 1px solid var(--line-strong);
  transition: border-color 0.2s, background 0.2s;
}
.btn-outline:hover { border-color: var(--accent); background: var(--accent-soft); }

/* ---- Header --------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  border-bottom: 1px solid var(--line);
}
.site-header__bar {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 13px var(--pad-x);
  display: flex;
  align-items: center;
  gap: 18px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--fg);
  min-width: 0;
}
.brand__logo {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--line-strong);
  filter: grayscale(1) contrast(1.04);
  flex-shrink: 0;
}
.brand__name { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand__title { font-weight: 600; font-size: 15px; letter-spacing: -0.01em; }
.brand__sub {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 3px;
  line-height: 1.5;
}
.nav { margin-left: auto; display: flex; align-items: center; gap: 2px; }
.nav__link {
  text-decoration: none;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  padding: 8px 13px;
  border-radius: var(--radius);
  transition: color 0.2s, background 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.nav__link:hover { color: var(--fg); background: var(--accent-soft); }
.nav__ext { font-size: 11px; opacity: 0.8; }

.header__actions { display: flex; align-items: center; gap: 12px; margin-left: 18px; flex-shrink: 0; }
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--card);
  color: var(--fg);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.icon-btn:hover { border-color: var(--accent); background: var(--accent-soft); }
.burger { border-radius: 9px; }

/* theme icon visibility: sun in dark, moon in light */
.icon-moon { display: none; }
[data-theme="light"] .icon-sun { display: none; }
[data-theme="light"] .icon-moon { display: inline; }

/* mobile menu */
.mobile-menu {
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 96%, transparent);
  padding: 10px var(--pad-x) 18px;
  display: none;
  flex-direction: column;
  gap: 2px;
}
.mobile-menu.is-open { display: flex; }
.mobile-menu__link {
  text-decoration: none;
  color: var(--fg);
  font-size: 17px;
  font-weight: 500;
  padding: 12px 6px;
  border-bottom: 1px solid var(--line);
}
.mobile-menu__link--ext { color: var(--accent); border-bottom: none; }

/* burger only on small screens */
.burger { display: none; }
@media (max-width: 880px) {
  .nav { display: none; }
  .burger { display: inline-flex; }
}

/* ---- Hero ----------------------------------------------------------------- */
.hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background-image: var(--grid);
  background-size: 46px 46px;
}
.glow {
  position: absolute;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-soft), transparent 68%);
  pointer-events: none;
  filter: blur(8px);
  opacity: var(--glow);
  transition: opacity 0.4s ease;
}
.glow--hero { top: -180px; right: -120px; }
.glow--contact { bottom: -200px; left: -100px; width: 560px; height: 560px; }
.hero__inner {
  position: relative;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(72px, 11vw, 156px) var(--pad-x) clamp(60px, 8vw, 116px);
}
.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-family: var(--mono);
  font-size: clamp(11px, 1.15vw, 13px);
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}
.hero__eyebrow::before {
  content: "";
  width: 7px;
  height: 7px;
  background: var(--accent);
  border-radius: 2px;
  display: inline-block;
  flex-shrink: 0;
}
.hero__h1 {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(2.4rem, 6.4vw, 5.1rem);
  line-height: 1.02;
  letter-spacing: -0.025em;
  max-width: 17ch;
  margin: 0.42em 0 0;
  text-wrap: balance;
}
.accent { color: var(--accent); }
.hero__sub {
  max-width: 60ch;
  color: var(--muted);
  font-size: clamp(1.06rem, 1.7vw, 1.32rem);
  line-height: 1.6;
  margin-top: 1.35em;
  text-wrap: pretty;
}
.cta-row { display: flex; flex-wrap: wrap; gap: 13px; margin-top: 2.1em; }
.availability {
  margin-top: 1.7em;
  font-size: 13.5px;
  color: var(--muted);
  max-width: 64ch;
  line-height: 1.6;
  display: flex;
  gap: 11px;
  align-items: flex-start;
}
.availability__dot { color: var(--accent); font-size: 9px; line-height: 1.9; flex-shrink: 0; }

/* ---- About ---------------------------------------------------------------- */
.about { position: relative; overflow: hidden; }
.about__inner {
  position: relative;
  z-index: 1;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: var(--pad-y) var(--pad-x);
  display: flex;
  flex-wrap: wrap;
  gap: clamp(32px, 5vw, 72px);
}
.about__head { flex: 1 1 240px; min-width: 240px; }
.about__body { flex: 1.5 1 360px; min-width: 300px; display: flex; flex-direction: column; gap: 1.3em; }
.about__body p {
  margin: 0;
  font-size: clamp(1rem, 1.4vw, 1.16rem);
  line-height: 1.7;
  color: var(--muted);
  text-wrap: pretty;
}
.about__body strong { color: var(--fg); font-weight: 500; }
.about__diagram {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: clamp(44px, 8vw, 110px) 0 0 var(--pad-x);
  color: var(--muted);
  opacity: 0.32;
  -webkit-mask-image: linear-gradient(to right, #000 0%, #000 30%, transparent 50%);
  mask-image: linear-gradient(to right, #000 0%, #000 30%, transparent 50%);
}
.about__diagram svg { width: min(560px, 50%); height: 84%; overflow: visible; }

/* ---- Cards (expertise / products / plugins) ------------------------------ */
.section-head { margin-bottom: clamp(36px, 5vw, 60px); max-width: 60ch; }
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
  gap: clamp(14px, 1.6vw, 20px);
}
.card {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: var(--radius);
  padding: clamp(26px, 3vw, 38px);
  transition: transform 0.28s, border-color 0.28s, box-shadow 0.28s;
}
.card:hover { transform: translateY(-5px); border-color: var(--accent); box-shadow: var(--shadow); }
.card__title {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.25rem, 1.9vw, 1.5rem);
  letter-spacing: -0.01em;
  margin: 0 0 12px;
  line-height: 1.15;
}
.card__desc { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.65; }

/* ---- Selected Work -------------------------------------------------------- */
.work__sub {
  position: relative;
  z-index: 1;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 18px;
}
.work__sub--plugins { margin-bottom: 6px; }
.work__sub .normal { text-transform: none; letter-spacing: 0; opacity: 0.7; }

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: clamp(14px, 1.6vw, 20px);
  margin-bottom: clamp(44px, 5vw, 64px);
}
.product-card {
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: var(--radius);
  padding: clamp(24px, 3vw, 32px);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 0.28s, border-color 0.28s, box-shadow 0.28s;
}
.product-card:hover { transform: translateY(-5px); border-color: var(--accent); box-shadow: var(--shadow); }
.product-card__top { display: flex; align-items: center; justify-content: space-between; }
.product-card__name { font-family: var(--display); font-weight: 600; font-size: 1.35rem; letter-spacing: -0.01em; }
.product-card__arrow { color: var(--accent); font-size: 15px; }
.product-card__url {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 4px;
  opacity: 0.8;
}

.plugin-grid { display: flex; flex-wrap: wrap; gap: clamp(12px, 1.4vw, 16px); }
.plugin-card {
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  flex: 1 1 280px;
  transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
}
.plugin-card:hover { transform: translateY(-4px); border-color: var(--accent); box-shadow: var(--shadow); }
.plugin-card__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.plugin-card__name { font-weight: 600; font-size: 16px; line-height: 1.3; }
.plugin-card__arrow { color: var(--muted); font-size: 14px; flex-shrink: 0; }
.plugin-card__meta { font-family: var(--mono); font-size: 11.5px; color: var(--muted); opacity: 0.85; }
.plugin-card__meta--break { word-break: break-all; }
.badge {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  padding: 3px 10px;
  border-radius: 100px;
  width: fit-content;
  margin-top: 2px;
}
.work__more { margin-top: 26px; }
.btn-outline--sm { font-size: 15px; padding: 12px 20px; }
.btn-outline--sm .accent { color: var(--accent); }

/* IDE mockup */
.ide {
  margin: 0 auto -42px;
  max-width: 720px;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  opacity: 0.97;
  -webkit-mask-image:
    linear-gradient(to right, transparent 0%, #000 11%, #000 89%, transparent 100%),
    linear-gradient(to bottom, #000 0%, #000 44%, transparent 90%);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(to right, transparent 0%, #000 11%, #000 89%, transparent 100%),
    linear-gradient(to bottom, #000 0%, #000 44%, transparent 90%);
  mask-composite: intersect;
}
.ide__bar { display: flex; align-items: center; gap: 13px; padding: 9px 13px; border-bottom: 1px solid var(--line); }
.ide__dots { display: flex; gap: 6px; }
.ide__dots span { width: 10px; height: 10px; border-radius: 50%; background: var(--line-strong); }
.ide__dots span:first-child { background: var(--accent); }
.ide__tabs { display: flex; gap: 2px; font-family: var(--mono); font-size: 11.5px; }
.ide__tab { padding: 6px 12px; color: var(--muted); }
.ide__tab--active {
  border-radius: 6px 6px 0 0;
  background: var(--accent-soft);
  color: var(--fg);
  border-bottom: 2px solid var(--accent);
}
.ide__body { display: flex; }
.ide__tree {
  flex: 0 0 134px;
  border-right: 1px solid var(--line);
  padding: 12px 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}
.ide__tree span { padding: 4px 8px; }
.ide__tree .label { padding: 3px 8px; letter-spacing: 0.12em; font-size: 9.5px; opacity: 0.7; }
.ide__tree .dir { color: var(--fg); }
.ide__tree .file { padding-left: 20px; }
.ide__tree .file--active { background: var(--accent-soft); color: var(--fg); border-radius: 5px; }
.ide__tree .mt { margin-top: 4px; }
.ide__code-wrap { flex: 1; min-width: 0; display: flex; overflow-x: auto; }
.ide__gutter {
  margin: 0;
  padding: 14px 8px 14px 14px;
  text-align: right;
  color: var(--muted);
  opacity: 0.45;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.72;
  user-select: none;
  white-space: pre;
}
.ide__code {
  margin: 0;
  padding: 14px 18px;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.72;
  color: var(--fg);
  white-space: pre;
}
.ide__code .kw { color: var(--accent); }
.ide__term {
  border-top: 1px solid var(--line);
  padding: 11px 16px;
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.85;
  background: color-mix(in srgb, var(--card) 70%, var(--bg));
}
.ide__term .muted { color: var(--muted); }
.ide__term .ok { color: var(--accent); }

/* ---- Testimonials --------------------------------------------------------- */
.quotes { display: flex; flex-wrap: wrap; gap: clamp(14px, 1.6vw, 20px); align-items: stretch; }
.quote {
  margin: 0;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
}
.quote--featured { flex: 1.25 1 380px; padding: clamp(30px, 3.4vw, 44px); }
.quote__mark { font-family: var(--display); font-size: 3.6rem; line-height: 0.6; color: var(--accent); margin-bottom: 18px; }
.quote--featured blockquote {
  margin: 0;
  font-size: clamp(1.15rem, 1.7vw, 1.55rem);
  line-height: 1.5;
  flex: 1;
  font-family: var(--display);
  letter-spacing: -0.005em;
}
.quotes__col { flex: 1 1 300px; display: flex; flex-direction: column; gap: clamp(14px, 1.6vw, 20px); }
.quote--sm { flex: 1; padding: clamp(24px, 2.8vw, 30px); }
.quote--sm blockquote { margin: 0; font-size: clamp(1.02rem, 1.4vw, 1.18rem); line-height: 1.55; flex: 1; }
.quote figcaption { display: flex; align-items: center; gap: 13px; }
.quote--featured figcaption { margin-top: 28px; }
.quote--sm figcaption { margin-top: 20px; gap: 12px; }
.avatar {
  border-radius: 50%;
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-weight: 600;
  flex-shrink: 0;
}
.avatar--lg { width: 46px; height: 46px; font-size: 15px; }
.avatar--sm { width: 42px; height: 42px; font-size: 14px; }
.quote__person { line-height: 1.3; }
.quote__name { font-weight: 600; font-size: 15px; display: block; }
.quote__role { color: var(--muted); font-size: 13px; }

/* ---- Writing -------------------------------------------------------------- */
.writing__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: var(--pad-y) var(--pad-x);
  display: flex;
  flex-wrap: wrap;
  gap: clamp(28px, 4vw, 60px);
  align-items: center;
  justify-content: space-between;
}
.writing__text { flex: 1 1 360px; min-width: 300px; }
.writing__text .h2 { margin-bottom: 14px; }
.writing__text .lead { max-width: 50ch; line-height: 1.65; }
.writing__cta { flex-shrink: 0; }
.btn-solid--lg { font-size: 15px; padding: 15px 26px; }

/* ---- Contact -------------------------------------------------------------- */
.contact {
  position: relative;
  overflow: hidden;
  background-image: var(--grid);
  background-size: 46px 46px;
}
.contact__inner {
  position: relative;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(72px, 10vw, 140px) var(--pad-x);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.contact__h2 {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(2.6rem, 7vw, 5.5rem);
  line-height: 0.98;
  letter-spacing: -0.03em;
  margin: 0;
}
.contact__lead {
  margin: 1.4em auto 0;
  max-width: 62ch;
  color: var(--muted);
  font-size: clamp(1.02rem, 1.5vw, 1.2rem);
  line-height: 1.65;
  text-wrap: pretty;
}
.contact .cta-row { justify-content: center; margin-top: 2.3em; }
.btn-solid--xl { font-size: 16px; padding: 16px 28px; }
.btn-outline--xl { font-size: 16px; padding: 16px 24px; }

/* ---- Footer --------------------------------------------------------------- */
.site-footer { border-top: 1px solid var(--line); }
.site-footer__inner { max-width: var(--maxw); margin: 0 auto; padding: clamp(40px, 5vw, 60px) var(--pad-x); }
.site-footer__top {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--line);
}
.site-footer__brand { display: flex; align-items: center; gap: 13px; }
.site-footer__logo {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--line-strong);
  filter: grayscale(1) contrast(1.04);
}
.site-footer__name { line-height: 1.25; }
.site-footer__name b { font-weight: 600; font-size: 15px; display: block; }
.site-footer__name span {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.footer-nav { display: flex; flex-wrap: wrap; gap: 6px 4px; }
.footer-nav a {
  text-decoration: none;
  color: var(--muted);
  font-size: 14px;
  padding: 6px 11px;
  border-radius: var(--radius);
  transition: color 0.2s, background 0.2s;
}
.footer-nav a:hover { color: var(--fg); background: var(--accent-soft); }
.site-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  justify-content: space-between;
  align-items: center;
  margin-top: 26px;
}
.copyright { margin: 0; font-family: var(--mono); font-size: 12.5px; color: var(--muted); }
.social { display: flex; gap: 10px; }
.social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--fg);
  transition: border-color 0.2s, background 0.2s;
}
.social a:hover { border-color: var(--accent); background: var(--accent-soft); }

/* ---- Scroll reveal -------------------------------------------------------- */
[data-reveal] { will-change: opacity, transform; }
.reveal-hidden { opacity: 0; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  [data-reveal], .reveal-hidden { opacity: 1 !important; transform: none !important; }
}
