/* selfloom.ai — editorial portfolio */
@import url('https://fonts.googleapis.com/css2?family=Newsreader:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500&display=swap');

:root {
  --ink: #1a1c1e;
  --ink-soft: #2c2e30;
  --muted: #6b6c70;
  --soft: #9a9a9c;
  --line: #d8d6d0;
  --line-soft: #e8e6e0;
  --bg: #f7f5f0;
  --code-bg: #ece9e0;
  --max: 1100px;
  --read: 720px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 16.5px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--ink); color: var(--bg); }

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 96px 48px 128px;
}

a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
  transition: text-decoration-color 0.18s ease, color 0.18s ease;
}

a:hover { text-decoration-color: var(--ink); }

/* === HERO === */
.hero { margin-bottom: 120px; }

.kicker {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 40px;
  font-weight: 400;
}

h1 {
  font-family: 'Newsreader', Georgia, serif;
  font-size: clamp(56px, 9vw, 104px);
  font-weight: 500;
  letter-spacing: -0.025em;
  margin-bottom: 40px;
  line-height: 1.02;
  color: var(--ink);
  max-width: 1000px;
}

.lede {
  font-family: 'Newsreader', Georgia, serif;
  font-size: 23px;
  line-height: 1.5;
  color: var(--ink-soft);
  margin-bottom: 36px;
  font-weight: 400;
  max-width: var(--read);
  letter-spacing: -0.005em;
}

.now {
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink-soft);
  margin-bottom: 44px;
  max-width: var(--read);
  padding: 0;
  border: none;
  background: none;
}

.now-label {
  display: inline;
  font-family: 'Newsreader', Georgia, serif;
  font-style: italic;
  color: var(--ink);
  font-weight: 500;
  font-size: 16px;
  letter-spacing: normal;
  text-transform: none;
  margin-bottom: 0;
}

.now-label::after { content: " — "; color: var(--soft); font-style: normal; }

.contact {
  list-style: none;
  display: flex;
  gap: 28px;
  font-size: 14px;
  color: var(--muted);
  margin-top: 8px;
}

.contact a { color: var(--muted); }
.contact a:hover { color: var(--ink); }

/* === SECTIONS === */
section { margin-bottom: 120px; }

h2 {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 36px;
  padding-bottom: 0;
  border-bottom: none;
  display: flex;
  align-items: center;
  gap: 16px;
}

h2::before {
  content: "";
  display: inline-block;
  width: 28px;
  height: 1px;
  background: var(--ink);
  flex-shrink: 0;
}

.section-note {
  font-family: 'Newsreader', Georgia, serif;
  font-size: 18px;
  line-height: 1.55;
  color: var(--muted);
  margin-bottom: 64px;
  margin-top: -20px;
  max-width: var(--read);
  font-style: italic;
}

/* === PROJECT CARDS (magazine list) === */
.cards {
  list-style: none;
  counter-reset: card-counter;
  display: flex;
  flex-direction: column;
}

.card {
  counter-increment: card-counter;
  border-top: 1px solid var(--line);
  background: transparent;
  border-radius: 0;
  transition: background-color 0.2s ease;
}

.card:last-child { border-bottom: 1px solid var(--line); }

.card:hover { background-color: rgba(26, 28, 30, 0.025); }

.card-link {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 32px;
  padding: 56px 0 52px;
  text-decoration: none;
  color: var(--ink);
}

.card-link:hover { color: var(--ink); }

/* CRITICAL FIX: force every real child of card-link into column 2.
   Without this rule, grid auto-flow drops <h3>, <p>, <ul> etc. into
   the 80px number column on subsequent rows, producing one-glyph-per-row
   vertical stripes. */
.card-link > * { grid-column: 2; }

.card-link::before {
  content: counter(card-counter, decimal-leading-zero);
  font-family: 'Newsreader', Georgia, serif;
  font-size: 32px;
  font-weight: 400;
  font-style: italic;
  color: var(--soft);
  font-feature-settings: "lnum";
  line-height: 1;
  padding-top: 10px;
  transition: color 0.2s ease;
  grid-column: 1;
  grid-row: 1;
  align-self: start;
}

.card:hover .card-link::before { color: var(--ink); }

.card-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 14px;
}

.card h3 {
  font-family: 'Newsreader', Georgia, serif;
  font-size: 36px;
  font-weight: 500;
  letter-spacing: -0.02em;
  margin-bottom: 22px;
  line-height: 1.15;
  color: var(--ink);
  max-width: 800px;
}

.card-body {
  font-size: 16.5px;
  line-height: 1.6;
  color: var(--ink-soft);
  margin-bottom: 20px;
  max-width: var(--read);
}

.card-output {
  font-family: 'Newsreader', Georgia, serif;
  font-size: 16px;
  line-height: 1.55;
  color: var(--muted);
  background: none;
  border-left: 2px solid var(--ink);
  padding: 4px 0 4px 18px;
  border-radius: 0;
  margin-bottom: 22px;
  max-width: var(--read);
  font-style: italic;
}

.card-output strong {
  color: var(--ink);
  font-weight: 600;
  font-style: normal;
  font-family: 'Inter', sans-serif;
  font-size: 14.5px;
  letter-spacing: 0.01em;
}

.card-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
  max-width: var(--read);
}

.card-stack span {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 400;
  color: var(--muted);
  background: var(--code-bg);
  padding: 4px 10px;
  border-radius: 0;
  letter-spacing: 0.02em;
  white-space: nowrap;
  display: inline-block;
}

.card-cta {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink);
  margin-top: 6px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: letter-spacing 0.2s ease;
}

.card:hover .card-cta { letter-spacing: 0.14em; }

/* === BACKGROUND === */
.bg-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 32px;
  margin-top: 0;
}

.bg-list li {
  font-size: 16.5px;
  line-height: 1.6;
  color: var(--ink-soft);
  max-width: 760px;
}

.bg-list strong {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--ink);
  text-transform: uppercase;
}

/* === FOOTER === */
.foot {
  margin-top: 128px;
  padding-top: 36px;
  border-top: 1px solid var(--line);
  font-size: 14px;
  color: var(--muted);
  max-width: 760px;
}

.foot p { margin-bottom: 14px; max-width: 720px; }

.foot p:first-child {
  font-family: 'Newsreader', Georgia, serif;
  font-size: 17px;
  font-style: italic;
  color: var(--ink-soft);
  margin-bottom: 24px;
  line-height: 1.55;
}

.foot-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--soft);
  letter-spacing: 0.04em;
}

.foot a { color: var(--muted); }
.foot a:hover { color: var(--ink); }

/* === PROJECT DETAIL PAGES === */
.detail .wrap { max-width: var(--max); }

.back-link {
  display: inline-block;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 64px;
  text-decoration: none;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 500;
}

.back-link:hover { color: var(--ink); }

.detail h1 {
  font-family: 'Newsreader', Georgia, serif;
  font-size: clamp(40px, 6.5vw, 72px);
  font-weight: 500;
  letter-spacing: -0.022em;
  margin-bottom: 16px;
  line-height: 1.05;
  max-width: none;
}

.detail .subtitle {
  font-family: 'Newsreader', Georgia, serif;
  font-size: 18px;
  font-style: italic;
  color: var(--muted);
  margin-bottom: 72px;
}

.detail h2 {
  font-family: 'Newsreader', Georgia, serif;
  font-size: 32px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: -0.018em;
  color: var(--ink);
  margin-top: 80px;
  margin-bottom: 24px;
  padding-bottom: 0;
  border-bottom: none;
  display: block;
  gap: 0;
  max-width: 760px;
}

.detail h2::before { content: none; display: none; }

.detail h3 {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 600;
  margin-top: 44px;
  margin-bottom: 14px;
  color: var(--ink);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  max-width: 760px;
}

.detail p {
  font-size: 17.5px;
  line-height: 1.7;
  margin-bottom: 24px;
  max-width: 720px;
  color: var(--ink-soft);
}

.detail ul, .detail ol {
  font-size: 17.5px;
  line-height: 1.7;
  margin-bottom: 26px;
  padding-left: 28px;
  max-width: 720px;
  color: var(--ink-soft);
}

.detail li { margin-bottom: 8px; }

.detail blockquote {
  border-left: 2px solid var(--ink);
  padding: 4px 0 4px 24px;
  margin: 36px 0;
  font-family: 'Newsreader', Georgia, serif;
  font-style: italic;
  font-size: 20px;
  color: var(--ink-soft);
  max-width: 720px;
  line-height: 1.55;
}

.detail code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  background: var(--code-bg);
  padding: 2px 6px;
  border-radius: 0;
  color: var(--ink);
}

.detail pre {
  background: var(--code-bg);
  padding: 24px 28px;
  border-radius: 0;
  overflow-x: auto;
  margin: 32px 0;
  max-width: 760px;
  border-left: 2px solid var(--ink);
}

.detail pre code {
  background: none;
  padding: 0;
  font-size: 13.5px;
  line-height: 1.6;
}

.detail em { font-style: italic; color: var(--ink); }
.detail strong { font-weight: 600; color: var(--ink); }

.detail a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--soft);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.detail a:hover { text-decoration-color: var(--ink); }

.detail .callout {
  background: none;
  border-left: 2px solid var(--ink);
  padding: 4px 0 4px 24px;
  margin: 36px 0;
  font-family: 'Newsreader', Georgia, serif;
  font-size: 18px;
  font-style: italic;
  border-radius: 0;
  max-width: 720px;
  color: var(--ink-soft);
}

.detail .callout strong { color: var(--ink); font-style: normal; font-family: 'Inter', sans-serif; font-size: 14.5px; }

.detail .ascii {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  line-height: 1.5;
  background: var(--code-bg);
  padding: 24px 28px;
  border-radius: 0;
  white-space: pre;
  overflow-x: auto;
  margin: 32px 0;
  border-left: 2px solid var(--ink);
}

/* === MOBILE === */
@media (max-width: 720px) {
  .wrap { padding: 56px 24px 80px; }
  h1 { font-size: 52px; }
  .lede { font-size: 19px; }
  .now { font-size: 15.5px; }
  .card-link {
    grid-template-columns: 40px 1fr;
    gap: 18px;
    padding: 36px 0;
  }
  .card-link::before { font-size: 22px; padding-top: 4px; }
  .card h3 { font-size: 26px; }
  .card-body, .card-output { font-size: 15.5px; }
  .contact { flex-wrap: wrap; gap: 16px; }
  .detail h1 { font-size: 38px; }
  .detail h2 { font-size: 26px; margin-top: 60px; }
  .detail p, .detail ul, .detail ol { font-size: 16.5px; line-height: 1.65; }
  section, .hero { margin-bottom: 80px; }
  .foot { margin-top: 80px; }
}
