/* ============================================================
   hrdai · design system
   野生独立开发者 · 笔记本 · 贴纸 · 涂鸦
   ============================================================ */

/* 自托管拉丁字体（国内友好）。中文(Noto Serif SC / LXGW WenKai / Ma Shan Zheng / Long Cang)暂走系统衬线/楷体回退，后续以 subset woff2 补上。 */
@font-face{font-family:'JetBrains Mono';font-weight:400;font-display:swap;src:url('fonts/jetbrains-mono-400.woff2') format('woff2');}
@font-face{font-family:'JetBrains Mono';font-weight:500;font-display:swap;src:url('fonts/jetbrains-mono-500.woff2') format('woff2');}
@font-face{font-family:'JetBrains Mono';font-weight:600;font-display:swap;src:url('fonts/jetbrains-mono-600.woff2') format('woff2');}
@font-face{font-family:'JetBrains Mono';font-weight:700;font-display:swap;src:url('fonts/jetbrains-mono-600.woff2') format('woff2');}
@font-face{font-family:'Caveat';font-weight:400;font-display:swap;src:url('fonts/caveat-400.woff2') format('woff2');}
@font-face{font-family:'Caveat';font-weight:600;font-display:swap;src:url('fonts/caveat-600.woff2') format('woff2');}
@font-face{font-family:'Caveat';font-weight:700;font-display:swap;src:url('fonts/caveat-700.woff2') format('woff2');}

:root {
  /* paper */
  --paper:        #f4f0e6;
  --paper-deep:   #ebe5d3;
  --paper-edge:   #d8d0bb;
  --paper-shadow: rgba(60,45,20,0.10);

  /* ink */
  --ink:          #1a1815;
  --ink-soft:     #4a4540;
  --ink-faint:    #908a82;
  --ink-ghost:    #c2bdb4;

  /* signature blue */
  --blue:         #2240ff;
  --blue-soft:    #d6dcff;

  /* utility colors (highlighter / red pen / pencil) */
  --hl-yellow:    #ffea3a;
  --red-pen:      #d23a2a;
  --pencil:       #6b6357;
  --rule:         rgba(26,24,21,0.16);

  /* type */
  --serif-cn: 'Noto Serif SC', 'Songti SC', serif;
  --hand-cn:  'Ma Shan Zheng', 'LXGW WenKai TC', cursive;
  --kai-cn:   'LXGW WenKai TC', 'Kaiti SC', serif;
  --mono:     'JetBrains Mono', ui-monospace, monospace;
  --hand-en:  'Caveat', 'Kalam', cursive;

  /* layout */
  --col-w:    1120px;
  --pad-x:    clamp(20px, 4vw, 56px);
}

/* base reset */
*,*::before,*::after { box-sizing: border-box; }
html, body { margin:0; padding:0; }
body {
  font-family: var(--serif-cn);
  color: var(--ink);
  background: var(--paper);
  font-size: 17px;
  line-height: 1.7;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "palt";
  /* paper texture: dot grid + faint noise */
  background-image:
    radial-gradient(circle at 50% 50%, rgba(60,45,20,0.045) 0.6px, transparent 0.7px),
    radial-gradient(circle at 50% 50%, rgba(255,255,255,0.7) 0.4px, transparent 0.5px);
  background-size: 22px 22px, 22px 22px;
  background-position: 0 0, 11px 11px;
  min-height: 100vh;
}
img, svg { display:block; max-width:100%; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
button { font: inherit; cursor: pointer; }

/* ============================================================
   layout
   ============================================================ */
.wrap {
  max-width: var(--col-w);
  margin: 0 auto;
  padding: 0 var(--pad-x);
}
.wrap-wide { max-width: 1280px; margin: 0 auto; padding: 0 var(--pad-x); }

section { padding: clamp(56px, 8vw, 112px) 0; position: relative; }

/* ============================================================
   typography
   ============================================================ */
.serif { font-family: var(--serif-cn); }
.kai   { font-family: var(--kai-cn); }
.hand  { font-family: var(--hand-cn); font-weight: 400; }
.mono  { font-family: var(--mono); letter-spacing: -0.01em; }
.hand-en { font-family: var(--hand-en); }

.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.eyebrow .dot {
  display:inline-block; width:6px; height:6px; border-radius:50%;
  background: var(--accent, var(--blue));
  margin-right: 8px; vertical-align: 2px;
}

h1, h2, h3, h4 { font-family: var(--serif-cn); font-weight: 700; letter-spacing: -0.005em; margin: 0; line-height: 1.18; text-wrap: pretty;}
h1 { font-size: clamp(44px, 6vw, 84px); font-weight: 900; }
h2 { font-size: clamp(32px, 4vw, 52px); }
h3 { font-size: clamp(22px, 2vw, 28px); }
h4 { font-size: 18px; font-weight: 600; }

p { margin: 0 0 1em; max-width: 62ch; }

.lead { font-size: 21px; line-height: 1.6; color: var(--ink-soft); max-width: 56ch; }

mark.hl {
  background: linear-gradient(transparent 55%, var(--hl-yellow) 55% 92%, transparent 92%);
  padding: 0 0.1em; color: inherit;
}
.underline-wobble {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 6' preserveAspectRatio='none'><path d='M2 4 Q 30 1 60 3 T 120 3 T 198 4' stroke='%232240ff' stroke-width='2' fill='none' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 100% 6px;
  padding-bottom: 6px;
}
.circle-mark {
  position: relative; display: inline-block; padding: 0 .12em;
}
.circle-mark::after {
  content: ""; position: absolute; inset: -8% -10% -8% -10%;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 60'><ellipse cx='60' cy='30' rx='55' ry='24' stroke='%23d23a2a' stroke-width='2.2' fill='none' stroke-linecap='round' stroke-dasharray='2 0'/></svg>");
  background-repeat: no-repeat; background-size: 100% 100%;
  pointer-events: none; transform: rotate(-1.5deg);
}
.strike-pen {
  position: relative; text-decoration: none; color: var(--ink-faint);
}
.strike-pen::after {
  content:""; position: absolute; left: -2%; right: -2%; top: 52%;
  height: 2px; background: var(--red-pen); transform: rotate(-2deg);
}

/* ============================================================
   stickers / labels
   ============================================================ */
.sticker {
  display: inline-block;
  padding: 4px 10px;
  background: var(--accent, var(--blue));
  color: #fff;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transform: rotate(-2deg);
  box-shadow: 1px 2px 0 rgba(0,0,0,0.18);
  border-radius: 2px;
  white-space: nowrap;
}
.sticker.tape {
  background: #ffe27a; color: var(--ink);
  font-family: var(--hand-cn); font-size: 14px; letter-spacing: 0;
  text-transform: none;
  transform: rotate(-3deg);
  border-left: 1px dashed rgba(0,0,0,0.15);
  border-right: 1px dashed rgba(0,0,0,0.15);
}
.sticker.ink { background: var(--ink); color: var(--paper); }
.sticker.outline {
  background: transparent; color: var(--ink);
  border: 1.5px solid var(--ink); box-shadow: none;
}

/* mini chip */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--paper);
  font-family: var(--mono); font-size: 12px;
  color: var(--ink-soft);
}
.chip .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent, var(--blue)); }

/* ============================================================
   note card (notebook page)
   ============================================================ */
.card {
  background: var(--paper);
  border: 1.4px solid var(--ink);
  padding: 22px 24px;
  position: relative;
  box-shadow: 4px 4px 0 var(--ink);
}
.card-soft {
  background: var(--paper);
  border: 1px solid var(--rule);
  padding: 22px 24px;
  position: relative;
}
.tilt-l { transform: rotate(-1deg); }
.tilt-r { transform: rotate(1deg); }
.tilt-l2 { transform: rotate(-2.2deg); }
.tilt-r2 { transform: rotate(2.2deg); }

/* dashed ruled paper inside a card */
.ruled {
  background-image: repeating-linear-gradient(
    to bottom, transparent 0, transparent 28px, var(--rule) 28px, var(--rule) 29px
  );
}

/* ============================================================
   buttons
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 20px;
  background: var(--ink); color: var(--paper);
  border: 1.4px solid var(--ink);
  font-family: var(--mono); font-size: 14px; letter-spacing: 0.02em;
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform .12s ease, box-shadow .12s ease;
  text-decoration: none;
}
.btn:hover { transform: translate(-1px,-1px); box-shadow: 4px 4px 0 var(--ink); text-decoration: none; }
.btn:active { transform: translate(2px,2px); box-shadow: 0 0 0 var(--ink); }
.btn-ghost {
  background: transparent; color: var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
}
.btn-ghost:hover { background: var(--ink); color: var(--paper); }
.btn-accent { background: var(--accent, var(--blue)); border-color: var(--accent, var(--blue)); color:#fff; box-shadow: 3px 3px 0 var(--ink); }
.btn .arrow { display:inline-block; transition: transform .15s; }
.btn:hover .arrow { transform: translateX(3px); }

/* ============================================================
   site nav (shared)
   ============================================================ */
.site-nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px var(--pad-x);
  background: color-mix(in oklab, var(--paper) 88%, transparent);
  backdrop-filter: blur(6px);
  border-bottom: 1px dashed var(--rule);
}
.site-nav .brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--serif-cn); font-weight: 700; font-size: 18px;
  color: var(--ink); text-decoration: none;
}
.site-nav .brand svg { width: 28px; height: 28px; }
.site-nav .brand img.logo {
  width: 32px; height: 32px;
  object-fit: contain;
  flex: none;
}
.site-nav .brand .cn-sub {
  font-family: var(--serif-cn);
  font-size: 14px;
  color: var(--ink-faint);
  margin-left: 4px;
  font-weight: 400;
}
.site-nav .links { display: flex; gap: 22px; align-items: center; }
.site-nav .hamb {
  display: none;
  background: transparent; border: 1px solid var(--ink);
  width: 38px; height: 38px;
  align-items: center; justify-content: center;
  cursor: pointer; padding: 0;
}
.site-nav .hamb span {
  display: block; width: 16px; height: 1.5px; background: var(--ink); position: relative;
}
.site-nav .hamb span::before, .site-nav .hamb span::after {
  content: ""; position: absolute; left: 0; right: 0; height: 1.5px; background: var(--ink);
}
.site-nav .hamb span::before { top: -5px; }
.site-nav .hamb span::after  { top:  5px; }

@media (max-width: 720px) {
  .site-nav { padding: 10px var(--pad-x); }
  .site-nav .brand img.logo { width: 28px; height: 28px; }
  .site-nav .brand { font-size: 16px; gap: 8px;}
  .site-nav .brand .cn-sub { display: none; }
  .site-nav .hamb { display: inline-flex; }
  .site-nav .back { font-size: 11px; }
  .site-nav .links {
    display: none;
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch;
    background: var(--paper);
    border-bottom: 1px solid var(--rule);
    padding: 6px 0; gap: 0;
    box-shadow: 0 8px 14px rgba(0,0,0,0.08);
    z-index: 49;
  }
  .site-nav .links.open { display: flex; }
  .site-nav .links a {
    padding: 12px var(--pad-x);
    border-bottom: 1px dashed rgba(0,0,0,0.08);
    font-size: 14px;
  }
  .site-nav .links a:last-child { border-bottom: 0; }
}
.site-nav .links a {
  color: var(--ink-soft); font-family: var(--mono); font-size: 13px;
  text-decoration: none;
}
.site-nav .links a:hover { color: var(--ink); }
.site-nav .links a.active { color: var(--accent, var(--blue)); }
.site-nav .back {
  font-family: var(--mono); font-size: 12px; color: var(--ink-soft);
  display: inline-flex; align-items: center; gap: 6px;
}
.site-nav .back:hover { color: var(--ink); text-decoration: none; }

/* ============================================================
   footer
   ============================================================ */
.site-foot {
  border-top: 1px dashed var(--rule);
  padding: 36px var(--pad-x);
  display: flex; justify-content: space-between; align-items: end;
  font-family: var(--mono); font-size: 12px; color: var(--ink-faint);
  gap: 20px; flex-wrap: wrap;
  margin-top: 40px;
}
.site-foot a { color: var(--ink-soft); }
.site-foot .scrawl { font-family: var(--hand-cn); font-size: 18px; color: var(--ink-soft); }

/* ============================================================
   arrows + scribbles
   ============================================================ */
.arrow-doodle {
  position: absolute;
  pointer-events: none;
  font-family: var(--hand-en);
  color: var(--ink);
  font-size: 18px;
  line-height: 1.1;
}
.arrow-doodle svg { stroke: var(--ink); fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* ============================================================
   product card (used on hub)
   ============================================================ */
.product-card {
  display: block;
  background: var(--paper);
  border: 1.4px solid var(--ink);
  box-shadow: 5px 5px 0 var(--ink);
  padding: 0;
  position: relative;
  transition: transform .14s ease, box-shadow .14s ease;
  text-decoration: none;
  color: var(--ink);
  overflow: hidden;
}
.product-card:hover { transform: translate(-2px,-2px); box-shadow: 7px 7px 0 var(--ink); text-decoration: none; }
.product-card .pc-head {
  padding: 18px 20px 14px;
  border-bottom: 1px dashed var(--rule);
  display: flex; align-items: center; justify-content: space-between;
}
.product-card .pc-head .stamp {
  font-family: var(--mono); font-size: 10px; letter-spacing: .15em;
  color: var(--ink-faint); text-transform: uppercase;
}
.product-card .pc-body { padding: 18px 20px 22px; min-height: 160px; }
.product-card .pc-name { font-size: 28px; font-weight: 800; line-height: 1.1; margin: 6px 0 4px; }
.product-card .pc-en   { font-family: var(--mono); font-size: 12px; color: var(--ink-faint); letter-spacing: 0.1em; }
.product-card .pc-tag  { font-family: var(--hand-cn); font-size: 18px; color: var(--ink-soft); margin: 14px 0 10px; }
.product-card .pc-foot {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 20px; border-top: 1px dashed var(--rule);
  font-family: var(--mono); font-size: 12px;
  background: color-mix(in oklab, var(--paper-deep) 60%, var(--paper));
}
.product-card .pc-foot .accent { color: var(--accent); font-weight: 600; }

/* divider with handwritten note */
.divider-note {
  display: flex; align-items: center; gap: 14px;
  margin: 28px 0;
  font-family: var(--hand-cn); font-size: 18px; color: var(--ink-faint);
}
.divider-note::before, .divider-note::after {
  content: ""; flex: 1; height: 1px; background: var(--rule);
}

/* ============================================================
   key/value list (spec sheet)
   ============================================================ */
.spec dl { margin: 0; }
.spec dt { font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-faint); margin-top: 14px;}
.spec dd { margin: 4px 0 0; font-family: var(--serif-cn); }

/* selection */
::selection { background: var(--hl-yellow); color: var(--ink); }

/* utility */
.hide-sm { }
@media (max-width: 720px) {
  .hide-sm { display: none !important; }

  /* universal mobile cleanup for product pages built on system.css */
  body { font-size: 15px; }
  h1 { font-size: clamp(36px, 11vw, 52px) !important; line-height: 1.05;}
  h2 { font-size: clamp(26px, 7vw, 36px) !important; line-height: 1.15; }
  h3 { font-size: clamp(19px, 5vw, 24px) !important; }
  .lead { font-size: 17px; }
  .card, .card-soft { padding: 18px 18px; }

  .row { gap: 10px; }

  /* prevent runaway tables / wide grids */
  table { font-size: 13px; }
  table th, table td { padding: 8px 10px !important; }

  /* hero grids that were 2-col by default */
  [class*="hero-grid"] { grid-template-columns: 1fr !important; gap: 28px !important; }

  /* feature grids → 1 col */
  .feat-row, .feature-grid, .mode-catalog, .download-row, .gallery, .feat-grid {
    grid-template-columns: 1fr !important;
  }

  /* tilt-l/r/2: reduce on mobile to prevent overflow */
  .tilt-l, .tilt-l2 { transform: rotate(-0.5deg) !important; }
  .tilt-r, .tilt-r2 { transform: rotate(0.5deg) !important; }

  /* polaroid clamp */
  .polaroid .frame { width: 200px !important; height: 200px !important; }
}
@media (max-width: 540px) {
  /* even tighter mobile */
  section { padding: 48px 0 !important; }
}
.row { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; }
.stack { display: flex; flex-direction: column; gap: 16px; }

/* paper edge shadow (page) */
.page {
  position: relative;
}
.page::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 1;
  box-shadow: inset 0 0 120px rgba(60,45,20,0.10);
}
