/* Fabrica — fabrica.diawan.id
 *
 * Tokens follow the Diawan Design Guide. Fabrica's registered hue is 105°,
 * which sits in the unclaimed gap between Finance (149°) and Nexus (73°) —
 * far enough from both to stay distinct at badge size.
 *
 * Both themes are mandatory, so every tinted surface below has a dark-mode
 * counterpart in this same file. A colour that only exists in the light
 * palette is an unfinished component.
 */

:root {
  /* Brand sweep — from the guide, never extended */
  --brand-blue-700: #1a3fa6;
  --brand-cyan-400: #22b8d6;
  --brand-green-400: #3cc47c;
  --brand-yellow-400: #ffd400;
  --gradient-brand: linear-gradient(115deg, #1a3fa6 0%, #1f8dd6 28%, #22b8d6 48%, #3cc47c 68%, #ffd400 100%);

  /* Neutrals */
  --ink-900: #0e1530;
  --ink-700: #2a335a;
  --ink-500: #5b6486;
  --ink-300: #a8aec5;
  --ink-200: #cfd4e2;
  --ink-100: #e7eaf3;

  /* Roles — light */
  --surface-0: #ffffff;
  --surface-1: #f6f8fc;
  --surface-2: #edf1f9;
  --fg-1: var(--ink-900);
  --fg-2: var(--ink-700);
  --fg-3: var(--ink-500);
  --fg-4: var(--ink-300);
  --fg-inv: #ffffff;
  --border: var(--ink-100);
  --border-strong: var(--ink-200);

  /* Fabrica accent — hue 105°, deeper tint for light mode */
  --accent: #35831b;
  --accent-ink: #ffffff; /* 4.8:1 on --accent */
  --accent-soft: #eaf5e4;
  --accent-line: #c2e3b2;

  --shadow-1: 0 1px 2px rgba(14, 21, 48, 0.06), 0 4px 16px rgba(14, 21, 48, 0.05);
  --shadow-2: 0 2px 4px rgba(14, 21, 48, 0.08), 0 12px 40px rgba(14, 21, 48, 0.09);

  --radius: 14px;
  --radius-sm: 9px;
  --maxw: 1120px;

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

:root[data-theme="dark"] {
  --surface-0: #141a2e;
  --surface-1: #0d1220;
  --surface-2: #1c2440;
  --fg-1: #f2f5fb;
  --fg-2: #c7cde0;
  --fg-3: #949cba;
  --fg-4: #5f6885;
  --fg-inv: #0e1530;
  --border: #253050;
  --border-strong: #32406a;

  /* Same hue, lighter tint — and the glyph flips to ink, per the guide:
     white on #63C841 is 2.1:1 and fails; ink is 8.4:1. */
  --accent: #63c841;
  --accent-ink: #0e1530;
  --accent-soft: #1b2b18;
  --accent-line: #2f4d26;

  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 16px rgba(0, 0, 0, 0.28);
  --shadow-2: 0 2px 4px rgba(0, 0, 0, 0.36), 0 12px 40px rgba(0, 0, 0, 0.42);
}

/* ── Reset ───────────────────────────────────────────────────────────── */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  color: var(--fg-2);
  background: var(--surface-1);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4 {
  color: var(--fg-1);
  line-height: 1.15;
  letter-spacing: -0.021em;
  margin: 0;
  font-weight: 680;
}

p {
  margin: 0;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
  display: block;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ── Layout ──────────────────────────────────────────────────────────── */

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

section {
  padding: 92px 0;
}

.band {
  background: var(--surface-0);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.eyebrow {
  font-size: 12.5px;
  font-weight: 650;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 18px;
}

.lede {
  font-size: 19px;
  color: var(--fg-3);
  max-width: 62ch;
}

.section-head {
  max-width: 68ch;
  margin-bottom: 52px;
}

.section-head h2 {
  font-size: clamp(28px, 4vw, 38px);
  margin-bottom: 16px;
}

/* ── Nav ─────────────────────────────────────────────────────────────── */

header.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--surface-1) 88%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  height: 66px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 11px;
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.03em;
  color: var(--fg-1);
}

.logo:hover {
  text-decoration: none;
}

/* nowrap on both: the lockup is one object, and letting "a Diawan workshop"
   break across lines turns the brand into three stacked fragments on a narrow
   viewport. The tagline is dropped entirely below 560px rather than squeezed. */
.logo > span {
  white-space: nowrap;
}

.logo small {
  font-size: 12px;
  font-weight: 500;
  color: var(--fg-4);
  letter-spacing: 0;
  margin-left: 7px;
  white-space: nowrap;
}

/* ── The mark ────────────────────────────────────────────────────────────
 *
 * The Diawan ring shaded in Fabrica's hue, under a functional badge — the
 * same construction as Orphic, and the same proportions the design guide
 * fixes: badge 44% of the mark, icon 48% of the badge, border 3.8% of the
 * mark drawn in the colour BEHIND the lockup so the badge reads as a
 * cut-out rather than a sticker. --mark-cut is what each context sets to
 * say what that colour is.
 */

.mark {
  position: relative;
  display: inline-block;
  line-height: 0;
  flex: none;
  --mark-size: 38px;
  --mark-cut: var(--surface-1);
}

.mark img {
  display: block;
  width: var(--mark-size);
  height: var(--mark-size);
}

.mark-badge {
  position: absolute;
  right: calc(var(--mark-size) * -0.076);
  bottom: calc(var(--mark-size) * -0.045);
  width: calc(var(--mark-size) * 0.44);
  height: calc(var(--mark-size) * 0.44);
  border-radius: 50%;
  background: var(--accent);
  border: max(1.5px, calc(var(--mark-size) * 0.038)) solid var(--mark-cut);
  display: grid;
  place-items: center;
  box-sizing: content-box;
}

.mark-badge svg {
  width: calc(var(--mark-size) * 0.44 * 0.56);
  height: calc(var(--mark-size) * 0.44 * 0.56);
  stroke: var(--accent-ink);
  fill: none;
}

footer .mark {
  --mark-size: 44px;
  --mark-cut: var(--surface-0);
}

.nav-links {
  display: flex;
  gap: 26px;
  margin-left: auto;
  font-size: 15px;
}

.nav-links a {
  color: var(--fg-3);
  font-weight: 500;
}

.nav-links a:hover {
  color: var(--fg-1);
  text-decoration: none;
}

/* ── Buttons ─────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  font-size: 15.5px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
  white-space: nowrap;
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: var(--shadow-1);
}

.btn-primary:hover {
  box-shadow: var(--shadow-2);
}

.btn-ghost {
  background: transparent;
  color: var(--fg-2);
  border-color: var(--border-strong);
}

.btn-ghost:hover {
  background: var(--surface-2);
}

.theme-btn {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--fg-3);
  display: grid;
  place-items: center;
  cursor: pointer;
  flex: none;
}

.theme-btn:hover {
  background: var(--surface-2);
  color: var(--fg-1);
}

.theme-btn svg {
  width: 17px;
  height: 17px;
}

:root[data-theme="dark"] .icon-moon,
:root:not([data-theme="dark"]) .icon-sun {
  display: none;
}

/* ── Hero ────────────────────────────────────────────────────────────── */

.hero {
  padding: 104px 0 96px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: -40% 30% 40% -20%;
  background: radial-gradient(60% 60% at 30% 50%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.hero .wrap {
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-size: clamp(38px, 6.2vw, 62px);
  max-width: 19ch;
  margin-bottom: 24px;
  font-weight: 700;
  letter-spacing: -0.032em;
}

.hero .lede {
  font-size: 20.5px;
  max-width: 58ch;
  color: var(--fg-2);
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 36px;
}

.hero-note {
  margin-top: 22px;
  font-size: 14.5px;
  color: var(--fg-4);
}

/* ── Comparison cards ────────────────────────────────────────────────── */

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.card {
  background: var(--surface-0);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}

.band .card {
  background: var(--surface-1);
}

.card h3 {
  font-size: 18.5px;
  margin-bottom: 10px;
}

.card p {
  font-size: 15.5px;
  color: var(--fg-3);
}

.card .cost {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px dashed var(--border-strong);
  font-size: 14.5px;
  color: var(--fg-2);
}

.card .cost b {
  color: var(--fg-1);
}

.card.accent {
  border-color: var(--accent-line);
  background: var(--accent-soft);
}

.card.accent .cost {
  border-top-color: var(--accent-line);
}

/* ── Wants row ───────────────────────────────────────────────────────── */

.wants {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.want {
  background: var(--surface-0);
  padding: 26px 24px;
}

.want b {
  display: block;
  color: var(--fg-1);
  font-size: 16.5px;
  margin-bottom: 7px;
}

.want span {
  font-size: 14.5px;
  color: var(--fg-3);
}

/* ── Steps ───────────────────────────────────────────────────────────── */

.steps {
  display: grid;
  gap: 2px;
  counter-reset: step;
}

.step {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 24px;
  padding: 26px 0;
  border-top: 1px solid var(--border);
  align-items: start;
}

.step:last-child {
  border-bottom: 1px solid var(--border);
}

.step-num {
  counter-increment: step;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 15px;
  color: var(--accent-ink);
  background: var(--accent);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
}

.step-num::before {
  content: counter(step);
}

.step h3 {
  font-size: 19px;
  margin-bottom: 8px;
}

.step p {
  font-size: 16px;
  color: var(--fg-3);
  max-width: 70ch;
}

/* ── Pricing ─────────────────────────────────────────────────────────── */

.price {
  background: var(--surface-0);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px;
  display: flex;
  flex-direction: column;
}

.band .price {
  background: var(--surface-1);
}

.price .tag {
  display: inline-block;
  align-self: flex-start;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--accent-line);
  margin-bottom: 18px;
}

.price h3 {
  font-size: 21px;
  margin-bottom: 11px;
}

.price > p {
  font-size: 15.5px;
  color: var(--fg-3);
}

.price ul {
  list-style: none;
  margin: 22px 0 0;
  padding: 0;
  display: grid;
  gap: 11px;
}

.price li {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 10px;
  font-size: 15.5px;
  color: var(--fg-2);
}

.price li svg {
  width: 17px;
  height: 17px;
  color: var(--accent);
  margin-top: 4px;
}

/* ── Honesty list ────────────────────────────────────────────────────── */

.isnot {
  display: grid;
  gap: 14px;
}

.isnot div {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 13px;
  font-size: 16px;
  color: var(--fg-3);
  align-items: start;
}

.isnot b {
  color: var(--fg-1);
  font-weight: 620;
}

.isnot svg {
  width: 19px;
  height: 19px;
  color: var(--fg-4);
  margin-top: 3px;
}

/* ── Closing CTA ─────────────────────────────────────────────────────── */

.close {
  text-align: center;
  padding: 100px 0;
}

.close h2 {
  font-size: clamp(30px, 4.6vw, 44px);
  max-width: 24ch;
  margin: 0 auto 18px;
}

.close .lede {
  margin: 0 auto;
  text-align: center;
}

.close .hero-cta {
  justify-content: center;
}

/* ── Footer ──────────────────────────────────────────────────────────── */

footer {
  background: var(--surface-0);
  border-top: 1px solid var(--border);
  padding: 44px 0;
  font-size: 14.5px;
  color: var(--fg-3);
}

.foot-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 18px 36px;
  align-items: center;
}

.foot-brand {
  display: flex;
  align-items: center;
  gap: 11px;
}

.foot-rule {
  width: 1px;
  height: 30px;
  background: var(--border-strong);
}

.foot-links {
  margin-left: auto;
  display: flex;
  gap: 24px;
}

.foot-links a {
  color: var(--fg-3);
}

.foot-links a:hover {
  color: var(--fg-1);
  text-decoration: none;
}

.gradient-rule {
  height: 3px;
  background: var(--gradient-brand);
}

/* ── Responsive ──────────────────────────────────────────────────────── */

@media (max-width: 900px) {
  .grid-3,
  .grid-2 {
    grid-template-columns: 1fr;
  }
  .wants {
    grid-template-columns: repeat(2, 1fr);
  }
  .nav-links {
    display: none;
  }
  section {
    padding: 68px 0;
  }
  .hero {
    padding: 72px 0 64px;
  }
}

@media (max-width: 560px) {
  body {
    font-size: 16px;
  }
  .logo small {
    display: none;
  }
  .mark {
    --mark-size: 34px;
  }
  .wants {
    grid-template-columns: 1fr;
  }
  .step {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .foot-links {
    margin-left: 0;
    flex-wrap: wrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .btn:hover {
    transform: none;
  }
}
