/* =========================================================
   Craftoan Tech - Minimal Premium Design
   ========================================================= */

:root {
  --bg:       #F9F7F4;
  --surface:  #FFFFFF;
  --border:   #E4E0D9;
  --ink:      #1A1916;   /* primary text */
  --muted:    #7A756C;
  --accent:   #B07D3A;
  --accent-h: #C8922A;
  --green:    #2A8C5A;
  --amber:    #B07D3A;

  --font: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', 'SFMono-Regular', Consolas, monospace;

  --container: 1100px;
  --r: 12px;
  --ease: cubic-bezier(.16,.8,.24,1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4, p { margin: 0; }

::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 2px solid var(--accent-h); outline-offset: 3px; border-radius: 4px; }

/* Container */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 32px;
}
@media (max-width: 640px) { .container { padding: 0 20px; } }

/* ── Typography ──────────────────────────────────────── */
h1 {
  font-family: var(--font-display);
  font-weight: 640;
  font-size: clamp(2.4rem, 5.2vw, 4.4rem);
  letter-spacing: -0.03em;
  line-height: 1.04;
}
h2 {
  font-family: var(--font-display);
  font-weight: 620;
  font-size: clamp(1.8rem, 3.2vw, 2.8rem);
  letter-spacing: -0.025em;
  line-height: 1.1;
}
h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.1rem, 1.5vw, 1.3rem);
  letter-spacing: -0.01em;
}

.label {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent-h);
}

.lede {
  font-size: clamp(1rem, 1.3vw, 1.15rem);
  color: var(--muted);
  max-width: 560px;
  line-height: 1.65;
}

/* ── Buttons ─────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 540;
  font-size: 14.5px;
  padding: 12px 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: background .25s var(--ease), border-color .25s var(--ease), color .25s var(--ease), transform .25s var(--ease);
  white-space: nowrap;
}
.btn:active { transform: scale(.97); }

.btn-primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn-primary:hover { background: var(--accent); border-color: var(--accent); color: #fff; }

.btn-ghost { background: transparent; color: var(--ink); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--muted); background: var(--surface); }

.btn-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }

/* ── Nav ─────────────────────────────────────────────── */
.nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 10px 0;
  background: #0D1B2A;
  border-bottom: 1px solid rgba(255,255,255,.06);
  transition: padding .3s;
}
.nav.is-scrolled {
  background: #0D1B2A;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-bottom-color: rgba(255,255,255,.08);
  padding: 8px 0;
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; }

.nav-brand {
  display: flex; align-items: center;
}
.nav-logo {
  height: 44px;
  width: auto;
  max-width: 200px;
  object-fit: contain;
  flex: none;
  display: block;
}
.nav-mark { display: none; }

.nav-links { display: flex; align-items: center; gap: 2px; }
.nav-links a, .nav-item {
  font-size: 14px;
  color: rgba(255,255,255,.7);
  padding: 8px 14px;
  border-radius: 999px;
  transition: color .2s, background .2s;
  cursor: pointer;
}
.nav-links a:hover, .nav-item:hover, .nav-links a.is-active { color: #fff; background: rgba(255,255,255,.08); }

/* Dropdown removed - nav is now flat links */

.nav-cta { display: flex; align-items: center; gap: 8px; }
.nav-cta .btn { padding: 9px 18px; font-size: 13.5px; }
.nav-cta .btn-ghost {
  color: #fff;
  border-color: rgba(255,255,255,.25);
  background: transparent;
}
.nav-cta .btn-ghost:hover {
  background: rgba(255,255,255,.1);
  border-color: rgba(255,255,255,.4);
}

.nav-toggle {
  display: none;
  background: none; border: 1px solid rgba(255,255,255,.2);
  width: 38px; height: 38px; border-radius: 9px;
  color: #fff;
  align-items: center; justify-content: center;
}
@media (max-width: 860px) {
  .nav-links, .nav-cta .btn-ghost { display: none; }
  .nav-toggle { display: flex; }
}

/* Mobile menu */
.mobile-menu {
  position: fixed; inset: 0; z-index: 99;
  background: #0D1B2A;
  padding: 80px 28px 40px;
  display: flex; flex-direction: column; gap: 0;
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity .25s var(--ease), transform .25s var(--ease), visibility .25s;
  overflow-y: auto;
}
.mobile-menu.is-open { opacity: 1; visibility: visible; transform: translateY(0); }
.mobile-menu a {
  font-family: var(--font-display);
  font-size: 28px; font-weight: 600;
  padding: 18px 0;
  border-bottom: 1px solid rgba(255,255,255,.08);
  color: #fff;
  display: block;
}
.mobile-menu a:last-of-type { border-bottom: none; }
.mobile-menu-footer {
  margin-top: 40px;
  padding-bottom: 16px;
}
.mobile-menu-footer .btn {
  width: 100%;
  justify-content: center;
  padding: 16px 24px;
  font-size: 16px;
  border-radius: 14px;
  background: #fff;
  color: #0D1B2A;
  border: none;
  font-weight: 600;
}

/* ── Hero ────────────────────────────────────────────── */
.hero {
  padding: 160px 0 100px;
  position: relative;
}
.hero-inner { max-width: 740px; }
.hero .label { margin-bottom: 28px; display: block; }
.hero h1 { margin-bottom: 24px; }
.hero .lede { margin-bottom: 36px; }

@media (max-width: 860px) { .hero { padding: 130px 0 80px; } }
@media (max-width: 560px) { .hero { padding: 110px 0 64px; } }

/* ── Section ─────────────────────────────────────────── */
.section { padding: 96px 0; }
.section + .section { border-top: 1px solid var(--border); }

.section-head { margin-bottom: 56px; max-width: 620px; }
.section-head h2 { margin-top: 16px; }
.section-head .lede { margin-top: 16px; }
.section-head.center { text-align: center; margin-left: auto; margin-right: auto; }

@media (max-width: 860px) { .section { padding: 72px 0; } }
@media (max-width: 560px) { .section { padding: 56px 0; } }

/* ── Cards ───────────────────────────────────────────── */
.card-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 760px) { .card-grid { grid-template-columns: 1fr; } }

.card {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  padding: 36px;
  transition: border-color .25s, box-shadow .25s;
}
.card:hover { border-color: #ccc8bf; box-shadow: 0 4px 24px rgba(0,0,0,.06); }

.tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 20px;
}
.tag-flagship { background: rgba(176,125,58,.1); color: var(--accent); }
.tag-next { background: rgba(176,125,58,.08); color: var(--amber); }

.card h3 { font-size: clamp(1.4rem, 2vw, 1.8rem); margin-bottom: 10px; }
.card .sub { color: var(--muted); font-size: 14.5px; margin-bottom: 16px; }
.card .desc { color: var(--muted); font-size: 14.5px; line-height: 1.65; margin-bottom: 28px; }

/* ── List items ──────────────────────────────────────── */
.list-item {
  display: flex; gap: 20px; align-items: baseline;
  padding: 20px 0;
  border-top: 1px solid var(--border);
}
.list-item:first-child { border-top: none; }
.list-num { font-family: var(--font-mono); font-size: 12px; color: var(--accent-h); flex: none; width: 28px; }
.list-item h4 { font-size: 15.5px; margin-bottom: 5px; }
.list-item p { font-size: 14px; color: var(--muted); }

/* ── Feature list ────────────────────────────────────── */
.feature-list { display: flex; flex-direction: column; }

/* ── Two column ──────────────────────────────────────── */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; }
@media (max-width: 860px) { .two-col { grid-template-columns: 1fr; gap: 40px; } }

/* ── Status pills ────────────────────────────────────── */
.pill {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 999px;
}
.pill-green { background: rgba(42,140,90,.1); color: var(--green); }
.pill-amber { background: rgba(176,125,58,.1); color: var(--amber); }
.pill-muted { background: var(--bg); color: var(--muted); border: 1px solid var(--border); }

/* ── Demo block ──────────────────────────────────────── */
.demo-block {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  overflow: hidden;
}
.demo-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.demo-dots { display: flex; gap: 5px; }
.demo-dots span { width: 8px; height: 8px; border-radius: 50%; background: var(--border); }
.demo-title { font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); }
.demo-live { display: flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 11px; color: var(--green); }
.demo-live-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--green); animation: pulse 2s infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(42,140,90,.5); }
  70% { box-shadow: 0 0 0 6px rgba(42,140,90,0); }
  100% { box-shadow: 0 0 0 0 rgba(42,140,90,0); }
}
.demo-body { padding: 20px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .demo-body { grid-template-columns: 1fr; } }
.demo-panel { background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 14px; }
.demo-panel-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--muted);
  margin-bottom: 12px;
}
.demo-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 0;
  border-top: 1px solid var(--border);
  font-size: 13px;
}
.demo-row:first-of-type { border-top: none; }
.demo-wk { font-family: var(--font-mono); font-size: 11.5px; color: var(--accent); }

/* ── Form ────────────────────────────────────────────── */
.form-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 600px) { .form-grid { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; gap: 7px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.field input, .field select, .field textarea {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 11px 13px;
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  transition: border-color .2s;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); }
.field select { appearance: none; }
.field textarea { resize: vertical; min-height: 100px; font-family: var(--font); }
.field .err { font-size: 12px; color: #c0392b; min-height: 14px; }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: #c0392b; }

.form-status { display: none; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 9px; font-size: 13.5px; margin-bottom: 16px; }
.form-status.is-visible { display: flex; }
.form-status.success { background: rgba(42,140,90,.08); color: var(--green); border: 1px solid rgba(42,140,90,.2); }
.form-status.error { background: rgba(192,57,43,.07); color: #c0392b; border: 1px solid rgba(192,57,43,.2); }

.btn-submit { width: 100%; justify-content: center; margin-top: 4px; }
.btn-submit[disabled]{ opacity:.6; pointer-events:none; }
.spinner{ width:14px; height:14px; border-radius:50%; border:2px solid rgba(0,0,0,.2); border-top-color:var(--ink); animation:spin .7s linear infinite; display:none; }
.is-loading .spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Contact ─────────────────────────────────────────── */
.contact-item {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 0;
  border-top: 1px solid var(--border);
}
.contact-item:first-child { border-top: none; }
.contact-icon {
  width: 38px; height: 38px;
  border-radius: 9px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--muted);
  display: flex; align-items: center; justify-content: center;
  flex: none;
}
.contact-item .clabel { font-size: 11.5px; color: var(--muted); margin-bottom: 2px; }
.contact-item .cvalue { font-size: 15px; font-weight: 540; }

/* ── Badge ───────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 7px 12px;
  border-radius: 999px;
}
.badge .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--green); }

/* ── CTA band ────────────────────────────────────────── */
.cta-band {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 64px 48px;
  text-align: center;
  background: var(--surface);
}
@media (max-width: 560px) { .cta-band { padding: 44px 24px; } }
.cta-band h2 { margin-top: 16px; }
.cta-band .lede { margin: 16px auto 0; }
.cta-band .btn-row { justify-content: center; margin-top: 28px; }

/* ── Legal ───────────────────────────────────────────── */
.legal-layout { display: grid; grid-template-columns: 200px 1fr; gap: 56px; align-items: start; }
@media (max-width: 760px) { .legal-layout { grid-template-columns: 1fr; } }
.legal-toc { position: sticky; top: 100px; display: flex; flex-direction: column; gap: 2px; }
@media (max-width: 760px) { .legal-toc { position: static; flex-direction: row; flex-wrap: wrap; } }
.legal-toc a { font-size: 13px; color: var(--muted); padding: 7px 10px; border-radius: 7px; }
.legal-toc a:hover { color: var(--ink); background: var(--surface); }
.legal-body h2 { font-size: 18px; margin-bottom: 12px; scroll-margin-top: 100px; }
.legal-body section { padding-bottom: 32px; margin-bottom: 32px; border-bottom: 1px solid var(--border); }
.legal-body section:last-child { border-bottom: none; }
.legal-body p, .legal-body li { color: var(--muted); font-size: 14.5px; line-height: 1.75; margin-bottom: 10px; }
.legal-body ul { padding-left: 18px; }
.legal-body li { list-style: disc; }
.legal-updated { font-family: var(--font-mono); font-size: 12px; color: var(--muted); margin-bottom: 6px; display: block; }

/* ── Footer ──────────────────────────────────────────── */
.footer { border-top: 1px solid var(--border); padding: 64px 0 28px; background: var(--surface); }
.footer-top { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr; gap: 32px; padding-bottom: 48px; }
@media (max-width: 720px) { .footer-top { grid-template-columns: 1fr 1fr; row-gap: 32px; } }
@media (max-width: 440px) { .footer-top { grid-template-columns: 1fr; } }
.footer-brand p { color: var(--muted); font-size: 13.5px; margin: 12px 0 16px; max-width: 240px; }
.footer h5 { font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: 14px; }
.footer-links { display: flex; flex-direction: column; gap: 10px; }
.footer-links a { font-size: 14px; color: var(--muted); transition: color .2s; }
.footer-links a:hover { color: var(--ink); }
.footer-bottom {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
  gap: 12px; padding-top: 24px;
  border-top: 1px solid var(--border);
  font-size: 12.5px; color: var(--muted);
}
.footer-bottom-links { display: flex; gap: 18px; }
.footer-bottom-links a:hover { color: var(--ink); }

/* ── 404 ─────────────────────────────────────────────── */
.page-404 { min-height: 100vh; display: flex; align-items: center; justify-content: center; text-align: center; padding: 120px 24px; }
.page-404 .label { margin-bottom: 20px; display: block; }

/* ── Reveal ──────────────────────────────────────────── */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.is-visible { opacity: 1; transform: translateY(0); }
.reveal-stagger > * { opacity: 0; transform: translateY(14px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.reveal-stagger.is-visible > * { opacity: 1; transform: translateY(0); }
.reveal-stagger.is-visible > *:nth-child(1) { transition-delay: .03s; }
.reveal-stagger.is-visible > *:nth-child(2) { transition-delay: .09s; }
.reveal-stagger.is-visible > *:nth-child(3) { transition-delay: .15s; }
.reveal-stagger.is-visible > *:nth-child(4) { transition-delay: .21s; }
.reveal-stagger.is-visible > *:nth-child(5) { transition-delay: .27s; }
.reveal-stagger.is-visible > *:nth-child(6) { transition-delay: .33s; }

/* Page in */
body.page-ready main { animation: page-in .4s var(--ease); }
@keyframes page-in { from { opacity: 0; } to { opacity: 1; } }

/* Util */
.mt-48 { margin-top: 48px; }
.mt-16 { margin-top: 16px; }
.text-muted { color: var(--muted); }

/* ==============================================
   Mobile - comprehensive fixes
   ============================================== */

/* Nav logo sizing on mobile */
@media (max-width: 560px) {
  .nav-logo { height: 36px; max-width: 150px; }
  .nav { padding: 8px 0; }
}

/* Buttons - full width on small screens */
@media (max-width: 560px) {
  .btn-row { flex-direction: column; align-items: stretch; }
  .btn-row .btn { width: 100%; justify-content: center; text-align: center; }
  .btn { padding: 14px 20px; font-size: 15px; }
}

/* Hero text */
@media (max-width: 560px) {
  h1 { font-size: clamp(2rem, 8vw, 2.8rem); }
  h2 { font-size: clamp(1.5rem, 6vw, 2rem); }
  .lede { font-size: 1rem; }
}

/* Cards - full width, less padding */
@media (max-width: 560px) {
  .card { padding: 24px 20px; }
  .card h3 { font-size: 1.4rem; }
}

/* Two-col stacks on mobile */
@media (max-width: 560px) {
  .two-col { gap: 28px; }
}

/* Section spacing */
@media (max-width: 560px) {
  .section { padding: 48px 0; }
  .section-head { margin-bottom: 36px; }
}

/* CTA band */
@media (max-width: 560px) {
  .cta-band { padding: 36px 20px; }
  .cta-band .btn-row { justify-content: stretch; }
}

/* List items */
@media (max-width: 560px) {
  .list-item { gap: 14px; padding: 16px 0; }
  .list-item h4 { font-size: 15px; }
}

/* Footer */
@media (max-width: 560px) {
  .footer { padding: 48px 0 24px; }
  .footer-top { gap: 28px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; gap: 10px; }
  .footer-bottom-links { flex-wrap: wrap; gap: 12px; }
}

/* Form */
@media (max-width: 560px) {
  .form-wrap { padding: 22px 16px; }
  .form-grid { grid-template-columns: 1fr; }
}

/* Contact items */
@media (max-width: 560px) {
  .two-col.contact-layout { grid-template-columns: 1fr; }
}

/* Legal layout */
@media (max-width: 560px) {
  .legal-layout { gap: 24px; }
  .legal-toc { flex-direction: row; flex-wrap: wrap; gap: 6px; }
  .legal-body h2 { font-size: 17px; }
  .legal-body p, .legal-body li { font-size: 14px; }
}

/* Badge wrapping */
@media (max-width: 420px) {
  .badge { font-size: 11px; padding: 6px 10px; }
}
