/* ============================================================
   ByteX AI — Editorial Sketchbook
   Paper + ink, serif headlines, mono labels.
   ============================================================ */

:root {
  --paper:      #ede6df;
  --paper-deep: #e4dbd1;   /* alternating sections */
  --ink:        #1a1a1a;
  --ink-soft:   #4a463f;   /* body text, slightly warm */
  --ink-faint:  #8a8275;
  --accent:     #b5562f;   /* terracotta — used sparingly */
  --accent-deep:#8f3f1f;
  --line:       #cdc3b6;
  --card:       #f4efe9;

  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --mono:  "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --wrap: 68rem;
  --gap:  clamp(1.25rem, 4vw, 2.5rem);
}

/* ---------- reset-ish ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background-color: var(--paper);
  /* subtle paper grain via layered radial noise — no image needed */
  background-image:
    radial-gradient(circle at 20% 30%, rgba(0,0,0,.018) 0, transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(0,0,0,.015) 0, transparent 40%);
  color: var(--ink-soft);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }
a { color: inherit; }

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }

.visually-hidden, .skip-link:not(:focus) {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 1rem; top: 1rem; z-index: 100;
  background: var(--ink); color: var(--paper); padding: .6rem 1rem;
  border-radius: 4px; text-decoration: none;
}

/* ---------- typography ---------- */
h1, h2, h3 { font-family: var(--serif); color: var(--ink); line-height: 1.1;
  font-weight: 600; letter-spacing: -0.01em; margin: 0; }

.kicker, .section-no, .clients-label, .nav-toggle {
  font-family: var(--mono); text-transform: uppercase;
  letter-spacing: 0.12em; font-size: .72rem;
}

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(120%) blur(6px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s ease, background .3s ease;
}
.site-header.scrolled { border-bottom-color: var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between;
  padding-block: .85rem; gap: 1rem; }

.brand { display: inline-flex; align-items: center; gap: .6rem;
  text-decoration: none; color: var(--ink); }
.brand-mark { width: 40px; height: 40px; object-fit: contain;
  mix-blend-mode: multiply; }
.brand-name { font-family: var(--serif); font-weight: 600; font-size: 1.25rem;
  letter-spacing: -0.01em; }

.primary-nav { display: flex; align-items: center; gap: 1.6rem; }
.primary-nav a { text-decoration: none; color: var(--ink-soft); font-weight: 500;
  font-size: .98rem; position: relative; padding-block: .2rem; }
.primary-nav a:not(.nav-cta)::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: -2px; height: 1.5px;
  background: var(--accent); transition: right .25s ease;
}
.primary-nav a:not(.nav-cta):hover::after,
.primary-nav a:not(.nav-cta):focus-visible::after { right: 0; }
.primary-nav a.nav-cta { background: var(--ink); color: #fff; padding: .5rem 1rem;
  border-radius: 999px; }
.primary-nav a.nav-cta:hover { background: var(--accent-deep); color: #fff; }

/* hamburger (mobile) */
.nav-toggle { display: none; background: none; border: 0; cursor: pointer;
  width: 40px; height: 40px; padding: 8px; }
.nav-toggle-bar { display: block; height: 2px; background: var(--ink);
  margin: 5px 0; transition: transform .25s ease, opacity .25s ease; }

/* ---------- hero ---------- */
.hero { padding-block: clamp(3.5rem, 9vw, 6.5rem) clamp(2.5rem, 7vw, 4.5rem); }
.kicker { color: var(--accent); display: inline-block; margin-bottom: 1.4rem; }
.hero-heading {
  font-size: clamp(2.6rem, 7vw, 5rem); font-weight: 600;
  max-width: 16ch; margin-bottom: 1.6rem;
}
.hero-sub { font-size: clamp(1.05rem, 2vw, 1.3rem); max-width: 46ch;
  color: var(--ink-soft); margin-bottom: 2.2rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 1rem; }

/* hand-drawn underline */
.ink-underline { position: relative; white-space: nowrap; }
.ink-underline::after {
  content: ""; position: absolute; left: -2%; right: -2%; bottom: -.12em;
  height: .42em;
  background: no-repeat center/100% 100%
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 20'%3E%3Cpath d='M3 13 C 60 5, 110 17, 160 9 S 250 4, 297 11' fill='none' stroke='%23b5562f' stroke-width='4' stroke-linecap='round'/%3E%3C/svg%3E");
  z-index: -1; opacity: .9;
}

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--sans); font-weight: 600; font-size: 1rem;
  text-decoration: none; padding: .8rem 1.5rem; border-radius: 999px;
  border: 1.5px solid var(--ink); cursor: pointer; transition: all .2s ease; }
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: var(--accent-deep); border-color: var(--accent-deep);
  transform: translateY(-2px); }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--paper); transform: translateY(-2px); }
.btn .arrow { width: 34px; height: 14px; }
.btn:disabled { opacity: .7; cursor: wait; transform: none; }
.btn .spinner { width: 1em; height: 1em; flex: none; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent;
  animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .btn .spinner { animation-duration: 1.6s; }
}

/* ---------- sections ---------- */
.section { padding-block: clamp(3.5rem, 8vw, 6rem); }
.section-alt {
  background: var(--paper-deep);
  width: 100%; max-width: none; padding-inline: 0;
  border-block: 1px solid var(--line);
}
.section-alt > * { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
.section-alt .section-head, .section-alt .wboard,
.section-alt .contact-grid { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }

.section-head { max-width: 50ch; margin-bottom: 2.8rem; }
.section-no { color: var(--accent); display: block; margin-bottom: .8rem; }
.section-head h2 { font-size: clamp(2rem, 4.5vw, 3rem); margin-bottom: 1rem; }
.section-lead { font-size: 1.12rem; color: var(--ink-soft); }
.section-lead em { color: var(--ink-faint); font-style: italic; }

/* ---------- services: margin notes ---------- */
.notes { display: grid; gap: 2.6rem; margin-bottom: 5.5rem; }
.note-row { display: grid; grid-template-columns: 1.1fr 1fr; gap: 1.2rem 2.5rem;
  align-items: start; }
/* alternate title/annotation sides like a marked-up draft */
.note-row:nth-child(even) { direction: rtl; }
.note-row:nth-child(even) > * { direction: ltr; }
.note-row h3 { font-size: clamp(1.5rem, 3.5vw, 2.1rem); }
.note-body { border-left: 2px solid var(--line); padding-left: 1.2rem;
  font-size: .98rem; }
.note-body p { margin: 0; }
.note-tag { font-family: var(--mono); font-size: .68rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--ink-faint); display: block;
  margin-bottom: .35rem; }

/* ---------- process: ink timeline ---------- */
.process { border-top: 1px dashed var(--line); padding-top: 2.5rem; }
.process-title { font-size: 1.45rem; margin-bottom: 1rem; }
.timeline { position: relative; padding-top: 3.4rem; }
.timeline-spine { position: absolute; top: 2.2rem; left: 2%; right: 2%; height: 22px; }
.timeline-spine svg { width: 100%; height: 100%; display: block; }
.tl-steps { list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.6rem; }
.tl-step { position: relative; padding-top: 1.1rem; }
.tl-dot { position: absolute; top: -1.55rem; left: .1rem; width: 13px; height: 13px;
  border-radius: 50%; background: var(--accent); border: 2.5px solid var(--paper);
  box-shadow: 0 0 0 1.5px var(--accent); }
.tl-when { font-family: var(--mono); font-size: .66rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--accent); display: block;
  margin-bottom: .45rem; }
.tl-step h4 { font-family: var(--serif); color: var(--ink); font-weight: 600;
  letter-spacing: -0.01em; line-height: 1.1; font-size: 1.22rem;
  margin: 0 0 .4rem; }
.tl-step p { margin: 0; font-size: .92rem; }

/* ---------- products: the office whiteboard ---------- */
.wboard { position: relative;
  background:
    linear-gradient(115deg, transparent 30%, rgba(120,120,115,.05) 42%, transparent 55%),
    linear-gradient(100deg, transparent 60%, rgba(120,120,115,.045) 72%, transparent 84%),
    #fbfaf6;
  border: 8px solid #d9d6cf; border-radius: 10px;
  box-shadow: inset 0 1px 8px rgba(0,0,0,.05), 2px 3px 0 rgba(26,26,26,.06);
  padding: 2.2rem 2.2rem 3.2rem; }

.wb-title, .wb-sub, .wb-note, .wb-sticky, .wb-sticky-title, .wb-noerase {
  font-family: "Caveat", "Segoe Print", "Bradley Hand", "Comic Sans MS", cursive; }

.wb-title { color: var(--ink); font-size: 2.1rem; font-weight: 700; line-height: 1.15;
  margin: 0 0 .1rem; transform: rotate(-.6deg); }
.wb-ul { text-decoration: underline; text-decoration-thickness: 3px;
  text-decoration-color: var(--accent); text-underline-offset: 6px; }
.wb-sub { color: var(--ink-soft); font-size: 1.25rem; margin: 0 0 1.8rem;
  transform: rotate(-.4deg); }

.wb-grid { display: grid; grid-template-columns: 1fr 1fr minmax(12rem, .8fr);
  gap: 2rem; align-items: start; }

/* marker-drawn boxes: the uneven radii keep the stroke looking hand-pulled */
.wb-box { position: relative; border: 2.5px solid var(--ink);
  border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
  padding: 1.9rem 1.4rem 1.4rem; transform: rotate(-.5deg);
  transition: transform .25s ease; }
.wb-box-b { transform: rotate(.6deg);
  border-radius: 15px 225px 15px 255px / 255px 15px 225px 15px; }
.wb-box:hover { transform: rotate(0); }
.wb-magnet { position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  width: 22px; height: 22px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #8f8f8f, #4d4d4d 60%, #2e2e2e);
  box-shadow: 0 2px 4px rgba(0,0,0,.25); }
.wb-logo { line-height: 0; }
.wb-logo img { height: 56px; width: auto; }
.wb-logo-sm img { height: 40px; }
.wb-box p { margin: .9rem 0; font-size: .95rem; }
.wb-box p.wb-go { display: flex; align-items: baseline; gap: .45rem;
  margin-bottom: 0; }
.wb-note { color: var(--accent-deep); font-size: 1.3rem; font-weight: 600; }
.product-link { color: var(--accent-deep); font-weight: 600; text-decoration: none;
  font-size: .95rem; }
.product-link:hover { text-decoration: underline; text-underline-offset: 3px; }

.wb-sticky { background: #f6e27a; padding: 1.2rem 1.2rem 1.4rem;
  box-shadow: 3px 6px 10px rgba(0,0,0,.14); transform: rotate(2.4deg);
  color: #4a3f18; font-size: 1.25rem; line-height: 1.35; }
.wb-sticky-title { font-size: 1.6rem; font-weight: 700; color: #4a3f18;
  line-height: 1; margin: 0 0 .25rem; }
.wb-sticky p { margin: 0; }

.wb-noerase { position: absolute; right: 2rem; bottom: 1.1rem;
  color: var(--ink-faint); font-size: 1.15rem; transform: rotate(-2deg); }

/* marker tray hangs off the bottom frame */
.wb-tray { position: absolute; left: 8%; right: 8%; bottom: -22px; height: 14px;
  background: linear-gradient(#e6e3dc, #c9c6bf); border-radius: 3px 3px 6px 6px;
  box-shadow: 0 3px 5px rgba(0,0,0,.12); }
.wb-marker { position: absolute; top: -9px; left: 8%; width: 74px; height: 9px;
  border-radius: 4px; background: linear-gradient(90deg, var(--ink) 78%, #555 78%); }
.wb-marker-2 { left: 22%; background: linear-gradient(90deg, var(--accent) 78%, var(--accent-deep) 78%); }

/* ---------- about ---------- */
.about-grid { display: grid; grid-template-columns: 1.7fr 1fr; gap: 2.5rem;
  align-items: start; margin-bottom: 3.5rem; }
.about-copy p { margin: 0 0 1.1rem; font-size: 1.08rem; }
.about-copy strong { color: var(--ink); }
.about-facts { background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; padding: 1.6rem 1.8rem; box-shadow: 2px 3px 0 rgba(26,26,26,.06); }
.about-facts dl { margin: 0; }
.about-facts div { display: flex; justify-content: space-between; gap: 1rem;
  padding: .7rem 0; border-bottom: 1px dashed var(--line); }
.about-facts div:last-child { border-bottom: 0; }
.about-facts dt { font-family: var(--mono); font-size: .78rem; color: var(--ink-faint);
  text-transform: uppercase; letter-spacing: .08em; }
.about-facts dd { margin: 0; font-family: var(--serif); font-weight: 600;
  color: var(--ink); }

/* ---------- clients ---------- */
.clients { border-top: 1px dashed var(--line); padding-top: 2.2rem; text-align: center; }
.clients-label { color: var(--ink-faint); margin-bottom: 1.2rem; }
.client-row { list-style: none; margin: 0; padding: 0; display: flex;
  flex-wrap: wrap; align-items: center; justify-content: center; gap: 1.5rem 3rem; }
.client-row li { display: flex; align-items: center; }
.client-logo { height: 3rem; width: auto; max-width: 180px; object-fit: contain;
  opacity: .85; transition: opacity .2s; }
.client-logo:hover { opacity: 1; }

/* ---------- contact ---------- */
.contact-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 2.5rem;
  align-items: start; }
.contact-form { display: grid; gap: 1.1rem; }
.field { display: grid; gap: .4rem; }
.field label { font-weight: 600; color: var(--ink); font-size: .95rem; }
.optional { color: var(--ink-faint); font-weight: 400; }
.field input, .field textarea {
  font-family: var(--sans); font-size: 1rem; color: var(--ink);
  background: var(--card); border: 1.5px solid var(--line); border-radius: 8px;
  padding: .75rem .9rem; width: 100%; transition: border-color .2s, box-shadow .2s;
}
.field input:focus, .field textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(181,86,47,.15);
}
.field textarea { resize: vertical; }
.form-status { margin: 0; font-size: .95rem; min-height: 1.2em; }
.form-status.ok { color: #2f7d52; font-weight: 600; }
.form-status.err { color: var(--accent-deep); font-weight: 600; }

.contact-aside { background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; padding: 1.8rem; box-shadow: 2px 3px 0 rgba(26,26,26,.06); }
.contact-aside-lead { font-family: var(--serif); font-size: 1.3rem; font-weight: 600;
  color: var(--ink); margin: 0 0 .8rem; }
.contact-direct { color: var(--accent-deep); font-weight: 600; text-decoration: none;
  font-size: 1.05rem; line-height: 2; }
.contact-direct:hover { text-decoration: underline; text-underline-offset: 3px; }
.contact-note { font-size: .92rem; color: var(--ink-faint); margin: 1.2rem 0 0; }

/* ---------- footer ---------- */
.site-footer { background: var(--ink); color: var(--paper); margin-top: 0;
  padding-block: 2.5rem; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center;
  justify-content: space-between; gap: 1.5rem; }
.footer-brand { display: flex; align-items: center; gap: .75rem; }
.footer-brand .brand-mark { filter: invert(1) brightness(1.6); mix-blend-mode: screen; }
.footer-brand .brand-name { color: var(--paper); display: block; }
.footer-tagline { font-family: var(--mono); font-size: .72rem; color: #b8b0a4;
  display: block; margin-top: .15rem; }
.footer-nav { display: flex; gap: 1.5rem; }
.footer-nav a { color: #d8d0c4; text-decoration: none; font-size: .95rem; }
.footer-nav a:hover { color: var(--paper); }
.footer-legal { font-family: var(--mono); font-size: .72rem; color: #948b7e;
  margin: 0; width: 100%; text-align: center; padding-top: 1rem;
  border-top: 1px solid #333; }

/* ---------- scroll reveal ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease,
  transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .wb-box { transition: none; }
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 760px) {
  .nav-toggle { display: block; z-index: 60; }
  .primary-nav {
    position: fixed; top: 0; right: 0; left: auto;
    height: 100vh; height: 100dvh; width: min(78vw, 320px);
    z-index: 55;
    flex-direction: column; align-items: flex-start; justify-content: center;
    gap: 1.8rem; padding: 2rem; background: var(--paper-deep);
    box-shadow: -8px 0 30px rgba(0,0,0,.12);
    transform: translateX(100%); transition: transform .3s ease;
  }
  .primary-nav.open { transform: translateX(0); }
  .primary-nav a { font-size: 1.3rem; font-family: var(--serif); }
  .nav-cta { font-family: var(--sans); }
  body.nav-open { overflow: hidden; }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .about-grid, .contact-grid { grid-template-columns: 1fr; }
  .wb-grid { grid-template-columns: 1fr; }
  .wb-sticky { max-width: 18rem; }
  .wboard { padding-inline: 1.4rem; }
  .wb-noerase { position: static; display: inline-block; margin-top: 1.6rem; }
  .note-row { grid-template-columns: 1fr; gap: .8rem; }
  .note-row:nth-child(even) { direction: ltr; }
  .tl-steps { grid-template-columns: 1fr 1fr; row-gap: 2.4rem; }
  .timeline { padding-top: 0; }
  .timeline-spine, .tl-dot { display: none; }
  .tl-step { padding-top: 0; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 460px) {
  .hero-actions { flex-direction: column; align-items: stretch; }
  .btn { justify-content: center; }
  .tl-steps { grid-template-columns: 1fr; }
}

/* ---------- cookie / GDPR notice ---------- */
.cookie-notice {
  position: fixed; bottom: 1.25rem; left: 50%; transform: translateX(-50%);
  z-index: 90; width: min(100% - 2.5rem, 44rem);
  display: flex; align-items: center; gap: 1.25rem;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 1rem 1.25rem; box-shadow: 2px 4px 0 rgba(26,26,26,.08),
    0 10px 30px rgba(0,0,0,.12);
}
.cookie-notice[hidden] { display: none; }
.cookie-notice p { margin: 0; font-size: .92rem; }
.cookie-notice a { color: var(--accent-deep); font-weight: 600; }
.cookie-notice .cookie-dismiss { flex-shrink: 0; }
@media (max-width: 460px) {
  .cookie-notice { flex-direction: column; align-items: stretch; text-align: center; }
}

/* ---------- legal pages (privacy / terms) ---------- */
.legal { padding-block: clamp(3rem, 7vw, 5rem); max-width: 46rem; }
.legal h1 { font-size: clamp(2.2rem, 5vw, 3.2rem); margin-bottom: .6rem; }
.legal .legal-updated { font-family: var(--mono); font-size: .72rem;
  text-transform: uppercase; letter-spacing: .12em; color: var(--ink-faint);
  margin: 0 0 2.5rem; }
.legal h2 { font-size: 1.45rem; margin: 2.4rem 0 .8rem; }
.legal p, .legal li { color: var(--ink-soft); }
.legal ul { padding-left: 1.2rem; }
.legal li { margin-bottom: .4rem; }
.legal a { color: var(--accent-deep); font-weight: 600; }
