/* =================================================================
   xFactory Corporate Site — Common Stylesheet v1.0
   2026-05-28 / design-taste-frontend skill / xFactory
   ================================================================= */

:root {
  /* Palette — forest base + amber + vermilion accent (continuing from brand) */
  --paper:        #f6f8f3;
  --paper-2:      #ecf0e7;
  --paper-3:      #dfe4d6;
  --ink:          #1a2a1c;
  --ink-2:        #4a574a;
  --ink-3:        #7c8579;
  --line:         #c8d2bf;
  --forest:       #2e5a3b;
  --forest-deep:  #1f3f29;
  --amber:        #c89530;
  --amber-deep:   #9a6f1d;
  --vermilion:    #c84122;
  --vermilion-deep:#9c2f15;

  /* Radius scale (one rule, applied everywhere) */
  --r-card: 6px;
  --r-pill: 999px;

  /* Type families */
  --f-display: "Cabinet Grotesk", system-ui, -apple-system, sans-serif;
  --f-body:    "Satoshi", system-ui, -apple-system, sans-serif;

  /* Rhythm */
  --gutter: clamp(20px, 4vw, 56px);
  --section-y: clamp(64px, 9vw, 128px);
}

/* RESET */
*,*::before,*::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.55;
  font-feature-settings: "ss01", "ss02";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img,svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: 0; background: none; }
h1,h2,h3,h4,h5 {
  margin: 0;
  font-family: var(--f-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--ink);
}
p { margin: 0; }
::selection { background: var(--forest); color: var(--paper); }

.container { width: 100%; max-width: 1240px; margin-inline: auto; padding-inline: var(--gutter); }
.container--narrow { max-width: 900px; }

/* =================================================================
   HEADER (shared across all pages)
   ================================================================= */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  height: 72px;
  gap: 24px;
}
.nav-logo { display: inline-flex; align-items: center; height: 40px; }
.nav-logo img { height: 32px; width: auto; }
.nav-list { display: none; }
.nav-cta-wrap { display: inline-flex; gap: 8px; align-items: center; flex-shrink: 0; }
.nav-cta {
  padding: 10px 20px; border-radius: var(--r-pill);
  background: var(--ink); color: var(--paper);
  font-size: 14px; font-weight: 600;
  transition: transform 160ms ease, background 160ms ease;
}
.nav-cta:hover { background: var(--forest); }
.nav-cta:active { transform: translateY(1px); }
.nav-secondary {
  padding: 9px 14px; font-size: 14px; font-weight: 500;
  color: var(--ink-2); border-radius: var(--r-pill);
}
.nav-secondary:hover { color: var(--ink); background: var(--paper-2); }
.nav-list a.is-current { color: var(--ink); background: var(--paper-2); }

@media (min-width: 960px) {
  .nav-list { display: inline-flex; gap: 4px; flex-grow: 1; justify-content: center; }
  .nav-list a {
    padding: 9px 14px; border-radius: var(--r-pill);
    font-size: 14px; font-weight: 500; color: var(--ink-2);
    transition: color 160ms ease, background 160ms ease;
  }
  .nav-list a:hover { color: var(--ink); background: var(--paper-2); }
}

/* =================================================================
   MOBILE NAV - hamburger toggle + drawer panel (under 960px)
   ================================================================= */
.nav-toggle { display: inline-flex; flex-shrink: 0; }
@media (min-width: 960px) { .nav-toggle { display: none; } }
.nav-toggle button {
  width: 44px; height: 44px;            /* WCAG AA tap target */
  border-radius: var(--r-card);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--ink);
  position: relative;
}
.nav-toggle button:hover { background: var(--paper-2); }
.nav-toggle button:focus-visible {
  outline: 2px solid var(--forest); outline-offset: 2px;
}

/* Hamburger icon - three bars that morph into an X when open */
.nav-burger {
  position: relative;
  width: 22px; height: 16px;
  display: inline-block;
}
.nav-burger span {
  position: absolute; left: 0;
  width: 100%; height: 2px;
  background: currentColor; border-radius: 2px;
  transition: transform 280ms cubic-bezier(0.16,1,0.3,1),
              opacity 200ms ease, top 280ms cubic-bezier(0.16,1,0.3,1);
}
.nav-burger span:nth-child(1) { top: 0; }
.nav-burger span:nth-child(2) { top: 7px; }
.nav-burger span:nth-child(3) { top: 14px; }
/* open state morph (driven by .is-open class + aria-expanded on the button) */
.nav-toggle button.is-open .nav-burger span:nth-child(1),
.nav-toggle button[aria-expanded="true"] .nav-burger span:nth-child(1) {
  top: 7px; transform: rotate(45deg);
}
.nav-toggle button.is-open .nav-burger span:nth-child(2),
.nav-toggle button[aria-expanded="true"] .nav-burger span:nth-child(2) {
  opacity: 0;
}
.nav-toggle button.is-open .nav-burger span:nth-child(3),
.nav-toggle button[aria-expanded="true"] .nav-burger span:nth-child(3) {
  top: 7px; transform: rotate(-45deg);
}

/* Backdrop behind the drawer */
.nav-backdrop {
  position: fixed; inset: 0; z-index: 60;
  background: color-mix(in srgb, var(--ink) 38%, transparent);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0; visibility: hidden;
  transition: opacity 280ms ease, visibility 0s linear 280ms;
}
.nav-backdrop.is-open {
  opacity: 1; visibility: visible;
  transition: opacity 280ms ease;
}
@media (min-width: 960px) { .nav-backdrop { display: none; } }

/* Drawer panel - slides in from the right */
.nav-mobile {
  position: fixed; top: 0; right: 0; z-index: 70;
  width: min(86vw, 360px); height: 100dvh;
  background: var(--paper);
  border-left: 1px solid var(--line);
  box-shadow: -24px 0 60px color-mix(in srgb, var(--ink) 22%, transparent);
  display: flex; flex-direction: column;
  padding: 20px var(--gutter) calc(28px + env(safe-area-inset-bottom));
  transform: translateX(100%);
  transition: transform 360ms cubic-bezier(0.16,1,0.3,1);
  overflow-y: auto;
  visibility: hidden;
}
.nav-mobile.is-open { transform: translateX(0); visibility: visible; }
@media (min-width: 960px) { .nav-mobile { display: none; } }

.nav-mobile-head {
  display: flex; align-items: center; justify-content: space-between;
  height: 52px; margin-bottom: 12px;
}
.nav-mobile-head img { height: 28px; width: auto; }
.nav-mobile-close {
  width: 44px; height: 44px;
  border-radius: var(--r-card);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--ink);
}
.nav-mobile-close:hover { background: var(--paper-2); }
.nav-mobile-close:focus-visible { outline: 2px solid var(--forest); outline-offset: 2px; }

.nav-mobile-list { display: flex; flex-direction: column; gap: 2px; }
.nav-mobile-list a {
  display: flex; align-items: center;
  min-height: 52px; padding: 8px 14px;
  border-radius: var(--r-card);
  font-family: var(--f-display);
  font-size: 19px; font-weight: 500; letter-spacing: -0.01em;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  transition: background 160ms ease, color 160ms ease, padding-left 200ms cubic-bezier(0.16,1,0.3,1);
}
.nav-mobile-list a:last-child { border-bottom: 0; }
.nav-mobile-list a:hover { background: var(--paper-2); padding-left: 20px; }
.nav-mobile-list a.is-current { color: var(--forest); background: var(--paper-2); }

.nav-mobile-cta { margin-top: 24px; display: flex; flex-direction: column; gap: 12px; }
.nav-mobile-cta .nav-cta,
.nav-mobile-cta .nav-secondary {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; width: 100%;
  border-radius: var(--r-pill);
  font-size: 15px; font-weight: 600;
}
.nav-mobile-cta .nav-secondary {
  border: 1.5px solid var(--line); color: var(--ink); font-weight: 500;
}
.nav-mobile-cta .nav-secondary:hover { border-color: var(--ink); background: var(--paper-2); }

/* Lock body scroll while drawer is open */
body.nav-open { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  .nav-burger span,
  .nav-backdrop,
  .nav-mobile { transition: none !important; }
}

/* =================================================================
   BUTTONS
   ================================================================= */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 16px 28px; border-radius: var(--r-pill);
  font-weight: 600; font-size: 15px;
  transition: transform 160ms ease, background 160ms ease, color 160ms ease, border-color 160ms ease;
  border: 1.5px solid transparent;
}
.btn-primary {
  background: var(--vermilion); color: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.18);
}
.btn-primary:hover { background: var(--vermilion-deep); }
.btn-primary:active { transform: translateY(1px); }
.btn-ghost { color: var(--ink); border-color: var(--line); background: transparent; }
.btn-ghost:hover { border-color: var(--ink); background: var(--paper-2); }
.btn-ghost:active { transform: translateY(1px); }
.btn-on-dark {
  background: var(--paper); color: var(--ink);
}
.btn-on-dark:hover { background: var(--amber); color: var(--ink); }
.btn-ghost-on-dark {
  background: transparent; color: #fff;
  border-color: rgba(255,255,255,0.45);
}
.btn-ghost-on-dark:hover { border-color: #fff; background: rgba(255,255,255,0.12); }
.btn-ghost-on-dark:active { transform: translateY(1px); }
.btn .arrow { transition: transform 200ms ease; }
.btn:hover .arrow { transform: translateX(3px); }

/* =================================================================
   SECTIONS
   ================================================================= */
.section { padding-block: var(--section-y); }
.section--tinted { background: var(--paper-2); }
.section--ink { background: var(--ink); color: var(--paper); }
.section--ink h1, .section--ink h2, .section--ink h3, .section--ink h4 { color: var(--paper); }

.section-head { display: grid; gap: 18px; grid-template-columns: 1fr; margin-bottom: clamp(40px, 5vw, 64px); }
.section-head h2 { font-size: clamp(32px, 4.4vw, 52px); letter-spacing: -0.025em; max-width: 18ch; }
.section-head .lede {
  color: var(--ink-2);
  font-size: clamp(15px, 1.4vw, 17px);
  max-width: 56ch;
  line-height: 1.65;
}
.section--ink .section-head .lede { color: color-mix(in srgb, var(--paper) 75%, transparent); }

.section-eyebrow {
  display: inline-block;
  font-size: 12px; font-weight: 600; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--forest);
  margin-bottom: 18px;
}
.section--ink .section-eyebrow { color: var(--amber); }

/* =================================================================
   PAGE HEADER (for inner pages)
   ================================================================= */
.page-header {
  padding-top: clamp(56px, 8vw, 112px);
  padding-bottom: clamp(40px, 6vw, 80px);
  border-bottom: 1px solid var(--line);
}
.page-header-grid {
  display: grid; gap: 24px; grid-template-columns: 1fr;
  align-items: end;
}
@media (min-width: 960px) {
  .page-header-grid { grid-template-columns: 1.2fr 0.8fr; }
}
.page-header h1 {
  font-size: clamp(40px, 6.4vw, 80px);
  letter-spacing: -0.035em;
  line-height: 0.98;
}
.page-header .lede {
  color: var(--ink-2);
  font-size: clamp(16px, 1.6vw, 19px);
  line-height: 1.6;
  max-width: 50ch;
}
.breadcrumb {
  font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-3); margin-bottom: 20px;
}
.breadcrumb a:hover { color: var(--ink); }
.breadcrumb .sep { margin: 0 8px; opacity: 0.6; }

/* =================================================================
   FOOTER (shared)
   ================================================================= */
.site-footer {
  background: var(--ink);
  color: var(--paper);
  padding-block: clamp(56px, 8vw, 96px) 32px;
}
.site-footer h4 {
  color: color-mix(in srgb, var(--paper) 70%, transparent);
  font-size: 11px; font-weight: 600; letter-spacing: 0.14em;
  text-transform: uppercase;
  font-family: var(--f-body);
  margin-bottom: 18px;
}
.foot-grid {
  display: grid; gap: 40px;
  grid-template-columns: 1fr;
}
@media (min-width: 720px) { .foot-grid { grid-template-columns: 1.6fr 1fr 1fr 1fr; } }

.foot-logo img { height: 28px; width: auto; margin-bottom: 18px; }
.foot-tagline {
  color: color-mix(in srgb, var(--paper) 70%, transparent);
  font-size: 13px;
  line-height: 1.65;
  max-width: 30ch;
}
.foot-col ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.foot-col a {
  font-size: 14px;
  color: color-mix(in srgb, var(--paper) 75%, transparent);
  transition: color 160ms ease;
}
.foot-col a:hover { color: var(--paper); }
.foot-bottom {
  margin-top: clamp(48px, 6vw, 72px);
  padding-top: 24px;
  border-top: 1px solid color-mix(in srgb, var(--paper) 14%, transparent);
  display: flex; flex-wrap: wrap; gap: 12px;
  justify-content: space-between; align-items: center;
  font-size: 12px;
  color: color-mix(in srgb, var(--paper) 50%, transparent);
}
.foot-meta { display: inline-flex; flex-wrap: wrap; gap: 16px; }
.foot-meta a:hover { color: var(--paper); }

/* =================================================================
   MOTION
   ================================================================= */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  html { scroll-behavior: auto; }
}
.reveal {
  opacity: 0; transform: translateY(14px);
  transition: opacity 600ms cubic-bezier(0.16,1,0.3,1),
              transform 600ms cubic-bezier(0.16,1,0.3,1);
}
.reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1 !important; transform: none !important; }
}

/* =================================================================
   UTILITIES
   ================================================================= */
.text-vermilion { color: var(--vermilion); }
.text-forest { color: var(--forest); }
.text-amber { color: var(--amber); }
.text-ink-2 { color: var(--ink-2); }
.muted { color: var(--ink-3); }
.divider { height: 1px; background: var(--line); border: 0; }
.hr-amber {
  height: 1px; border: 0;
  background: linear-gradient(90deg, transparent, var(--amber), transparent);
  margin-block: clamp(40px, 5vw, 64px);
}

/* =================================================================
   FAKKO CHARACTER (brand ambassador)
   See: character-guide.md for usage rules
   ================================================================= */
.fakko {
  display: inline-block;
  width: auto;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
  flex-shrink: 0;
}
.fakko-xs { height: 40px; }
.fakko-sm { height: 60px; }
.fakko-md { height: 100px; }
.fakko-lg { height: 140px; }
.fakko-xl { height: 180px; }
.fakko-floating-br { position: absolute; bottom: 24px; right: 24px; z-index: 2; }
.fakko-floating-bl { position: absolute; bottom: 24px; left: 24px; z-index: 2; }
.fakko-floating-tr { position: absolute; top: 24px; right: 24px; z-index: 2; }
.fakko-inline { vertical-align: middle; margin: 0 8px; }
.fakko-watermark { opacity: 0.88; }
.fakko-wave {
  animation: fakko-wave 4s ease-in-out infinite;
  transform-origin: 50% 90%;
}
@keyframes fakko-wave {
  0%, 100% { transform: rotate(-2deg); }
  50% { transform: rotate(2deg); }
}
@media (prefers-reduced-motion: reduce) {
  .fakko-wave { animation: none; }
}
@media (max-width: 720px) {
  .fakko-md { height: 80px; }
  .fakko-lg { height: 110px; }
  .fakko-xl { height: 140px; }
}


/* === Real brand logo lockup (replaces inline SVG mark) === */
.nav-logo .logo-img{ display:block; height:32px; width:auto; }
.nav-mobile-head .logo-img{ display:block; height:26px; width:auto; }
.foot-logo .logo-img{ display:block; height:30px; width:auto; margin-bottom:18px; }
.site-footer .logo-img, .manifesto .logo-img{ filter:brightness(0) invert(1); }
.manifesto-sign .logo-img{ display:block; height:26px; width:auto; }
