/* IPEKAI design system
   Paper-grid background, DM Sans + DM Mono, an Instrument Serif italic accent
   with a pixel edge, white glass cards, and a dock for navigation.
   Shared by the home page and every IPEKAI page (product pages, guides). */

:root {
  --bg: #f7f7f5;
  --bg-edge: #e4e4e0;
  --grid: rgba(30, 26, 21, .05);
  --ink: #1e1a15;
  --label: #2d2d2d;
  --text: #404040;
  --grey: #666;
  --grey-2: #6e6e6e;
  --subtle: #8a8a84;
  --line: #e9e9e9;
  --line-soft: #f0f0ee;
  --surface: #fff;
  --glass: rgba(255, 255, 255, .75);
  --accent: #0066cc;
  --link: #3b6db3;
  --select: #0081f2;
  --amber: #ffbf00;
  --green: #22c55e;
  --font-sans: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "DM Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --font-serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --font-ui: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Segoe UI", Arial, sans-serif;
  --radius: 16px;
  --shadow-card: 0 1px 8px rgba(0, 0, 0, .05);
  --shadow-lift: 0 18px 40px rgba(30, 26, 21, .10), 0 2px 8px rgba(30, 26, 21, .05);
  --ease-out: cubic-bezier(.2, .8, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 17px/1.6 var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
/* the amber hairline across the top of every page */
body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto 0;
  height: 2px;
  background: var(--amber);
  z-index: 100;
  pointer-events: none;
}
/* film grain, under the content */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .55;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.12  0 0 0 0 0.1  0 0 0 0 0.08  0 0 0 .07 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
::selection { background: #ffe38a; color: var(--ink); }
img { max-width: 100%; height: auto; }
a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ---------- paper grid backdrop (home) ---------- */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 72% at 50% 46%, var(--bg) 0%, var(--bg) 42%, rgba(247, 247, 245, 0) 100%),
    var(--bg-edge);
}
.backdrop::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, var(--grid) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px;
  background-position: -1px -1px;
}

/* ---------- serif accent ---------- */
.serif { font-family: var(--font-serif); font-style: italic; font-weight: 400; }
/* the pixel edge: applied through the inline SVG filter #pixelate */
.px { filter: url("#pixelate"); }

/* ---------- header ---------- */
.site-head {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px clamp(18px, 3.5vw, 50px);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--label);
  text-decoration: none;
}
.brand-mark { width: 36px; height: 36px; flex: none; transition: transform .5s var(--ease-out); }
.brand:hover .brand-mark { transform: rotate(90deg); }
.brand-name {
  font: 500 15px/1 var(--font-mono);
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--ink);
  white-space: nowrap;
}
.brand-name span { color: var(--grey-2); font-weight: 400; }
.head-links { display: flex; gap: clamp(14px, 2vw, 26px); }
.head-links a {
  font: 400 14px/1 var(--font-mono);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--grey);
  text-decoration: none;
  padding: 6px 0;
  transition: color .2s;
}
.head-links a:hover, .head-links a[aria-current] { color: var(--ink); }
.head-links a[aria-current] { text-decoration: underline; text-decoration-color: var(--amber); text-decoration-thickness: 2px; text-underline-offset: 7px; }

/* ---------- pills ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .9);
  border: 1px solid rgba(30, 26, 21, .07);
  font: 400 13px/1.2 var(--font-mono);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--label);
  white-space: nowrap;
}
.pill i {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--select);
  box-shadow: 0 0 0 3px rgba(0, 129, 242, .16);
  flex: none;
}
.pill--soon i { background: var(--amber); box-shadow: 0 0 0 3px rgba(255, 191, 0, .22); }
.pill--past i { background: #b4b4ae; box-shadow: 0 0 0 3px rgba(0, 0, 0, .06); }
.pill--ok i { background: var(--green); box-shadow: 0 0 0 3px rgba(34, 197, 94, .18); }

/* ---------- note card (".txt") ---------- */
.note {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 22px 16px;
}
.note + .note { margin-top: 8px; }
.note-name {
  margin: 0 0 6px;
  font: 400 12px/1.4 var(--font-mono);
  letter-spacing: .04em;
  color: var(--grey);
}
.note p:last-child { margin-bottom: 0; }

/* ---------- dock ---------- */
.dock {
  position: fixed;
  left: 50%;
  bottom: max(28px, calc(env(safe-area-inset-bottom) + 12px));
  transform: translateX(-50%);
  z-index: 60;
  display: flex;
  align-items: flex-end;
  gap: 4px;
  padding: 9px 10px 8px;
  background: rgba(255, 255, 255, .72);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
  backdrop-filter: blur(20px) saturate(1.6);
  border: 1px solid rgba(255, 255, 255, .95);
  border-radius: 22px;
  box-shadow: 0 14px 34px rgba(30, 26, 21, .11), 0 2px 6px rgba(30, 26, 21, .06), inset 0 1px 0 #fff;
}
.dock-item {
  appearance: none;
  border: 0;
  background: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  width: 66px;
  padding: 0;
  cursor: pointer;
  text-decoration: none;
  color: #1d1d1f;
  font: 400 13px/1 var(--font-ui);
  -webkit-tap-highlight-color: transparent;
}
.dock-icon {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  transition: transform .28s cubic-bezier(.3, .7, .4, 1.5);
  transform-origin: 50% 100%;
}
.dock-icon svg { width: 100%; height: 100%; overflow: visible; }
.dock-item:hover .dock-icon { transform: translateY(-5px) scale(1.1); }
.dock-item:active .dock-icon { transform: translateY(-1px) scale(.96); }
.dock-label { padding: 2px 6px 3px; border-radius: 5px; line-height: 1.1; white-space: nowrap; }
.dock-item[aria-current] .dock-label { background: var(--select); color: #fff; }
/* the folder opens while its panel is showing */
.folder-flap { transform-origin: 50% 100%; transition: transform .35s var(--ease-out); }
.dock-item[aria-current] .folder-flap, .dock-item:hover .folder-flap { transform: skewX(-8deg) scaleY(.9); }

/* ---------- corner notes ---------- */
.corner {
  position: fixed;
  bottom: 22px;
  z-index: 40;
  margin: 0;
  font: 400 11px/1 var(--font-mono);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--subtle);
}
.corner--l { left: 24px; }
.corner--r { right: 24px; }

/* =====================================================================
   Long-form pages (product pages, guides)
   ===================================================================== */
.doc-page { padding-bottom: 150px; }
.doc-side {
  position: fixed;
  left: 40px;
  top: 50%;
  transform: translateY(-50%);
  width: calc((100vw - 760px) / 2 - 64px);
  max-width: 280px;
  z-index: 20;
  display: none;
}
.back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 16px 0 11px;
  border: 1px solid #77776f;
  border-radius: 999px;
  font: 400 14px/1 var(--font-mono);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--label);
  text-decoration: none;
  transition: background .2s, color .2s, border-color .2s;
}
.back svg { width: 14px; height: 14px; }
.back:hover { background: var(--ink); border-color: var(--ink); color: #fff; }
.toc { margin: 30px 0 0; padding: 0; list-style: none; max-height: calc(100vh - 260px); overflow: auto; scrollbar-width: none; }
.toc li { margin: 0 0 13px; }
.toc a {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font: 400 12px/1.45 var(--font-mono);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--grey-2);
  text-decoration: none;
  transition: color .2s;
}
.toc a:hover { color: var(--ink); }
.toc a.is-active { color: var(--accent); }
@media (min-width: 1180px) { .doc-side { display: block; } }

.page {
  position: relative;
  max-width: 712px;
  margin: 0 auto;
  padding: 124px 24px 40px;
  counter-reset: sec;
}
.crumbs {
  margin: 0 0 22px;
  font: 400 12px/1.6 var(--font-mono);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--grey-2);
}
.page .crumbs a { color: var(--grey-2); text-decoration: none; }
.page .crumbs a:hover { color: var(--ink); }

.page h1 {
  margin: 0 0 28px;
  font: 400 italic clamp(40px, 5.4vw, 62px)/1.04 var(--font-serif);
  letter-spacing: -.012em;
  color: var(--ink);
  text-wrap: balance;
}
.page h2 {
  margin: 84px 0 18px;
  font: 500 clamp(24px, 2.4vw, 31px)/1.22 var(--font-sans);
  letter-spacing: -.018em;
  color: var(--ink);
  text-wrap: balance;
  counter-increment: sec;
  scroll-margin-top: 40px;
}
.page h2::before {
  content: counter(sec, decimal-leading-zero);
  display: block;
  margin-bottom: 14px;
  font: 500 13px/1 var(--font-mono);
  letter-spacing: .16em;
  color: var(--accent);
}
.page h3 {
  margin: 40px 0 10px;
  font: 600 19px/1.35 var(--font-sans);
  letter-spacing: -.01em;
  color: var(--ink);
  scroll-margin-top: 40px;
}
.page p, .page li, .page td { color: var(--text); }
.page p { margin: 0 0 18px; }
.page strong { color: var(--ink); font-weight: 600; }
.page em { color: inherit; }
.page a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: rgba(30, 26, 21, .28);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color .2s, text-decoration-color .2s;
}
.page a:hover { color: var(--accent); text-decoration-color: currentColor; }

/* lists sit in white cards, one row per item */
.page ul, .page ol {
  list-style: none;
  margin: 22px 0 30px;
  padding: 4px 26px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.page li { position: relative; margin: 0; padding: 15px 0 15px 26px; }
.page li + li { border-top: 1px solid var(--line-soft); }
.page ul > li::before {
  content: "";
  position: absolute;
  left: 3px;
  top: calc(15px + .8em - 3px);
  width: 6px;
  height: 6px;
  border-radius: 1px;
  background: var(--accent);
}
.page ol { counter-reset: li; }
.page ol > li { counter-increment: li; padding-left: 40px; }
.page ol > li::before {
  content: counter(li, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 15px;
  font: 500 13px/1.85 var(--font-mono);
  letter-spacing: .06em;
  color: var(--accent);
}
.page li ul, .page li ol { margin: 8px 0 0; padding: 0; background: none; border: 0; border-radius: 0; }
.page li li { padding-top: 8px; padding-bottom: 8px; }

/* tables */
.table-wrap { overflow-x: auto; margin: 22px 0 30px; }
.page table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  font-size: 15px;
  line-height: 1.55;
}
.table-wrap table { margin: 0; }
.page th {
  padding: 13px 16px;
  text-align: left;
  vertical-align: bottom;
  background: #fafaf8;
  border-bottom: 1px solid var(--line);
  font: 500 12px/1.4 var(--font-mono);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--grey);
}
.page td { padding: 13px 16px; vertical-align: top; border-top: 1px solid var(--line-soft); }
.page tr:first-child td { border-top: 0; }
.page thead + tbody tr:first-child td { border-top: 0; }
td a, td code { overflow-wrap: anywhere; }
@media (max-width: 640px) {
  .table-wrap table, .table-wrap tbody, .table-wrap tr, .table-wrap td { display: block; width: auto; }
  .table-wrap table { background: none; border: 0; border-radius: 0; overflow: visible; }
  .table-wrap thead { display: none; }
  .table-wrap tr { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; margin: 0 0 10px; padding: 8px 16px; }
  .table-wrap td { border: 0; padding: 6px 0; }
  .table-wrap td[data-label]::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 2px;
    font: 500 11px/1.4 var(--font-mono);
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--grey-2);
  }
}

/* code */
.page code {
  font: 400 .86em/1.4 var(--font-mono);
  background: rgba(30, 26, 21, .06);
  color: var(--ink);
  padding: .12em .4em;
  border-radius: 6px;
  overflow-wrap: anywhere;
}
.page pre {
  margin: 22px 0 28px;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 15px;
}
.page pre code { background: none; padding: 0; word-break: break-all; }

.page blockquote {
  margin: 26px 0;
  padding: 2px 0 2px 22px;
  border-left: 2px solid var(--amber);
  font: 400 italic 22px/1.45 var(--font-serif);
  color: var(--ink);
}
.page hr { border: 0; border-top: 1px dashed rgba(30, 26, 21, .2); margin: 56px 0; }
.page figure { margin: 30px 0; }
.page figure img {
  display: block;
  border-radius: 12px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-card);
  background: var(--surface);
}
.page figcaption {
  margin-top: 10px;
  font: 400 12px/1.5 var(--font-mono);
  letter-spacing: .03em;
  color: var(--grey-2);
}

/* the dark pill button (install links) */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 46px;
  padding: 0 22px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff !important;
  text-decoration: none !important;
  font: 500 13px/1 var(--font-mono);
  letter-spacing: .14em;
  text-transform: uppercase;
  box-shadow: 0 6px 18px rgba(30, 26, 21, .18);
  transition: transform .2s var(--ease-out), box-shadow .2s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(30, 26, 21, .22); }

.site-foot {
  max-width: 664px;
  margin: 72px auto 0;
  padding: 28px 0 40px;
  border-top: 1px dashed rgba(30, 26, 21, .2);
  font: 400 12px/1.75 var(--font-mono);
  letter-spacing: .02em;
  color: var(--grey-2);
}
.site-foot p { margin: 0 0 8px; }
.site-foot a { color: var(--grey); text-underline-offset: 3px; text-decoration-color: rgba(30, 26, 21, .25); }
.site-foot a:hover { color: var(--ink); }

@media (max-width: 720px) {
  body { font-size: 16px; }
  .site-head { padding: 16px 18px; }
  .brand-mark { width: 30px; height: 30px; }
  .brand-name { font-size: 13px; letter-spacing: .18em; }
  .brand-name span { display: none; }
  .head-links { gap: 14px; }
  .head-links a { font-size: 12px; letter-spacing: .1em; }
  /* contact is in the dock on phones */
  .head-links a[href^="mailto:"] { display: none; }
  .page { padding: 100px 20px 32px; }
  .page h2 { margin-top: 64px; }
  .page ul, .page ol { padding: 2px 18px; }
  .page li { padding-left: 22px; }
  .page ol > li { padding-left: 34px; }
  .dock { bottom: max(14px, env(safe-area-inset-bottom)); }
  .corner { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* ---------- consistency pass ---------- */
/* light grid paper behind long pages too, like home and Services */
body.doc-page {
  background-image:
    linear-gradient(to right, rgba(30, 26, 21, .035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(30, 26, 21, .035) 1px, transparent 1px);
  background-size: 24px 24px;
  background-position: -1px -1px;
}
/* FAQ sections on product pages: one card, a divider per question */
.page #faq > h3, .page #faq > h3 + p {
  margin: 0;
  background: var(--surface);
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
}
.page #faq > h3 { padding: 20px 26px 6px; font-size: 17.5px; border-top: 1px solid var(--line-soft); scroll-margin-top: 40px; }
.page #faq > h3:first-of-type { margin-top: 26px; border-top: 1px solid var(--line); border-radius: var(--radius) var(--radius) 0 0; }
.page #faq > h3 + p { padding: 0 26px 20px; }
.page #faq > p:last-of-type { border-bottom: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius); margin-bottom: 30px; }
/* tables stacked on phones: the first cell is the row name, no repeated label */
@media (max-width: 640px) {
  .table-wrap td:first-child[data-label]::before { content: none; }
  .table-wrap td:first-child { font-weight: 600; color: var(--ink); }
  .site-foot { margin-left: 20px; margin-right: 20px; }
}
