/* Fillscribe shared styles — used by Onboarding, Settings, Filling */
:root{
  --paper:#faf9f6;
  --paper-2:#f2f1ee;
  --paper-3:#ebeae6;
  --ink:#0c1220;
  --ink-2:#3a485b;
  --ink-3:#737785;
  --ink-4:#a8abb5;
  --blue:#0040a1;
  --blue-2:#0056d2;
  --blue-tint:#e7edfa;
  --blue-tint-2:#d6e0f5;
  --accent:#c2410c;
  --accent-tint:#fbe8dc;
  --green:#22a06b;
  --red:#c23030;
  --line:#e3e2e0;
  --line-2:#d2d1cd;
  --radius: 10px;
  --radius-lg: 16px;
}

* { box-sizing: border-box; }
html, body { margin:0; padding:0; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--paper);
  color: var(--ink);
  font-size: 15px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, canvas, svg { max-width: 100%; }
.serif { font-family: 'Newsreader', Georgia, serif; font-weight: 400; letter-spacing: -0.01em; }
.mono { font-family: 'JetBrains Mono', ui-monospace, monospace; }
a { color: var(--blue-2); text-decoration: none; }
a:hover { color: var(--blue); }

/* NAV */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in oklab, var(--paper) 92%, transparent);
  backdrop-filter: blur(16px) saturate(1.1);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: 1360px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 28px;
}
.logo {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 16px; letter-spacing: -0.02em;
  color: var(--ink);
}
.logo-mark {
  width: 26px; height: 26px; border-radius: 6px;
  background: var(--ink); color: var(--paper);
  display: grid; place-items: center;
  font-family: 'Newsreader', serif; font-style: italic; font-weight: 500; font-size: 17px;
  line-height: 1;
}
.nav-links { display: flex; gap: 28px; font-size: 13.5px; }
.nav-links a { color: var(--ink-2); font-weight: 500; }
.nav-links a.current { color: var(--ink); }
.nav-links a:hover { color: var(--ink); }
.nav-right { display: flex; gap: 12px; align-items: center; }
.credits-badge {
  display: inline-flex; align-items: baseline; gap: 4px;
  padding: 6px 10px; border-radius: 999px;
  background: var(--paper-2); border: 1px solid var(--line);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; color: var(--ink-2);
}
.credits-badge b { color: var(--ink); font-weight: 600; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--blue-tint); color: var(--blue);
  display: grid; place-items: center;
  font-weight: 600; font-size: 12px;
}

/* BUTTONS */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 14px; border-radius: var(--radius);
  font-family: inherit; font-weight: 600; font-size: 13.5px;
  cursor: pointer; border: 1px solid transparent;
  transition: all 0.15s ease;
  text-decoration: none;
  white-space: nowrap;
}
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { color: var(--ink); background: var(--paper-2); }
.btn-primary { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn-primary:hover { background: var(--blue); border-color: var(--blue); color: white; }
.btn-secondary { background: var(--paper); color: var(--ink); border-color: var(--line-2); }
.btn-secondary:hover { border-color: var(--ink-3); }
.btn-accent { background: var(--blue); color: white; border-color: var(--blue); }
.btn-accent:hover { background: var(--blue-2); border-color: var(--blue-2); }
.btn-danger { background: white; color: var(--red); border-color: var(--line-2); }
.btn-danger:hover { background: #fef2f2; border-color: var(--red); }
.btn-lg { padding: 13px 22px; font-size: 14.5px; }
.btn-sm { padding: 6px 10px; font-size: 12px; }
.btn-block { width: 100%; }
.btn-arrow { transition: transform 0.2s ease; }
.btn:hover .btn-arrow { transform: translateX(3px); }

/* EYEBROW & TITLES */
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--blue); font-weight: 500;
  padding: 5px 10px; border-radius: 999px;
  background: var(--blue-tint);
}
.eyebrow-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--blue); }
.section-eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-3); font-weight: 500;
}

/* FORM CONTROLS */
.field-label {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-3); font-weight: 500;
  margin-bottom: 10px;
}
.field-help {
  font-size: 12.5px; color: var(--ink-3); margin: 6px 0 0;
  line-height: 1.45;
}
.input, .select, .textarea {
  width: 100%;
  padding: 10px 12px;
  font-family: inherit; font-size: 14px;
  background: white;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-tint);
}

/* SLIDER */
.slider-wrap { display: flex; flex-direction: column; gap: 8px; }
.slider-top { display: flex; justify-content: space-between; align-items: baseline; }
.slider-val {
  font-family: 'Newsreader', serif; font-weight: 500;
  font-size: 22px; letter-spacing: -0.015em; color: var(--ink);
  line-height: 1;
}
.slider-val .unit { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--ink-3); margin-left: 2px; letter-spacing: 0.05em; font-weight: 500; }
.slider-bounds { display: flex; justify-content: space-between; font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--ink-3); letter-spacing: 0.06em; }

input[type="range"].slider {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 4px;
  background: var(--line-2);
  border-radius: 999px;
  outline: none; margin: 0;
}
input[type="range"].slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--ink);
  border: 3px solid white;
  box-shadow: 0 0 0 1px var(--ink), 0 3px 8px rgba(12,18,32,0.2);
  cursor: grab;
  transition: transform 0.1s ease;
}
input[type="range"].slider::-webkit-slider-thumb:active { cursor: grabbing; transform: scale(1.1); }
input[type="range"].slider::-moz-range-thumb {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--ink);
  border: 3px solid white;
  box-shadow: 0 0 0 1px var(--ink);
  cursor: grab;
}

/* SWATCH / INK COLOR CHIPS */
.ink-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.ink-chip {
  aspect-ratio: 1;
  border-radius: 8px;
  border: 1.5px solid var(--line-2);
  background: white;
  cursor: pointer;
  position: relative;
  display: flex; flex-direction: column;
  padding: 8px 6px; gap: 4px;
  transition: transform 0.1s ease, border-color 0.15s ease;
}
.ink-chip:hover { transform: translateY(-1px); border-color: var(--ink-3); }
.ink-chip.active { border-color: var(--ink); box-shadow: 0 0 0 2px var(--ink); }
.ink-chip .ink-swatch {
  flex: 1; width: 100%;
  border-radius: 5px;
  background: var(--c, #1a3f8c);
}
.ink-chip .ink-name {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px; letter-spacing: 0.04em;
  color: var(--ink-3); text-transform: uppercase;
  text-align: center;
  line-height: 1.1;
}
.ink-chip.active .ink-name { color: var(--ink); font-weight: 600; }

/* STYLE THUMBNAILS */
.style-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.style-thumb {
  background: #fdfcf8;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  padding: 14px 12px 10px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  min-height: 86px;
  display: flex; flex-direction: column; justify-content: space-between;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.style-thumb::before {
  content:''; position: absolute; inset: 0;
  background-image: repeating-linear-gradient(transparent 0, transparent 16px, #e3e2e0 16px, #e3e2e0 17px);
  opacity: 0.35; pointer-events: none;
}
.style-thumb:hover { transform: translateY(-2px); border-color: var(--ink-3); }
.style-thumb.active { border-color: var(--ink); box-shadow: 0 0 0 2px var(--ink); }
.style-thumb .sample {
  color: #1a3f8c;
  line-height: 1.1;
  position: relative; z-index: 1;
  word-wrap: break-word;
}
.style-thumb .sample.sample-img {
  display: block;
  min-height: 44px;
}
.style-thumb .sample.sample-img img {
  display: block;
  width: 100%;
  height: 46px;
  object-fit: contain;
  object-position: left center;
  mix-blend-mode: multiply;
}
.style-thumb .meta {
  position: relative; z-index: 1;
  display: flex; justify-content: space-between; align-items: baseline;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px; letter-spacing: 0.08em;
  color: var(--ink-3); text-transform: uppercase;
  padding-top: 6px;
  border-top: 1px dashed var(--line-2);
}
.style-thumb.active .meta .num { color: var(--ink); font-weight: 600; }
.style-thumb .num { font-weight: 500; }

.hand-01 { font-family: 'Caveat', cursive; font-weight: 400; font-size: 20px; }
.hand-02 { font-family: 'Caveat', cursive; font-weight: 600; font-size: 19px; }
.hand-03 { font-family: 'Shadows Into Light', cursive; font-size: 17px; letter-spacing: 0.02em; }
.hand-04 { font-family: 'Kalam', cursive; font-weight: 300; font-size: 16px; }
.hand-05 { font-family: 'Kalam', cursive; font-weight: 400; font-size: 16px; }
.hand-06 { font-family: 'Caveat', cursive; font-weight: 500; font-size: 21px; color: #1a3f8c; }
.hand-07 { font-family: 'Patrick Hand', cursive; font-size: 17px; }
.hand-08 { font-family: 'Kalam', cursive; font-weight: 400; font-style: italic; font-size: 16px; transform: skewX(-5deg); transform-origin: left; display: inline-block; }
.hand-09 { font-family: 'Gloria Hallelujah', cursive; font-size: 15px; }
.hand-10 { font-family: 'Indie Flower', cursive; font-size: 17px; }
.hand-11 { font-family: 'Homemade Apple', cursive; font-size: 12px; line-height: 1.3; color: #0c1220; }
.hand-12 { font-family: 'Reenie Beanie', cursive; font-size: 22px; }

/* CARD */
.card {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px;
}
.card-title {
  font-family: 'Newsreader', serif;
  font-size: 24px; font-weight: 500;
  letter-spacing: -0.015em;
  margin: 0 0 4px;
}
.card-sub { font-size: 13.5px; color: var(--ink-3); margin: 0 0 20px; }
.card-divider { height: 1px; background: var(--line); margin: 24px -28px; }

/* TOGGLE */
.toggle {
  position: relative;
  width: 40px; height: 22px;
  background: var(--line-2);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease;
  flex-shrink: 0;
}
.toggle::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 18px; height: 18px; border-radius: 50%;
  background: white; box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: transform 0.2s ease;
}
.toggle.on { background: var(--ink); }
.toggle.on::after { transform: translateX(18px); }

/* TWEAKS panel */
.tweaks {
  position: fixed; bottom: 20px; right: 20px; z-index: 100;
  background: var(--paper);
  border: 1px solid var(--line-2);
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 20px 40px -12px rgba(12,18,32,0.18);
  display: none; min-width: 220px; font-size: 13px;
}
.tweaks.open { display: block; }
.tweaks-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-3); margin-bottom: 10px;
}
.tweak-row { display: flex; gap: 8px; margin-bottom: 8px; }
.tweak-row:last-child { margin-bottom: 0; }
.tweak-opt {
  flex: 1; padding: 8px 10px;
  border: 1px solid var(--line-2);
  background: white; border-radius: 8px;
  cursor: pointer; font-family: inherit; font-size: 12px;
  color: var(--ink-2); text-align: center;
  transition: all 0.15s ease;
}
.tweak-opt:hover { border-color: var(--ink-3); }
.tweak-opt.active { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.tweak-label { font-weight: 500; font-size: 11px; color: var(--ink-2); margin-bottom: 6px; display: block; }

@media (max-width: 900px) {
  .nav-inner {
    padding: 12px 18px;
    gap: 12px;
    flex-wrap: wrap;
  }
  .nav-links {
    order: 3;
    width: 100%;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
  }
  .nav-links::-webkit-scrollbar { display: none; }
  .nav-right { margin-left: auto; }
  .ink-grid { grid-template-columns: repeat(4, 1fr); }
  .style-grid { grid-template-columns: repeat(2, 1fr); }
  .card { padding: 22px 18px; }
  .card-divider { margin: 20px -18px; }
}

@media (max-width: 640px) {
  body { font-size: 14px; }
  .nav-inner { padding: 10px 14px; }
  .logo { font-size: 15px; gap: 8px; }
  .logo-mark { width: 24px; height: 24px; font-size: 15px; }
  .nav-links { gap: 12px; font-size: 12.5px; }
  .nav-right { gap: 8px; }
  .credits-badge { display: none; }
  .btn {
    padding: 9px 12px;
    font-size: 13px;
  }
  .btn-lg {
    padding: 12px 16px;
    font-size: 13.5px;
  }
  .ink-grid { grid-template-columns: repeat(3, 1fr); }
  .style-grid { gap: 8px; }
  .style-thumb { min-height: 78px; padding: 12px 10px 8px; }
  .tweaks { display: none !important; }
}
