:root {
  --bg: #faf6f1;
  --paper: #ffffff;
  --ink: #23161a;
  --muted: #6e5d61;
  --line: #eadfd6;
  --accent: #7a1f35;
  --accent-ink: #ffffff;
  --soft: #f3e6e4;
  --shadow: 0 24px 60px -24px rgba(60, 20, 30, .35);
  --serif: "Fraunces", Georgia, serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161012;
    --paper: #201719;
    --ink: #f3ebe7;
    --muted: #b6a5a4;
    --line: #33262a;
    --accent: #e0a0ad;
    --accent-ink: #2a0f17;
    --soft: #2b1d21;
    --shadow: 0 24px 60px -24px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.6 var(--sans); }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.1; margin: 0; letter-spacing: -.01em; }
.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }
.eyebrow { font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: var(--accent); font-weight: 600; margin: 0 0 14px; }

/* nav */
.nav {
  position: sticky; top: 0; z-index: 10; display: flex; justify-content: space-between; align-items: center;
  padding: 14px max(16px, (100% - 1120px) / 2); background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { font-family: var(--serif); font-size: 20px; font-weight: 600; text-decoration: none; }
.brand span { color: var(--accent); font-style: italic; font-weight: 400; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 24px;
  border-radius: 999px; background: var(--accent); color: var(--accent-ink); text-decoration: none; font-weight: 600;
  border: 1px solid var(--accent); transition: transform .15s ease, box-shadow .15s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 10px 24px -12px var(--accent); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-small { min-height: 40px; padding: 0 16px; font-size: 14px; }

/* hero */
.hero { padding: clamp(56px, 10vw, 120px) 0 clamp(40px, 6vw, 72px); max-width: 860px; }
.hero h1 { font-size: clamp(40px, 7vw, 76px); }
.hero h1 em { color: var(--accent); font-weight: 400; }
.lede { font-size: clamp(17px, 2.2vw, 20px); color: var(--muted); max-width: 640px; margin: 22px 0 30px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; }
.fine { font-size: 14px; color: var(--muted); margin-top: 18px; }

/* work */
.section-head { margin-bottom: 24px; }
.section-head h2, .offer h2, .closing h2 { font-size: clamp(30px, 4.5vw, 46px); }
.case {
  display: grid; grid-template-columns: 1.35fr 1fr; gap: clamp(28px, 5vw, 64px); align-items: center;
  padding: clamp(40px, 7vw, 88px) 0; border-top: 1px solid var(--line);
}
.case.flip .frames { order: 2; }
.frames { position: relative; padding: 0 9% 12% 0; }
.case.flip .frames { padding: 0 0 12% 9%; }
.browser {
  margin: 0; border-radius: 12px; overflow: hidden; background: var(--paper); box-shadow: var(--shadow);
  border: 1px solid var(--line);
}
.bar { display: flex; align-items: center; gap: 6px; padding: 9px 12px; background: var(--soft); border-bottom: 1px solid var(--line); }
.bar i { width: 9px; height: 9px; border-radius: 50%; background: var(--line); }
.bar span { margin-left: 10px; font-size: 11px; color: var(--muted); }
.phone {
  position: absolute; right: 0; bottom: 0; width: 26%; margin: 0; border-radius: 22px; overflow: hidden;
  border: 5px solid #1b1214; background: #1b1214; box-shadow: var(--shadow);
}
.case.flip .phone { right: auto; left: 0; }
.kind { font-size: 13px; color: var(--accent); font-weight: 600; margin: 0 0 8px; }
.copy h3 { font-size: clamp(28px, 3.5vw, 38px); margin-bottom: 14px; }
.copy p { color: var(--muted); margin: 0 0 18px; }
.chips { list-style: none; padding: 0; margin: 0 0 20px; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { font-size: 13px; padding: 5px 12px; border-radius: 999px; background: var(--soft); color: var(--ink); }
.thumbs { display: flex; gap: 10px; margin-bottom: 18px; }
.thumbs button {
  padding: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; cursor: zoom-in; width: 140px;
  background: var(--paper); transition: transform .15s ease;
}
.thumbs button:hover { transform: translateY(-2px); }
.link { color: var(--accent); font-weight: 600; text-decoration: none; }
.link:hover { text-decoration: underline; }

/* software (Nib ERP) */
.software { padding-top: clamp(48px, 8vw, 96px); margin-top: 24px; border-top: 1px solid var(--line); }
.software .intro { color: var(--muted); font-size: 18px; max-width: 720px; margin: 16px 0 22px; }
.module-nav { list-style: none; padding: 0; margin: 0 0 12px; display: flex; flex-wrap: wrap; gap: 8px; }
.module-nav a {
  display: inline-block; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line); text-decoration: none;
  font-size: 14px; font-weight: 500; background: var(--paper);
}
.module-nav a:hover { border-color: var(--accent); color: var(--accent); }
.module { scroll-margin-top: 80px; }
.module .copy h3 { font-size: clamp(26px, 3vw, 34px); }
.frames.solo, .case.flip .frames.solo { padding: 0; }
.thumbs.four { flex-wrap: wrap; }
.thumbs.four button { width: calc(50% - 5px); max-width: 160px; }

/* offer */
.offer { background: var(--paper); border-block: 1px solid var(--line); padding: clamp(56px, 8vw, 96px) 0; margin-top: 24px; }
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 32px 0 40px; }
.card { background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: 20px; }
.card b { font-family: var(--serif); font-size: 19px; font-weight: 600; }
.card p { color: var(--muted); margin: 8px 0 0; font-size: 15px; }
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.steps li { display: flex; gap: 12px; align-items: center; font-weight: 500; }
.steps span {
  flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink); font-weight: 600; font-size: 15px;
}

/* closing */
.closing { text-align: center; padding: clamp(64px, 10vw, 120px) 0; max-width: 640px; }
.closing p { color: var(--muted); margin: 14px 0 28px; font-size: 18px; }
.foot {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding: 24px 0 40px;
  border-top: 1px solid var(--line); font-size: 13px; color: var(--muted);
}

/* lightbox */
dialog#lightbox { border: 0; padding: 0; background: transparent; max-width: min(1200px, 94vw); }
dialog#lightbox::backdrop { background: rgba(10, 5, 7, .82); }
dialog#lightbox img { border-radius: 10px; max-height: 88vh; width: auto; }
dialog#lightbox .close {
  position: absolute; top: 8px; right: 8px; width: 40px; height: 40px; border-radius: 50%; border: 0;
  background: rgba(0, 0, 0, .6); color: #fff; font-size: 22px; cursor: pointer;
}

@media (max-width: 860px) {
  .case { grid-template-columns: 1fr; }
  .case.flip .frames { order: 0; }
  .grid { grid-template-columns: 1fr 1fr; }
  .steps { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .grid { grid-template-columns: 1fr; }
  .nav .btn-small { padding: 0 14px; }
  .thumbs button { width: calc(50% - 5px); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .thumbs button { transition: none; }
}
