/* NagareOps Phase 0 scaffold styles — intentionally minimal. */

:root {
  --bg: #f6f5f0;
  --surface: #ffffff;
  --ink: #1a1d1e;
  --ink-soft: #4a4f52;
  --line: #e3e1d8;
  --accent: #0f6e5a;      /* deep teal — water/flow */
  --accent-ink: #ffffff;
  --accent-soft: #e6f2ee;
  --warn-bg: #fff7e6;
  --warn-bd: #f0d591;
  --error-bg: #fdecea;
  --error-bd: #f0a8a3;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 4px 12px rgba(0,0,0,.06);
  --radius: 8px;
  --max: 1100px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { color: var(--ink); line-height: 1.2; margin: 0 0 .5rem; }
h1 { font-size: 2.5rem; letter-spacing: -.02em; }
h2 { font-size: 1.75rem; letter-spacing: -.01em; }
h3 { font-size: 1rem; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-soft); }

/* ── Header ────────────────────────────────────────────── */
.site-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 2rem;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.brand { display: flex; align-items: center; gap: .5rem; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-mark {
  font-size: 1.5rem; font-weight: 700;
  color: var(--accent);
  font-family: 'Hiragino Mincho ProN', 'Yu Mincho', serif;
}
.brand-name { font-weight: 600; letter-spacing: -.01em; }
.site-nav { display: flex; gap: 1.5rem; font-size: .95rem; }
.site-nav a { color: var(--ink-soft); }
.site-nav a:hover { color: var(--accent); text-decoration: none; }

/* ── Hero ──────────────────────────────────────────────── */
.site-main { min-height: calc(100vh - 140px); }
.hero {
  padding: 6rem 2rem 4rem;
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--line);
}
.hero-inner { max-width: var(--max); margin: 0 auto; text-align: center; }
.hero-sub { font-size: 1.2rem; color: var(--ink-soft); max-width: 640px; margin: 1rem auto 2rem; }
.hero-ctas { display: inline-flex; gap: .75rem; }
.hero-note { margin-top: 2rem; font-size: .8rem; color: var(--ink-soft); opacity: .7; }

/* ── Buttons ───────────────────────────────────────────── */
.btn {
  display: inline-block; padding: .7rem 1.4rem; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font-weight: 600; font-size: .95rem; cursor: pointer; text-decoration: none;
  transition: transform .08s ease, box-shadow .15s ease, background .15s ease;
}
.btn:hover { text-decoration: none; box-shadow: var(--shadow); transform: translateY(-1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn-primary:hover { background: #0b5a4a; }
.btn-ghost { background: transparent; }

/* ── Sections ──────────────────────────────────────────── */
.section { padding: 4rem 2rem; max-width: var(--max); margin: 0 auto; }
.section-alt { background: var(--surface); max-width: none; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-alt > * { max-width: var(--max); margin-left: auto; margin-right: auto; }
.section-head { text-align: center; margin-bottom: 2.5rem; }
.section-sub { color: var(--ink-soft); margin: 0; }
.section-cta { text-align: center; padding: 4rem 2rem; }
.section-cta p { color: var(--ink-soft); margin: .5rem 0 1.5rem; }

/* ── Product grid ──────────────────────────────────────── */
.tier-block { margin-bottom: 3rem; }
.tier-label { margin-bottom: 1rem; }
.product-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}
.product-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.25rem;
  display: flex; flex-direction: column; gap: .5rem;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.product-card:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.product-card.phase-1 { border-left: 3px solid var(--accent); }
.product-card.phase-2 { border-left: 3px solid #c4a94d; }
.product-card.phase-3 { border-left: 3px solid #999; }
.product-head { display: flex; align-items: center; justify-content: space-between; }
.product-name { font-weight: 600; font-size: 1.05rem; }
.product-phase {
  font-size: .7rem; letter-spacing: .05em; text-transform: uppercase;
  color: var(--ink-soft); background: var(--accent-soft); padding: .15rem .5rem;
  border-radius: 999px;
}
.product-card.phase-2 .product-phase { background: #fbf4dd; }
.product-card.phase-3 .product-phase { background: #eee; }
.product-blurb { color: var(--ink-soft); font-size: .9rem; flex-grow: 1; margin: 0; }
.product-foot { display: flex; justify-content: space-between; align-items: center; margin-top: .5rem; padding-top: .5rem; border-top: 1px solid var(--line); font-size: .85rem; }
.product-price { color: var(--ink-soft); }
.product-link { font-weight: 600; }
.product-link-muted { color: var(--ink-soft); font-weight: 400; }

/* ── Bundles ───────────────────────────────────────────── */
.bundle-list {
  max-width: 900px; margin: 0 auto;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden;
}
.bundle-row {
  display: grid; grid-template-columns: 1.2fr 2fr 1fr;
  padding: .9rem 1.25rem; gap: 1rem;
  border-bottom: 1px solid var(--line);
  font-size: .95rem;
}
.bundle-row:last-child { border-bottom: none; }
.bundle-head { background: var(--surface); font-weight: 600; font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-soft); }
.bundle-highlight { background: var(--accent-soft); font-weight: 600; }

/* ── Forms ─────────────────────────────────────────────── */
.form-page { max-width: 720px; margin: 3rem auto; padding: 0 2rem; }
.form-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 2rem; box-shadow: var(--shadow); }
.form-sub { color: var(--ink-soft); margin: 0 0 1.5rem; }
.form-notice { background: var(--accent-soft); border: 1px solid #bbd9cf; padding: .75rem 1rem; border-radius: var(--radius); margin-bottom: 1.5rem; font-size: .9rem; }
.form-error { background: var(--error-bg); border: 1px solid var(--error-bd); padding: .75rem 1rem; border-radius: var(--radius); margin-bottom: 1.5rem; font-size: .9rem; }
.stacked-form { display: flex; flex-direction: column; gap: 1rem; margin-top: 1.5rem; }
.stacked-form label { display: flex; flex-direction: column; gap: .35rem; font-size: .9rem; font-weight: 500; }
.stacked-form input,
.stacked-form select,
.stacked-form textarea {
  padding: .65rem .8rem; border: 1px solid var(--line); border-radius: var(--radius);
  font: inherit; background: var(--surface); color: var(--ink);
}
.stacked-form input:focus,
.stacked-form select:focus,
.stacked-form textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.form-actions { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-top: .5rem; }
.form-hint { font-size: .8rem; color: var(--ink-soft); }

/* ── Draft preview ─────────────────────────────────────── */
.draft-preview {
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1rem 1.25rem; margin: 1rem 0 1.5rem;
  font-size: .9rem;
}
.draft-row { display: flex; gap: 1rem; padding: .5rem 0; border-bottom: 1px dashed var(--line); }
.draft-row:last-child { border-bottom: none; }
.draft-row-stack { flex-direction: column; gap: .3rem; }
.draft-label { font-weight: 600; color: var(--ink-soft); min-width: 80px; }
.draft-preview pre { white-space: pre-wrap; margin: 0; font-family: inherit; font-size: .9rem; color: var(--ink); }

/* ── Product page header ───────────────────────────────── */
.product-header { margin-bottom: 1.5rem; }
.product-header .product-phase { display: inline-block; margin-bottom: .5rem; }

/* ── Draft output ──────────────────────────────────────── */
.draft-output {
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1rem 1.25rem; margin: 0 0 1rem;
}
.draft-output pre {
  white-space: pre-wrap; margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: .85rem; color: var(--ink); line-height: 1.55;
}

/* ── Provider tag ──────────────────────────────────────── */
.provider-tag {
  display: inline-block; margin-left: .5rem;
  font-size: .7rem; letter-spacing: .06em; text-transform: uppercase;
  padding: .1rem .5rem; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent);
}
.provider-stub { background: #eee; color: var(--ink-soft); }

/* ── Empty state ───────────────────────────────────────── */
.empty-state { text-align: center; padding: 6rem 2rem; }
.empty-state h1 { font-size: 3rem; }

/* ── Footer ────────────────────────────────────────────── */
.site-footer { background: var(--surface); border-top: 1px solid var(--line); padding: 1.5rem 2rem; }
.footer-row { max-width: var(--max); margin: 0 auto; display: flex; justify-content: center; align-items: center; gap: .75rem; font-size: .85rem; color: var(--ink-soft); flex-wrap: wrap; }
.footer-sep { opacity: .4; }

/* ── Mobile ────────────────────────────────────────────── */
@media (max-width: 640px) {
  .site-header { padding: 1rem; }
  .site-nav { gap: 1rem; }
  .hero { padding: 3.5rem 1rem 2.5rem; }
  h1 { font-size: 1.9rem; }
  h2 { font-size: 1.4rem; }
  .section { padding: 3rem 1rem; }
  .bundle-row { grid-template-columns: 1fr; }
  .bundle-head { display: none; }
  .bundle-row { padding: 1rem 1.25rem; }
  .form-page { margin: 1.5rem auto; padding: 0 1rem; }
  .form-card { padding: 1.25rem; }
}

/* ── Drafts table ──────────────────────────────────────── */
.drafts-table { width: 100%; border-collapse: collapse; margin-top: .5rem; font-size: .9rem; }
.drafts-table th, .drafts-table td { text-align: left; padding: .6rem .5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.drafts-table th { font-weight: 600; color: var(--ink-soft); font-size: .8rem; letter-spacing: .04em; text-transform: uppercase; }
.drafts-table tr:last-child td { border-bottom: none; }
.drafts-table a { color: var(--accent); text-decoration: none; font-weight: 500; }
.drafts-table a:hover { text-decoration: underline; }
.draft-preview-cell { max-width: 360px; color: var(--ink-soft); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .8rem; }
.nowrap { white-space: nowrap; color: var(--ink-soft); font-size: .8rem; }

/* ── Inline email form ─────────────────────────────────── */
.inline-form { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.inline-form input[type="email"] { flex: 1; min-width: 220px; padding: .55rem .7rem; border: 1px solid var(--line); border-radius: 6px; font: inherit; }

/* ── Draft inputs disclosure ───────────────────────────── */
.draft-inputs summary { cursor: pointer; color: var(--ink-soft); font-size: .85rem; padding: .5rem 0; }
.draft-inputs[open] summary { margin-bottom: .5rem; }

/* ── Pricing + checkout ────────────────────────────────── */
.hero-compact { padding: 3rem 1rem 2rem; }
.section-narrow { max-width: 640px; margin: 0 auto; }
.prose { line-height: 1.65; color: var(--ink); margin: 0 0 1rem; }

.price-suite {
  max-width: 720px; margin: 0 auto;
  background: linear-gradient(135deg, var(--night-stone-1, #3A3F4A), var(--night-stone-2, #1B1F28));
  color: var(--ink, #EDE6D3);
  padding: 2rem; border-radius: 12px;
  border: 1px solid var(--line, rgba(237,230,211,.12));
}
.price-suite-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: .75rem; gap: 1rem; flex-wrap: wrap; }
.price-suite-name { font-size: 1.35rem; font-weight: 600; }
.price-suite-amt { font-size: 1.6rem; font-weight: 700; color: var(--accent, #D63B2A); }
.price-suite-desc { opacity: .85; margin: 0 0 1.25rem; }

.price-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; max-width: 1080px; margin: 0 auto; }
.price-grid-compact { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

.price-card {
  border: 1px solid var(--line, rgba(237,230,211,.12));
  border-radius: 10px;
  padding: 1.1rem 1.2rem;
  background: var(--panel, rgba(237,230,211,.03));
  display: flex; flex-direction: column; gap: .5rem;
}
.price-card-head { display: flex; justify-content: space-between; align-items: baseline; gap: .75rem; }
.price-card-name { font-weight: 600; font-size: 1.05rem; }
.price-card-amt { font-weight: 700; color: var(--accent, #D63B2A); white-space: nowrap; }
.price-card-grants { font-size: .82rem; color: var(--ink-soft, #C8D2DE); letter-spacing: .02em; }
.price-card-desc { font-size: .9rem; color: var(--ink, #EDE6D3); opacity: .82; flex: 1; line-height: 1.5; }
.price-card .btn { align-self: flex-start; }

/* ── Forms ─────────────────────────────────────────────── */
.form-stack { display: flex; flex-direction: column; gap: 1rem; margin: 1rem 0; }
.form-stack .form-label { display: flex; flex-direction: column; gap: .35rem; font-weight: 500; font-size: .9rem; }
.form-stack input[type="email"], .form-stack input[type="text"] { padding: .7rem .85rem; border: 1px solid var(--line); border-radius: 6px; font: inherit; }
.form-help { font-size: .85rem; color: var(--ink-soft); }
.btn-sm { padding: .35rem .8rem; font-size: .85rem; }

.error-box { padding: .85rem 1rem; border: 1px solid #D63B2A; background: rgba(214,59,42,.08); color: #D63B2A; border-radius: 6px; margin-bottom: 1rem; }
.success-box { padding: .85rem 1rem; border: 1px solid rgba(91,110,74,.5); background: rgba(91,110,74,.08); border-radius: 6px; margin-bottom: 1rem; }
.info-box { padding: .85rem 1rem; border: 1px solid var(--line); background: rgba(200,210,222,.05); border-radius: 6px; margin-bottom: 1rem; }

/* ── Account entitlements ──────────────────────────────── */
.entitlement-list { max-width: 900px; margin: 0 auto; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.entitlement-row { display: grid; grid-template-columns: 1.3fr .8fr 1.4fr .8fr; gap: .75rem; padding: .8rem 1rem; border-bottom: 1px solid var(--line); align-items: center; }
.entitlement-row:last-child { border-bottom: none; }
.entitlement-head { background: rgba(200,210,222,.05); font-weight: 600; font-size: .82rem; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-soft); }
.ent-name { font-weight: 600; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .88rem; }
.ent-status { display: inline-block; padding: .15rem .55rem; border-radius: 4px; font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.ent-status-active { background: rgba(91,110,74,.15); color: #5B6E4A; }
.ent-status-expired, .ent-status-used, .ent-status-revoked { background: rgba(214,59,42,.1); color: #D63B2A; }
.ent-summary { font-size: .88rem; color: var(--ink-soft); }

@media (max-width: 640px) {
  .entitlement-row { grid-template-columns: 1fr; gap: .35rem; padding: .9rem 1rem; }
  .entitlement-head { display: none; }
}
