/* nibhaus.css: the app's "ink" identity, as a web experience: warm paper +
   ink-blue, editorial serif display over sans body. Deliberately warmer and
   more organic than the NovusKey "secure lab" shell. Theme-aware. */
:root {
  --nb-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --nb-serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif;

  --nb-bg: #f4f1ea;
  --nb-surface: #fffdf8;
  --nb-border: #e3dccc;
  --nb-text: #1c1813;
  --nb-muted: #6a6153;
  --nb-faint: #97907f;
  --nb-ink: #2b46c8;
  --nb-ink-soft: #e6e9fb;
  /* Solid fills (primary buttons, CTA band) use --nb-fill, a fixed saturated ink kept the same in
     both themes. White text on #2b46c8 is 7.46:1, so fills pass AA light and dark. The theme-aware
     --nb-ink is used for accent text, borders, and marks, where the lighter dark value is legible. */
  --nb-fill: #2b46c8;
  --nb-red: #d15b6e;
  --nb-shadow: 0 1px 2px rgba(28,24,19,.05), 0 10px 30px rgba(28,24,19,.06);
  --nb-shadow-lg: 0 1px 2px rgba(28,24,19,.06), 0 24px 60px rgba(28,24,19,.10);
  --nb-radius: 12px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --nb-bg: #14151d; --nb-surface: #1b1d27; --nb-border: #2e3040; --nb-text: #ece6da;
    --nb-muted: #a49d8e; --nb-faint: #6f6a5e; --nb-ink: #7d95f2; --nb-ink-soft: #1e2540; --nb-fill: #2b46c8; --nb-red: #d98a97;
    --nb-shadow: 0 1px 2px rgba(0,0,0,.4), 0 12px 34px rgba(0,0,0,.5);
    --nb-shadow-lg: 0 1px 2px rgba(0,0,0,.45), 0 24px 64px rgba(0,0,0,.55);
  }
}
:root[data-theme="light"] { --nb-bg:#f4f1ea; --nb-surface:#fffdf8; --nb-border:#e3dccc; --nb-text:#1c1813; --nb-muted:#6a6153; --nb-faint:#97907f; --nb-ink:#2b46c8; --nb-ink-soft:#e6e9fb; --nb-fill:#2b46c8; --nb-red:#d15b6e; }
:root[data-theme="dark"] { --nb-bg:#14151d; --nb-surface:#1b1d27; --nb-border:#2e3040; --nb-text:#ece6da; --nb-muted:#a49d8e; --nb-faint:#6f6a5e; --nb-ink:#7d95f2; --nb-ink-soft:#1e2540; --nb-fill:#2b46c8; --nb-red:#d98a97; }

body { font-family: var(--nb-sans); background: var(--nb-bg); color: var(--nb-text); }
/* faint ink glow behind the page as warm texture */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(40vw 32vw at 88% -6%, color-mix(in srgb, var(--nb-ink) 14%, transparent), transparent 70%);
  opacity: .8;
}

/* ---- header ---- */
.nb-header { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--nb-bg) 90%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--nb-border); }
.nb-header .container { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 18px; }
.nb-brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
/* Nibhaus brand mark: canonical fountain-nib logo, shipped as two fixed-color PNGs
   (navy for light backgrounds, cream for dark). Swapped by theme, same mechanism
   as the color tokens above: prefers-color-scheme first, then a data-theme override. */
.nb-brand .nib-mark { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; flex-shrink: 0; }
.nb-brand .nib-mark img { width: 100%; height: 100%; object-fit: contain; }
.nb-brand .nib-mark .nib-mark-dark { display: none; }
@media (prefers-color-scheme: dark) {
  .nb-brand .nib-mark .nib-mark-light { display: none; }
  .nb-brand .nib-mark .nib-mark-dark { display: inline; }
}
:root[data-theme="light"] .nb-brand .nib-mark .nib-mark-light { display: inline; }
:root[data-theme="light"] .nb-brand .nib-mark .nib-mark-dark { display: none; }
:root[data-theme="dark"] .nb-brand .nib-mark .nib-mark-light { display: none; }
:root[data-theme="dark"] .nb-brand .nib-mark .nib-mark-dark { display: inline; }
.nb-brand b { font-family: var(--nb-serif); font-size: 22px; font-weight: 600; letter-spacing: -.01em; color: var(--nb-text); }
.nb-brand .by { font-size: 12px; color: var(--nb-muted); }
.nb-nav { display: flex; align-items: center; gap: 8px; font-size: 14.5px; }
.nb-nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 999px; color: var(--nb-muted); text-decoration: none; }
.nb-nav a:hover, .nb-nav a[aria-current] { color: var(--nb-text); background: color-mix(in srgb, var(--nb-surface) 80%, transparent); }
.nb-menu-btn { display: none; align-items: center; justify-content: center; gap: 7px; min-height: 44px; min-width: 44px; padding: 0 12px; border: 1px solid var(--nb-border); border-radius: 999px; background: var(--nb-surface); color: var(--nb-text); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.nb-menu-btn .bars { display: inline-grid; gap: 3px; }
.nb-menu-btn .bars span { display: block; width: 16px; height: 2px; background: currentColor; border-radius: 2px; }
@media (max-width: 640px) {
  .nb-menu-btn { display: inline-flex; }
  .nb-nav {
    position: absolute; left: 12px; right: 12px; top: 62px; flex-direction: column; align-items: stretch; gap: 2px;
    padding: 10px; background: var(--nb-surface); border: 1px solid var(--nb-border); border-radius: 16px; box-shadow: var(--nb-shadow-lg);
    transform: translateY(-8px); opacity: 0; pointer-events: none; visibility: hidden;
    /* visibility flips to hidden only after the fade-out finishes, so closed links leave the tab
       order without clipping the transition; opening flips visibility back immediately. */
    transition: opacity .18s ease, transform .18s ease, visibility 0s linear .18s;
  }
  .nb-nav a { border-radius: 10px; }
  .nav-open .nb-nav { transform: none; opacity: 1; pointer-events: auto; visibility: visible; transition: opacity .18s ease, transform .18s ease, visibility 0s linear 0s; }
  .nb-brand .by { display: none; }
}

/* ---- primitives ---- */
.nb-eyebrow { font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--nb-ink); font-weight: 600; }
.nb-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 600; font-size: 15px; min-height: 44px; padding: 12px 22px; border-radius: 999px; text-decoration: none; border: 1px solid transparent; transition: transform .12s ease, box-shadow .15s ease; }
/* white on --nb-fill (#2b46c8) = 7.46:1 in both themes */
.nb-btn-primary { background: var(--nb-fill); color: #fff; border-color: var(--nb-fill); }
/* The global :focus-visible ring uses currentColor (white), which nearly vanishes against the
   light nb-bg/nb-surface the button normally sits on (outline-offset: 3px puts the ring in that
   surrounding color, not on the button fill). --nb-text always reads >=13:1 against nb-bg/nb-surface
   in both themes. */
.nb-btn-primary:focus-visible { outline-color: var(--nb-text); }
.nb-btn-ghost { border-color: var(--nb-border); color: var(--nb-text); background: var(--nb-surface); }
.nb-btn .arrow { transition: transform .15s ease; }
@media (prefers-reduced-motion: no-preference) {
  .nb-btn:hover { transform: translateY(-1px); box-shadow: var(--nb-shadow); }
  .nb-btn-primary:hover { box-shadow: 0 8px 24px color-mix(in srgb, var(--nb-fill) 42%, transparent); }
  .nb-btn:hover .arrow { transform: translateX(3px); }
}
.nb-section { padding-block: clamp(56px, 9vw, 100px); }

/* signal pills */
.nb-pills { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.nb-pill { display: inline-flex; align-items: center; gap: 8px; padding: 7px 13px; border: 1px solid var(--nb-border); border-radius: 999px; background: color-mix(in srgb, var(--nb-surface) 72%, transparent); color: var(--nb-muted); font-size: 13px; font-weight: 600; }
.nb-pill::before { content: ""; width: 7px; height: 7px; border-radius: 999px; background: var(--nb-ink); box-shadow: 0 0 0 4px color-mix(in srgb, var(--nb-ink) 14%, transparent); }

/* ---- hero: paper-ruled background + product mockup ---- */
.nb-hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--nb-border); background:
  repeating-linear-gradient(var(--nb-bg), var(--nb-bg) 37px, color-mix(in srgb, var(--nb-ink) 8%, transparent) 37px, color-mix(in srgb, var(--nb-ink) 8%, transparent) 38px); }
.nb-hero .container { padding-block: clamp(56px, 10vw, 108px); }
.nb-hero-grid { display: grid; grid-template-columns: minmax(0,1.02fr) minmax(300px,.98fr); gap: clamp(36px, 6vw, 76px); align-items: center; }
@media (max-width: 900px) { .nb-hero-grid { grid-template-columns: 1fr; } }
.nb-hero h1 { font-family: var(--nb-serif); font-size: clamp(36px, 6.6vw, 64px); line-height: 1.05; letter-spacing: -.02em; max-width: 15ch; margin-top: 16px; font-weight: 600; }
.nb-hero h1 em { font-style: italic; color: var(--nb-ink); }
.nb-lede { font-family: var(--nb-serif); font-size: clamp(17px, 2.2vw, 22px); color: var(--nb-muted); max-width: 46ch; margin-top: 20px; line-height: 1.5; }
.nb-hero .cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }

/* phone mockup (honest CSS illustration, clearly stylized) */
.nb-mock { display: grid; place-items: center; position: relative; }
/* soft ink glow pooled behind the device, so the hero has depth (glow sits behind, never over text) */
.nb-mock::before {
  content: ""; position: absolute; z-index: 0; width: 78%; height: 74%; left: 50%; top: 46%; transform: translate(-50%, -50%);
  background: radial-gradient(closest-side, color-mix(in srgb, var(--nb-ink) 24%, transparent), transparent 78%);
  filter: blur(10px); pointer-events: none;
}
.nb-phone { position: relative; z-index: 1; width: min(100%, 320px); background: #12131b; border: 1px solid rgba(255,255,255,.1); border-radius: 34px; box-shadow: var(--nb-shadow-lg), 0 0 0 1px color-mix(in srgb, var(--nb-ink) 22%, transparent); padding: 14px; }
.nb-phone .screen { border-radius: 24px; background: linear-gradient(180deg, #fffdf6, #f3ecdd); color: #201a12; padding: 18px; min-height: 440px; position: relative; overflow: hidden; }
.nb-phone .screen::before { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(transparent, transparent 30px, rgba(43,70,200,.12) 31px); }
.nb-phone .screen > * { position: relative; z-index: 1; }
.nb-phone .bar { display: flex; justify-content: space-between; font-size: 12px; font-weight: 700; color: #6b6353; }
.nb-phone .note { margin-top: 22px; padding: 16px; border-radius: 16px; background: rgba(255,255,255,.7); border: 1px solid rgba(43,70,200,.16); }
.nb-phone .note .note-t { font-family: var(--nb-serif); font-size: 22px; margin: 0; color: #201a12; }
.nb-phone .note p { color: #5f564a; margin: 8px 0 0; font-size: 13.5px; }
.nb-phone .note .note-t { margin: 0; }
.nb-phone .search { margin-top: 16px; padding: 11px 14px; border-radius: 999px; background: #fff; border: 1px solid rgba(43,70,200,.2); display: flex; gap: 10px; align-items: center; color: #38489c; font-weight: 600; font-size: 13.5px; }
.nb-ink-lines { margin-top: 18px; display: grid; gap: 12px; }
.nb-ink-line { height: 10px; border-radius: 999px; background: var(--nb-fill); opacity: .85; transform-origin: left; }
.nb-ink-line.long { width: 86%; } .nb-ink-line.mid { width: 70%; } .nb-ink-line.short { width: 48%; }
@media (prefers-reduced-motion: no-preference) {
  .nb-phone.float { animation: nb-float 8s ease-in-out infinite; }
  .nb-ink-line { animation: nb-draw 1.3s ease both; }
  .nb-ink-line.mid { animation-delay: .12s; } .nb-ink-line.short { animation-delay: .24s; }
}
@keyframes nb-draw { from { transform: scaleX(0); opacity: 0; } to { transform: scaleX(1); opacity: .85; } }
@keyframes nb-float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

/* ---- section heading ---- */
.nb-h2 { font-family: var(--nb-serif); font-size: clamp(26px, 3.8vw, 38px); letter-spacing: -.01em; margin-top: 10px; font-weight: 600; }
.nb-sub { color: var(--nb-muted); max-width: 56ch; margin-top: 12px; }

/* ---- feature grid ---- */
.nb-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; margin-top: 34px; }
.nb-feature { position: relative; background: var(--nb-surface); border: 1px solid var(--nb-border); border-radius: var(--nb-radius); padding: 26px; box-shadow: var(--nb-shadow); transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease; }
.nb-feature .nib { transition: box-shadow .2s ease; }
@media (prefers-reduced-motion: no-preference) {
  .nb-feature.lift:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--nb-ink) 40%, var(--nb-border)); box-shadow: var(--nb-shadow), 0 14px 34px color-mix(in srgb, var(--nb-ink) 15%, transparent); }
  .nb-feature.lift:hover .nib { box-shadow: 0 0 0 5px color-mix(in srgb, var(--nb-ink) 14%, transparent); }
}
.nb-feature .nib { width: 26px; height: 26px; border-radius: 50% 50% 50% 2px; background: var(--nb-ink-soft); border: 1.5px solid var(--nb-ink); transform: rotate(-14deg); }
.nb-feature .step { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50% 50% 50% 6px; background: var(--nb-ink-soft); border: 1.5px solid var(--nb-ink); color: var(--nb-ink); font-family: var(--nb-serif); font-weight: 700; font-size: 16px; transform: rotate(-8deg); }
.nb-feature h3 { font-family: var(--nb-serif); font-size: 20px; margin: 14px 0 8px; font-weight: 600; }
.nb-feature p { color: var(--nb-muted); font-size: 15px; }

/* ---- product split (copy + notebook mockup) ---- */
.nb-split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 5vw, 60px); align-items: center; border: 1px solid var(--nb-border); border-radius: 22px; background: var(--nb-surface); box-shadow: var(--nb-shadow-lg); overflow: hidden; margin-top: 34px; }
.nb-split-copy { padding: clamp(26px, 4vw, 44px); }
.nb-split-copy p { color: var(--nb-muted); margin-top: 12px; max-width: 52ch; }
.nb-split-visual { align-self: stretch; padding: clamp(28px, 4vw, 46px); display: grid; place-items: center;
  background: repeating-linear-gradient(color-mix(in srgb, var(--nb-ink-soft) 55%, var(--nb-surface)), color-mix(in srgb, var(--nb-ink-soft) 55%, var(--nb-surface)) 31px, color-mix(in srgb, var(--nb-ink) 18%, transparent) 32px); }
@media (max-width: 820px) { .nb-split { grid-template-columns: 1fr; } .nb-split-visual { order: -1; } }

/* notebook mockup */
.nb-book { width: min(100%, 340px); aspect-ratio: 4 / 5; background: var(--nb-surface); border: 1px solid var(--nb-border); border-radius: 18px; box-shadow: var(--nb-shadow-lg); padding: 26px; position: relative; overflow: hidden; transition: transform .18s ease, box-shadow .18s ease; }
.nb-book::before { content: ""; position: absolute; left: 46px; top: 0; bottom: 0; width: 2px; background: color-mix(in srgb, var(--nb-red) 60%, transparent); }
.nb-book::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(transparent, transparent 31px, color-mix(in srgb, var(--nb-ink) 13%, transparent) 32px); }
.nb-book .title { position: relative; z-index: 1; font-family: var(--nb-serif); font-size: 24px; color: var(--nb-text); padding-left: 12px; }
.nb-book .nb-ink-lines { position: relative; z-index: 1; margin-top: 30px; padding-left: 12px; }
@media (prefers-reduced-motion: no-preference) {
  .nb-split-visual:hover .nb-book { transform: translateY(-4px) rotate(-.6deg); box-shadow: var(--nb-shadow-lg), 0 16px 40px color-mix(in srgb, var(--nb-ink) 20%, transparent); }
}

/* ---- status list ---- */
.nb-status { display: grid; gap: 0; border-top: 1px solid var(--nb-border); margin-top: 22px; }
.nb-status > div { display: grid; grid-template-columns: 160px 1fr; gap: 24px; padding: 18px 0; border-bottom: 1px solid var(--nb-border); }
.nb-status dt { font-size: 13px; letter-spacing: .04em; text-transform: uppercase; color: var(--nb-ink); font-weight: 600; }
.nb-status dd { margin: 0; color: var(--nb-muted); font-size: 15px; }
@media (max-width: 560px) { .nb-status > div { grid-template-columns: 1fr; gap: 6px; } }

/* ---- FAQ ---- */
.nb-faq { margin-top: 22px; border-top: 1px solid var(--nb-border); }
.nb-faq details { border-bottom: 1px solid var(--nb-border); padding: 18px 0; }
.nb-faq summary { font-family: var(--nb-serif); font-size: 17px; font-weight: 600; cursor: pointer; list-style: none; position: relative; padding-right: 28px; }
.nb-faq summary::-webkit-details-marker { display: none; }
.nb-faq summary::after { content: "+"; position: absolute; right: 0; top: 0; color: var(--nb-ink); font-size: 20px; line-height: 1; transition: transform .15s ease; }
.nb-faq details[open] summary::after { content: "\2212"; }
.nb-faq summary:focus-visible { outline: 2px solid var(--nb-ink); outline-offset: 4px; border-radius: 2px; }
.nb-faq details p { color: var(--nb-muted); font-size: 15px; margin-top: 10px; max-width: 68ch; }

/* ---- CTA band ---- */
.nb-band { position: relative; background: var(--nb-fill); color: #fff; border-radius: var(--nb-radius); padding: clamp(28px,5vw,48px); text-align: center; overflow: hidden; box-shadow: var(--nb-shadow-lg), 0 0 46px color-mix(in srgb, var(--nb-fill) 30%, transparent); }
.nb-band h2 { font-family: var(--nb-serif); font-size: clamp(24px,3.4vw,32px); font-weight: 600; }
.nb-band p { color: rgba(255,255,255,.9); margin-top: 10px; }
.nb-band .nb-btn-primary { background: #fff; color: var(--nb-fill); border-color: #fff; margin-top: 22px; }
/* The default ring would use currentColor (--nb-fill), which is the exact color of the band's own
   background (1:1 contrast, effectively invisible). White reads 7.47:1 against --nb-fill. The
   box-shadow adds a soft halo behind the ring for extra separation on the saturated fill. */
.nb-band .nb-btn-primary:focus-visible { outline-color: #fff; outline-offset: 4px; box-shadow: 0 0 0 8px rgba(255,255,255,.22); }
.nb-band::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.12), transparent); transform: translateX(-100%); }
@media (prefers-reduced-motion: no-preference) { .nb-band::after { animation: nb-scan 7s ease-in-out infinite; } }
@keyframes nb-scan { 0%,45% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }

/* ---- footer ---- */
.nb-footer { border-top: 1px solid var(--nb-border); background: var(--nb-surface); margin-top: auto; }
.nb-footer .container { padding-block: 40px; display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; align-items: center; }
.nb-footer .fnav { display: flex; gap: 20px; flex-wrap: wrap; font-size: 14px; }
.nb-footer a { color: var(--nb-muted); text-decoration: none; }
.nb-footer a:hover { color: var(--nb-ink); }
.nb-footer small { color: var(--nb-muted); font-size: 13px; }

/* ---- entrance stagger: cards in a grid reveal in sequence.
   Only ever applies to motion-welcome visitors (the .js-anim hook is added by the first-party
   script solely when prefers-reduced-motion is not set), so reduced-motion users are unaffected. */
@media (prefers-reduced-motion: no-preference) {
  .js-anim .nb-grid > .reveal:nth-child(2) { transition-delay: .07s; }
  .js-anim .nb-grid > .reveal:nth-child(3) { transition-delay: .14s; }
  .js-anim .nb-grid > .reveal:nth-child(4) { transition-delay: .21s; }
  .js-anim .nb-grid > .reveal:nth-child(5) { transition-delay: .28s; }
}
