@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --ink:    #0f1419;
  --text:   #2a2f36;
  --muted:  #6b7280;
  --dim:    #a5acb6;
  --line:   #e5e8ec;
  --line-2: #f1f3f5;
  --bg:     #fafbfc;
  --paper:  #ffffff;
  --hover:  #f5f7f9;
  --accent: #003680;
  --accent-soft: #eef2f8;
  --warm:   #b25c00;
  --warm-soft: #fcf1e0;
  --good:   #0a7d50;
  --good-soft: #e8f4ee;
  --max-w:  1100px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 15px;
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line); transition: border-color .15s, color .15s; }
a:hover { color: var(--accent); border-bottom-color: var(--accent); }
img { max-width: 100%; height: auto; display: block; }
p { margin: 0 0 1em; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.015em; color: var(--ink); }

/* ── HEADER ─────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 18px 32px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.brand { display: flex; flex-direction: column; line-height: 1.2; border: none; }
.brand:hover { color: var(--ink); border: none; }
.brand-name { font-size: 14px; font-weight: 600; color: var(--ink); }
.brand-sub { font-size: 12px; color: var(--muted); }

.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 22px; }
.site-nav a {
  font-size: 13px; color: var(--muted);
  border: none; padding-bottom: 2px;
  border-bottom: 1px solid transparent;
}
.site-nav a:hover { color: var(--ink); border-bottom-color: var(--ink); }
.site-nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }
.nav-toggle {
  display: none; background: none; border: none;
  font-size: 13px; font-weight: 500; cursor: pointer; color: var(--ink); padding: 4px 8px;
}

/* ── INTRO ──────────────────────────────────── */
.intro {
  max-width: var(--max-w); margin: 0 auto;
  padding: 80px 32px 56px;
  position: relative;
}
.intro::before {
  content: ""; position: absolute; left: 32px; top: 80px;
  width: 3px; height: 56px; background: var(--accent);
}
.intro-kicker {
  font-size: 11px; color: var(--accent);
  letter-spacing: .08em; text-transform: uppercase;
  margin-bottom: 18px; padding-left: 18px;
  font-weight: 600;
}
.intro h1 {
  font-size: clamp(1.8rem, 3.4vw, 2.5rem);
  font-weight: 600; line-height: 1.18;
  letter-spacing: -0.025em;
  max-width: 780px;
  margin-bottom: 22px;
  padding-left: 18px;
}
.intro p.lead {
  font-size: 16px; color: var(--text); max-width: 660px;
  line-height: 1.65; margin-bottom: 32px;
  padding-left: 18px;
}
.intro-meta {
  display: flex; gap: 36px; flex-wrap: wrap;
  padding: 22px 0 0 18px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  margin-left: 0;
}
.intro-meta-row { display: flex; flex-direction: column; gap: 3px; }
.intro-meta-label {
  color: var(--muted); font-size: 11px;
  text-transform: uppercase; letter-spacing: .05em; font-weight: 500;
}
.intro-meta-val { color: var(--ink); font-weight: 500; }

/* ── SECTION ────────────────────────────────── */
.section {
  max-width: var(--max-w); margin: 0 auto;
  padding: 56px 32px;
}
.section-label {
  font-size: 11px; color: var(--accent);
  letter-spacing: .08em; text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 24px;
  display: flex; align-items: center; gap: 12px;
}
.section-label::before {
  content: ""; width: 28px; height: 2px; background: var(--accent);
}
.section h2 {
  font-size: clamp(1.35rem, 2.3vw, 1.65rem);
  font-weight: 600; margin-bottom: 12px; max-width: 720px;
}
.section .section-lead {
  font-size: 15px; color: var(--text); max-width: 620px; margin-bottom: 36px;
}

/* ── PROJECT LIST ───────────────────────────── */
.projects {
  display: flex; flex-direction: column;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}
.project {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 28px;
  padding: 26px 28px;
  border-top: 1px solid var(--line);
  align-items: start;
  transition: background .15s;
  position: relative;
}
.project:first-child { border-top: none; }
.project:hover { background: var(--hover); }
.project::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px; background: transparent; transition: background .15s;
}
.project:hover::before { background: var(--accent); }
.project-num {
  font-size: 13px; color: var(--accent);
  padding-top: 4px; font-variant-numeric: tabular-nums;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.project-body { min-width: 0; }
.project-title {
  font-size: 18px; font-weight: 600; margin-bottom: 6px;
  letter-spacing: -0.015em;
}
.project-desc {
  font-size: 14px; color: var(--text);
  line-height: 1.6; margin: 0 0 14px; max-width: 580px;
}
.project-tags {
  display: flex; flex-wrap: wrap; gap: 6px;
  font-size: 11px;
}
.project-tag {
  display: inline-flex; align-items: center;
  padding: 3px 8px;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 3px;
  font-weight: 500;
  letter-spacing: 0.02em;
}
.project-tag.warm { background: var(--warm-soft); color: var(--warm); }
.project-tag.good { background: var(--good-soft); color: var(--good); }

.project-actions {
  display: flex; flex-direction: column; gap: 8px;
  align-items: flex-end; padding-top: 2px;
}
.project-link {
  font-size: 13px; color: var(--ink);
  border-bottom: 1px solid var(--ink);
  padding-bottom: 1px;
  font-weight: 500;
}
.project-link:hover { color: var(--accent); border-bottom-color: var(--accent); }
.project-link.secondary { color: var(--muted); border-bottom-color: var(--line); font-weight: 400; }
.project-link.secondary:hover { color: var(--ink); border-bottom-color: var(--ink); }

/* ── PAGE HEAD (inner) ──────────────────────── */
.page-head {
  max-width: var(--max-w); margin: 0 auto;
  padding: 56px 32px 40px;
  position: relative;
}
.page-back {
  font-size: 12px; color: var(--muted); border: none;
  display: inline-flex; align-items: center; gap: 6px;
  margin-bottom: 28px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 500;
}
.page-back:hover { color: var(--accent); border: none; }
.page-head h1 {
  font-size: clamp(1.6rem, 2.8vw, 2.1rem);
  font-weight: 600; margin-bottom: 14px; max-width: 740px;
  letter-spacing: -0.025em;
}
.page-head .lead {
  font-size: 15px; color: var(--text); max-width: 660px;
  line-height: 1.65; margin: 0 0 26px;
}
.page-head .meta {
  display: flex; gap: 28px; flex-wrap: wrap;
  font-size: 12px; color: var(--muted);
  padding-top: 20px; border-top: 1px solid var(--line);
}
.page-head .meta > span { display: flex; flex-direction: column; gap: 3px; }
.page-head .meta strong {
  color: var(--accent); font-weight: 600;
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em;
}

/* ── CONTENT ────────────────────────────────── */
.content {
  max-width: var(--max-w); margin: 0 auto;
  padding: 24px 32px 64px;
}
.content h2 {
  font-size: 1.25rem; font-weight: 600; margin: 40px 0 16px;
  padding-bottom: 10px; border-bottom: 1px solid var(--line);
}
.content h3 {
  font-size: 14px; font-weight: 600; margin: 0 0 8px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.content p { color: var(--text); margin: 0 0 14px; max-width: 720px; }
.content ul { margin: 0 0 16px; padding-left: 20px; max-width: 720px; }
.content ul li { color: var(--text); margin-bottom: 5px; }
.content ul li strong { color: var(--ink); font-weight: 600; }

.cols-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px; margin: 24px 0; }
.cols-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin: 24px 0; }
.col {
  padding: 22px 24px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 4px;
  transition: border-color .15s;
}
.col:hover { border-color: var(--accent); }
.col h3 { margin-bottom: 10px; }
.col p, .col ul { font-size: 13.5px; }
.col p:last-child, .col ul:last-child { margin-bottom: 0; }

/* ── ACTIONS ────────────────────────────────── */
.actions { display: flex; gap: 14px; flex-wrap: wrap; margin: 24px 0; }
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 500;
  padding: 9px 18px;
  border-radius: 3px;
  background: var(--ink); color: #fff;
  border: 1px solid var(--ink);
  transition: all .15s;
}
.btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-ghost {
  background: transparent; color: var(--ink); border-color: var(--line);
}
.btn-ghost:hover { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.btn-accent { background: var(--accent); border-color: var(--accent); }
.btn-accent:hover { background: var(--ink); border-color: var(--ink); }

/* ── FRAMES ─────────────────────────────────── */
.frame {
  border: 1px solid var(--line);
  background: var(--paper);
  margin: 24px 0;
  overflow: hidden;
  border-radius: 4px;
}
.frame img { display: block; }
.frame-caption {
  padding: 12px 18px;
  font-size: 12px; color: var(--muted);
  border-top: 1px solid var(--line);
  background: var(--line-2);
}

.tco-frame {
  border: 1px solid var(--line);
  margin: 24px 0;
  border-radius: 4px;
  overflow: hidden;
  background: var(--paper);
}
.tco-frame iframe { display: block; width: 100%; border: none; height: 860px; }

/* ── MATURITY ───────────────────────────────── */
.levels { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin: 20px 0 36px; }
.level {
  padding: 16px 16px 18px;
  border-top: 2px solid var(--line);
  background: var(--paper);
  border-radius: 0 0 4px 4px;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.level.on { border-top-color: var(--accent); background: var(--accent-soft); }
.level-n { font-size: 11px; color: var(--muted); font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase; }
.level-name { font-size: 14px; font-weight: 600; margin: 5px 0 6px; }
.level.on .level-name { color: var(--accent); }
.level-d { font-size: 12px; color: var(--muted); line-height: 1.5; }

.domains {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0 32px; margin: 8px 0 28px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 4px; padding: 4px 24px;
}
.domain {
  padding: 14px 0; border-bottom: 1px solid var(--line);
  display: grid; grid-template-columns: 1fr 140px auto; gap: 16px; align-items: center;
}
.domain:last-child, .domain:nth-last-child(2) { border-bottom: none; }
.domain-name { font-size: 14px; color: var(--ink); }
.domain-bar {
  height: 6px; background: var(--line-2); border-radius: 3px; position: relative; overflow: hidden;
}
.domain-bar-fill {
  position: absolute; top: 0; left: 0; height: 100%;
  background: var(--accent); border-radius: 3px;
}
.domain-score {
  font-size: 14px; color: var(--ink); font-variant-numeric: tabular-nums;
  font-weight: 600; min-width: 32px; text-align: right;
}

/* ── AI CHAT ────────────────────────────────── */
.chat {
  border: 1px solid var(--line); padding: 0;
  margin: 24px 0; max-width: 740px;
  background: var(--paper);
  border-radius: 4px;
  overflow: hidden;
}
.chat-row {
  padding: 18px 22px;
  border-bottom: 1px solid var(--line-2);
}
.chat-row:last-child { border-bottom: none; }
.chat-row.user { background: var(--line-2); }
.chat-from {
  font-size: 11px; color: var(--muted);
  letter-spacing: .05em; margin-bottom: 6px;
  text-transform: uppercase; font-weight: 600;
}
.chat-row.user .chat-from { color: var(--accent); }
.chat-text { font-size: 14px; color: var(--ink); line-height: 1.7; }
.chat-text strong { font-weight: 600; color: var(--ink); }
.chat-text code {
  background: var(--accent-soft); color: var(--accent);
  padding: 1px 6px; border-radius: 3px;
  font-size: 12.5px; font-family: ui-monospace, "SF Mono", Menlo, monospace;
}
.chat-row.user .chat-text { color: var(--text); }

/* ── FOOTER ─────────────────────────────────── */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding: 24px 32px;
  font-size: 12px; color: var(--muted);
  background: var(--paper);
}
.footer-inner {
  max-width: var(--max-w); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px;
}
.footer-inner a { color: var(--muted); border-bottom-color: var(--line); }
.footer-inner a:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* ── RESPONSIVE ─────────────────────────────── */
@media (max-width: 760px) {
  .header-inner, .intro, .section, .page-head, .content, .footer-inner { padding-left: 22px; padding-right: 22px; }
  .intro::before { left: 22px; }
  .site-nav {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    background: #fff; border-bottom: 1px solid var(--line);
    padding: 14px 22px;
  }
  .site-nav.is-open { display: block; }
  .site-nav ul { flex-direction: column; gap: 14px; }
  .nav-toggle { display: block; }
  .project { grid-template-columns: 48px 1fr; gap: 14px; padding: 22px 20px; }
  .project-actions { grid-column: 2; flex-direction: row; align-items: flex-start; margin-top: 6px; }
  .cols-2, .cols-3 { grid-template-columns: 1fr; gap: 14px; }
  .levels { grid-template-columns: 1fr 1fr; }
  .domains { grid-template-columns: 1fr; padding: 4px 18px; }
  .tco-frame iframe { height: 700px; }
}
