/* portal.css — PerCode.ai public marketing theme
   Light, modern, conversion + SEO/perf oriented. Distinct from the dark
   engineering-app chrome. Brand font = Inter (loaded in base.html, display=swap).
   Palette aligned to docs/brand/BRAND.md.                                      */

/* ── Tokens (BRAND.md) ──────────────────────────────────────────────────── */
:root {
  --ink:        #0F1A2A;   /* Ink — wordmark, headings, body */
  --ink-2:      #334155;   /* body text */
  --muted:      #64748b;   /* secondary text */
  --line:       #e2e8f0;   /* borders */
  --bg:         #ffffff;
  --bg-soft:    #f8fafc;
  --bg-soft-2:  #f1f5f9;
  --brand:      #2E90FA;   /* Brand Blue — links, primary actions, accent node */
  --brand-700:  #1f73d6;   /* darker hover */
  --brand-50:   #eaf3ff;   /* light blue tint */
  --violet:     #7A5AF8;   /* Brand Violet — gradient end */
  --grad:       linear-gradient(135deg, #2E90FA, #7A5AF8);  /* hero/brand gradient */
  --accent:     #7A5AF8;   /* focus ring (brand violet) */
  --ok:         #059669;
  --warn:       #b45309;
  --radius:     12px;
  --radius-sm:  8px;
  --shadow-sm:  0 1px 2px rgba(15,23,42,.06), 0 1px 3px rgba(15,23,42,.08);
  --shadow:     0 4px 6px -1px rgba(15,23,42,.08), 0 2px 4px -2px rgba(15,23,42,.06);
  --shadow-lg:  0 20px 25px -5px rgba(15,23,42,.10), 0 8px 10px -6px rgba(15,23,42,.08);
  --wrap:       1120px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink-2);
  background: var(--bg);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { color: var(--ink); line-height: 1.2; margin: 0 0 .5em; font-weight: 800; letter-spacing: -.02em; }
h1 { font-size: clamp(2rem, 4.5vw, 3.25rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); }
h3 { font-size: 1.25rem; font-weight: 700; }
p { margin: 0 0 1rem; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }
ul { margin: 0; padding: 0; list-style: none; }

/* ── Accessibility ──────────────────────────────────────────────────────── */
.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 1000;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ── Layout helpers ─────────────────────────────────────────────────────── */
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.section { padding: 72px 0; }
.section-soft { background: var(--bg-soft); }
.eyebrow {
  text-transform: uppercase; letter-spacing: .08em; font-size: .8rem;
  font-weight: 700; color: var(--brand); margin-bottom: .5rem;
}
.lead { font-size: 1.15rem; color: var(--ink-2); max-width: 60ch; }
.center { text-align: center; }
.center .lead { margin-left: auto; margin-right: auto; }

/* ── Buttons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: var(--radius-sm); font-weight: 700;
  font-size: 1rem; cursor: pointer; border: 1px solid transparent;
  text-decoration: none; transition: background .15s, box-shadow .15s, transform .05s;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--brand-700); color: #fff; }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--bg-soft); }
.btn-lg { padding: 15px 28px; font-size: 1.05rem; }
.btn-block { width: 100%; }

/* ── Header / nav ───────────────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.9); backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; gap: 18px; height: 64px; }
.nav-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; color: var(--ink); font-size: 1.15rem; letter-spacing: -.02em; }
.nav-brand:hover { text-decoration: none; }

/* ── Brand logo (BRAND.md): inline mark + live HTML wordmark ─────────────── */
.pc-logo { display: inline-flex; align-items: center; gap: .5rem; text-decoration: none; }
.pc-logo .pc-mark { width: 30px; height: 30px; display: block; }
.pc-logo .wm { font: 600 1.3rem/1 var(--font); color: var(--ink); letter-spacing: -.01em; }
.pc-logo .wm .ai { color: var(--brand); font-weight: 500; }
.pc-logo:hover { text-decoration: none; }
.nav-links { display: flex; gap: 4px; margin-left: 12px; }
.nav-links a { color: var(--ink-2); font-weight: 600; font-size: .95rem; padding: 8px 12px; border-radius: 6px; }
.nav-links a:hover { background: var(--bg-soft); color: var(--ink); text-decoration: none; }
.nav-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.nav-actions .signin { color: var(--ink-2); font-weight: 700; padding: 8px 10px; }
.nav-toggle { display: none; background: none; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; cursor: pointer; font-size: 1.1rem; }

/* ── Hero ───────────────────────────────────────────────────────────────── */
.hero { padding: 84px 0 56px; background:
  radial-gradient(60% 60% at 80% 0%, var(--brand-50), transparent 70%); }
.hero h1 { max-width: 18ch; }
.hero .lead { margin-top: 1rem; font-size: 1.25rem; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 28px; }
.hero-trust { margin-top: 20px; color: var(--muted); font-size: .92rem; }

/* ── Pillars / feature grid ─────────────────────────────────────────────── */
.grid { display: grid; gap: 22px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px; box-shadow: var(--shadow-sm);
}
.card h3 { margin-bottom: .4em; }
.card p { color: var(--ink-2); margin: 0; }

/* ── Comparison / data tables ───────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table.cmp { width: 100%; border-collapse: collapse; background: #fff; min-width: 560px; }
table.cmp th, table.cmp td { padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
table.cmp thead th { background: var(--bg-soft); font-weight: 800; color: var(--ink); }
table.cmp tbody tr:last-child td { border-bottom: none; }
table.cmp td.col-percode, table.cmp th.col-percode { background: var(--brand-50); font-weight: 700; color: var(--ink); }
.yes { color: var(--ok); font-weight: 700; }
.no { color: var(--muted); }

/* ── Pricing ────────────────────────────────────────────────────────────── */
.toggles { display: flex; flex-wrap: wrap; gap: 18px; justify-content: center; margin: 22px 0 36px; }
.toggle-group { display: inline-flex; gap: 6px; background: var(--bg-soft-2); padding: 5px; border-radius: 10px; }
.toggle-group button {
  border: none; background: none; padding: 8px 14px; border-radius: 7px; cursor: pointer;
  font-weight: 700; color: var(--ink-2); font-size: .9rem;
}
.toggle-group button[aria-pressed="true"] { background: #fff; color: var(--brand); box-shadow: var(--shadow-sm); }
.toggle-group button[disabled] { opacity: .5; cursor: not-allowed; }

.price-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; align-items: stretch; }
.price-card { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-sm); }
.price-card.featured { border-color: var(--brand); box-shadow: var(--shadow-lg); position: relative; }
.price-badge { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--brand); color: #fff; font-size: .72rem; font-weight: 700; padding: 4px 12px; border-radius: 999px; white-space: nowrap; }
.price-name { font-weight: 800; color: var(--ink); font-size: 1.15rem; }
.price-who { color: var(--muted); font-size: .85rem; margin-bottom: 12px; }
.price-amount { font-size: 2.1rem; font-weight: 800; color: var(--ink); letter-spacing: -.02em; }
.price-amount span { font-size: .95rem; font-weight: 600; color: var(--muted); }
.price-features { margin: 16px 0 22px; display: grid; gap: 9px; }
.price-features li { padding-left: 26px; position: relative; font-size: .92rem; color: var(--ink-2); }
.price-features li::before { content: "✓"; position: absolute; left: 0; color: var(--ok); font-weight: 800; }
.price-card .btn { margin-top: auto; }
.pack-note { margin-top: 28px; }

/* ── Quality ────────────────────────────────────────────────────────────── */
.badge-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { background: var(--bg-soft-2); border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; font-size: .85rem; font-weight: 700; color: var(--ink-2); }
.notice { border-left: 4px solid var(--warn); background: #fffbeb; padding: 14px 18px; border-radius: 0 8px 8px 0; color: #713f12; font-size: .95rem; }
.notice.info { border-color: var(--brand); background: var(--brand-50); color: #1e3a8a; }
.contract { background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 18px; }
.contract dt { font-weight: 700; color: var(--ink); margin-top: 12px; font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; font-size: .9rem; }
.contract dd { margin: 2px 0 0; color: var(--ink-2); font-size: .92rem; }

/* ── Free tools ─────────────────────────────────────────────────────────── */
.tool-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.tool-card { display: block; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-sm); color: inherit; }
.tool-card:hover { border-color: var(--brand); text-decoration: none; box-shadow: var(--shadow); }
.tool-card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; gap: 8px; }
.tool-disc { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--brand); }
.tool-codes { font-size: .78rem; color: var(--muted); margin-top: 8px; font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; }
/* status / category badges */
.tag-soon { font-size: .72rem; font-weight: 700; color: var(--warn); background: #fffbeb; border: 1px solid #fde68a; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.tag-live { font-size: .72rem; font-weight: 700; color: var(--ok); background: #ecfdf5; border: 1px solid #a7f3d0; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.tag-new { font-size: .72rem; font-weight: 700; color: #fff; background: var(--grad); padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.tag-desktop { font-size: .72rem; font-weight: 700; color: #4338ca; background: #eef2ff; border: 1px solid #c7d2fe; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }

/* ── Signup ─────────────────────────────────────────────────────────────── */
.auth-wrap { max-width: 440px; margin: 56px auto; }
.auth-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 32px; box-shadow: var(--shadow); }
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 700; color: var(--ink); margin-bottom: 6px; font-size: .9rem; }
.field input { width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; font-size: 1rem; font-family: inherit; }
.field input:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px var(--brand-50); }
.integration-slot { margin-top: 22px; border: 1px dashed var(--brand); border-radius: 8px; padding: 14px 16px; background: var(--brand-50); color: #1e3a8a; font-size: .85rem; }

/* ── CTA band ───────────────────────────────────────────────────────────── */
.cta-band { background: var(--ink); color: #fff; border-radius: var(--radius); padding: 48px; text-align: center; }
.cta-band h2 { color: #fff; }
.cta-band p { color: #cbd5e1; max-width: 56ch; margin: 0 auto 22px; }

/* ── Footer ─────────────────────────────────────────────────────────────── */
.site-footer { border-top: 1px solid var(--line); background: var(--bg-soft); padding: 48px 0 32px; margin-top: 24px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 28px; }
.footer-grid h4 { font-size: .8rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.footer-grid a { display: block; color: var(--ink-2); font-weight: 600; padding: 4px 0; font-size: .92rem; }
.footer-brand p { color: var(--muted); font-size: .9rem; max-width: 40ch; }
.footer-legal { margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }

/* ── Footer social ──────────────────────────────────────────────────────── */
.footer-social { display: flex; gap: 16px; margin-top: 12px; }
.footer-social a { color: var(--brand); font-weight: 700; font-size: .9rem; }

/* ── Tick lists (desktop/about) ─────────────────────────────────────────── */
.ticks { display: grid; gap: 10px; }
.ticks li { padding-left: 26px; position: relative; color: var(--ink-2); }
.ticks li::before { content: "✓"; position: absolute; left: 0; color: var(--ok); font-weight: 800; }

/* ── Video embed (tutorials) ────────────────────────────────────────────── */
.video-embed { position: relative; width: 100%; max-width: 720px; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ── Desktop page: screenshots ──────────────────────────────────────────── */
.shots { display: flex; flex-wrap: wrap; gap: 16px; }
.shots .shot, .shots .shot-placeholder { flex: 1 1 320px; }
.shots .shot img { border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.shots figcaption { font-size: .82rem; color: var(--muted); margin-top: 6px; }
.shot-placeholder { display: grid; place-items: center; min-height: 220px; border: 2px dashed var(--line); border-radius: var(--radius); background: var(--bg-soft); color: var(--muted); font-weight: 700; }

/* ── About: timeline + founder photo ────────────────────────────────────── */
.timeline { display: grid; gap: 18px; counter-reset: tl; }
.timeline li { display: grid; gap: 2px; padding-left: 20px; border-left: 3px solid var(--brand); }
.timeline .tl-when { font-weight: 800; color: var(--ink); font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; }
.timeline .tl-what { color: var(--ink-2); }
.founder-photo { border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.founder-photo-placeholder { display: grid; place-items: center; aspect-ratio: 1 / 1; max-width: 280px; border: 2px dashed var(--line); border-radius: var(--radius); background: var(--bg-soft); color: var(--muted); font-weight: 700; }

/* ── Utilities ──────────────────────────────────────────────────────────── */
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.stack > * + * { margin-top: 16px; }

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 960px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .price-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .nav-links { display: none; }
  .nav-toggle { display: inline-flex; }
  .nav.open .nav-links {
    display: flex; flex-direction: column; position: absolute; top: 64px; left: 0; right: 0;
    background: #fff; border-bottom: 1px solid var(--line); padding: 12px 24px; gap: 2px;
  }
  .nav.open .nav-links a { padding: 12px; }
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .price-grid { grid-template-columns: 1fr; }
  .tool-grid { grid-template-columns: 1fr; }
  .section { padding: 52px 0; }
  .cta-band { padding: 36px 22px; }
}
@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
