/* Tilder — public case-study page. Standalone, local-only. */

:root {
  --purple: #4A1F5C;
  --purple-deep: #2E1339;
  --purple-deepest: #1F0D29;
  --accent: #E85D2C;
  --cream: #FBF4E4;
  --bg: #F5F1EA;
  --success: #1FB36B;
  --ink: #2A2130;
  --ink-soft: #6B5F72;
  --line: rgba(74, 31, 92, 0.14);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --shadow: 0 24px 60px -30px rgba(46, 19, 57, 0.35);
  --shadow-sm: 0 10px 28px -16px rgba(46, 19, 57, 0.28);
  --max: 1160px;
  font-size: 16px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 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;
}

img { max-width: 100%; display: block; }

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

@media (max-width: 640px) {
  .wrap { padding: 0 20px; }
}

/* ---------- Top bar ---------- */

.topbar {
  padding-top: 6px;
  padding-bottom: 0;
}

.topbar .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-left: 16px;
  padding-right: 16px;
}

@media (max-width: 640px) {
  .topbar { padding-bottom: 0; }
  .topbar .wrap { padding-left: 6px; padding-right: 10px; }
}

.topbar-lockup {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar-badge {
  height: 168px;
  width: auto;
  display: block;
}

@media (max-width: 640px) {
  .topbar-badge { height: 120px; }
}

.topbar-tag {
  font-size: 13px;
  font-weight: 600;
  color: var(--purple);
  background: rgba(74, 31, 92, 0.08);
  padding: 6px 14px;
  border-radius: 999px;
  letter-spacing: 0.02em;
}

/* ---------- Section rhythm ---------- */

section {
  padding: 88px 0;
}

@media (max-width: 780px) {
  section { padding: 60px 0; }
}

.section-dark {
  background: var(--purple-deepest);
  color: #F3ECF6;
}

.eyebrow {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 14px;
}

h1, h2, h3 {
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0;
}

h2 {
  font-size: clamp(28px, 3.6vw, 40px);
  line-height: 1.18;
  color: var(--purple);
  max-width: 20ch;
}

.section-dark h2 { color: #fff; }

p { margin: 0; }

.lede {
  font-size: 19px;
  color: var(--ink-soft);
  max-width: 62ch;
}

.section-dark .lede { color: rgba(243, 236, 246, 0.78); }

.body-copy {
  font-size: 17px;
  color: var(--ink-soft);
  max-width: 62ch;
}

.body-copy + .body-copy { margin-top: 16px; }

.section-dark .body-copy { color: rgba(243, 236, 246, 0.78); }

.strong-line {
  font-size: 20px;
  font-weight: 700;
  color: var(--purple);
}

.section-dark .strong-line { color: #fff; }

/* ---------- Hero ---------- */

.hero {
  padding-top: 24px;
  padding-bottom: 96px;
}

.hero .wrap {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 56px;
  align-items: center;
}

@media (max-width: 900px) {
  .hero .wrap {
    grid-template-columns: 1fr;
    gap: 40px;
  }
}

.hero-wordmark {
  height: 46px;
  margin-bottom: 28px;
}

.hero h1 {
  font-size: clamp(40px, 6vw, 60px);
  color: var(--purple);
  line-height: 1.02;
}

.hero-statement {
  font-size: clamp(19px, 2.2vw, 23px);
  font-weight: 600;
  color: var(--ink);
  margin-top: 28px;
  max-width: 39ch;
  line-height: 1.5;
}

.hero-support {
  margin-top: 26px;
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink-soft);
  max-width: 46ch;
}

.hero-meta {
  margin-top: 34px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pill {
  display: inline-block;
  font-size: 13.5px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--cream);
  border: 1px solid var(--line);
  color: var(--purple);
}

.hero-role {
  margin-top: 32px;
  font-size: 14.5px;
  color: var(--ink-soft);
  border-left: 3px solid var(--accent);
  padding-left: 14px;
  max-width: 44ch;
}

.hero-role strong { color: var(--purple); }

.hero-visual { display: flex; justify-content: center; }

/* ---------- Phone frame ---------- */

.phone {
  position: relative;
  width: 100%;
  max-width: 300px;
  background: linear-gradient(160deg, rgba(58,26,68,0.5), rgba(31,13,41,0.5) 18%, rgba(31,13,41,0.5) 82%, rgba(23,10,28,0.5));
  border-radius: 32px;
  padding: 18px 8px 12px;
  box-shadow: var(--shadow), inset 0 0 0 1.5px rgba(255,255,255,0.08), inset 0 0 0 4px rgba(0,0,0,0.12);
}

.phone img {
  position: relative;
  border-radius: 16px;
  width: 100%;
  display: block;
}

.phone::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 50%;
  transform: translateX(-50%);
  width: 26%;
  height: 12px;
  background: rgba(5,2,8,0.5);
  border-radius: 7px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.05);
  z-index: 2;
}

.phone::after {
  content: "";
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 28%;
  height: 3px;
  background: rgba(255,255,255,0.3);
  border-radius: 4px;
  z-index: 2;
}

.phone.phone-lg { max-width: 320px; }
.phone.phone-sm { max-width: 220px; }

.phone-caption {
  text-align: center;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-soft);
  margin-top: 14px;
}

/* ---------- Flow (Product section) ---------- */

.flow-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 40px 0 48px;
  padding: 18px 22px;
  background: var(--cream);
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
}

.flow-step {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--purple);
  padding: 8px 14px;
  white-space: nowrap;
}

.flow-arrow {
  color: var(--accent);
  font-weight: 700;
}

.shot-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
  align-items: end;
}

@media (max-width: 980px) {
  .shot-row { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
  .shot-row { grid-template-columns: 1fr; max-width: 320px; margin: 0 auto; }
}

.shot-cell { display: flex; flex-direction: column; align-items: center; }

.goal-line {
  margin-top: 44px;
  text-align: center;
}

.goal-line .body-copy { margin: 0 auto; text-align: center; }

.goal-final {
  font-size: clamp(22px, 2.8vw, 28px);
  font-weight: 700;
  color: var(--purple);
  margin-top: 10px;
}

/* ---------- What I built ---------- */

.metrics {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  margin: 40px 0 48px;
  align-items: start;
}

@media (max-width: 900px) {
  .metrics { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 560px) {
  .metrics { grid-template-columns: repeat(2, 1fr); }
}

.metric-tile {
  background: var(--purple);
  color: #fff;
  border-radius: var(--radius-md);
  padding: 22px 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 104px;
}

.metric-tile .num {
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 800;
  letter-spacing: -0.01em;
}

.metric-tile .label {
  margin-top: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.3;
}

.metric-tile:nth-child(2n) { background: var(--accent); }

/* Dictionary source-entries tile: kept a subtle accent ring, sized to match the other tiles. */
.metric-tile:last-child {
  box-shadow: 0 0 0 3px rgba(232, 93, 44, 0.24);
}

.metric-tile:last-child .label {
  font-size: 11px;
  letter-spacing: -0.005em;
}

.disclaimer {
  margin-top: 30px;
  padding: 16px 20px;
  border-left: 3px solid var(--accent);
  background: var(--cream);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 15px;
  color: var(--ink-soft);
}

/* ---------- Architecture ---------- */

.arch {
  margin-top: 52px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.arch-row {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
}

.arch-box {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-md);
  padding: 24px 26px;
  min-width: 230px;
  flex: 1 1 230px;
  max-width: 380px;
}

.arch-box h4 {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
}

.arch-box p {
  font-size: 16px;
  line-height: 1.5;
  color: rgba(243, 236, 246, 0.7);
}

.arch-box.wide { max-width: 100%; flex-basis: 100%; }

.arch-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.arch-chip {
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 13px 14px;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
}

.arch-chip span {
  display: block;
  font-weight: 400;
  color: rgba(243, 236, 246, 0.62);
  font-size: 14px;
  margin-top: 3px;
}

.arch-arrow {
  color: var(--accent);
  font-size: 26px;
  margin: 12px 0;
  line-height: 1;
}

.arch-note {
  font-size: 14.5px;
  color: rgba(243, 236, 246, 0.6);
  margin-top: 8px;
  text-align: center;
}

.arch-services {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 14px;
}

.arch-service-pill {
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  padding: 11px 18px;
  font-size: 15px;
  font-weight: 700;
}

.arch-web-branch {
  margin-top: 22px;
  text-align: center;
}

.arch-summary {
  margin: 40px auto 0;
  max-width: 640px;
  text-align: center;
  font-size: 15px;
  color: rgba(243, 236, 246, 0.72);
}

/* ---------- AI agent workflow ---------- */

.process-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: 40px 0 52px;
}

.process-step {
  background: var(--cream);
  border: 1px solid var(--line);
  color: var(--purple);
  font-weight: 700;
  font-size: 14px;
  padding: 10px 16px;
  border-radius: 999px;
  white-space: nowrap;
}

.process-arrow { color: var(--accent); font-weight: 700; }

#ai-agents .wrap {
  max-width: 1240px;
}

.direction-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin-top: 12px;
}

@media (max-width: 780px) {
  .direction-grid { grid-template-columns: 1fr; gap: 26px; }
}

.direction-card {
  border-radius: var(--radius-lg);
  padding: 38px 36px;
}

@media (max-width: 640px) {
  .direction-card { padding: 30px 26px; }
}

.direction-card.human {
  background: var(--purple);
  color: #fff;
}

.direction-card.agent {
  background: #fff;
  border: 1.5px solid var(--line);
  color: var(--ink);
}

.direction-card h3 {
  font-size: 23px;
  line-height: 1.25;
  margin-bottom: 10px;
}

.direction-card.human h3 { color: #fff; }
.direction-card.agent h3 { color: var(--purple); }

.direction-card .sub {
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  opacity: 0.75;
  margin-bottom: 22px;
  display: block;
}

.direction-card ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.direction-card li {
  font-size: 16.5px;
  padding-left: 24px;
  position: relative;
  line-height: 1.58;
}

.direction-card.human li { color: rgba(255, 255, 255, 0.92); }
.direction-card.agent li { color: var(--ink-soft); }

.direction-card li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.direction-note {
  margin-top: 26px;
  text-align: center;
  font-size: 15px;
  color: var(--ink-soft);
  max-width: 60ch;
  margin-left: auto;
  margin-right: auto;
}

/* ---------- Role / closing ---------- */

.role-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 30px 0 40px;
}

.closing-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
}

@media (max-width: 900px) {
  .closing-grid { grid-template-columns: 1fr; }
}

.final-statement {
  margin-top: 40px;
  background: var(--purple);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 46px 40px;
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 700;
  line-height: 1.3;
  box-shadow: var(--shadow);
}

.mascot-wrap {
  display: flex;
  justify-content: center;
}

.mascot-wrap img {
  max-width: 260px;
}

/* ---------- Footer ---------- */

footer {
  padding: 20px 0 27px;
  text-align: center;
}

.foot-lockup {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0 auto 14px;
}

.foot-badge {
  height: 104px;
  width: auto;
  display: block;
}

footer .foot-note {
  font-size: 13px;
  color: var(--ink-soft);
}

/* ---------- Mobile density refinement ----------
   The base sizes/spacing above read as landing-page-oversized on small
   screens compared to the actual Tilder product's own calmer UI density.
   Tighten headings/body copy/section rhythm on mobile only — desktop is
   untouched here except the h2 line-height fix above, which was a real
   gap (h2 had no explicit line-height at all, so it inherited the body's
   1.55, i.e. ~62px line-height at 40px desktop size — clearly too loose
   regardless of viewport). Nothing below removes the readability gains
   just made to the AI-agent Human/Agent cards — those keep their own
   sizing untouched, per the explicit "highest priority" instruction that
   produced them. */
@media (max-width: 640px) {
  section { padding: 50px 0; }

  .hero { padding-bottom: 56px; }
  .hero-wordmark { height: 36px; margin-bottom: 18px; }
  .hero h1 { font-size: 35px; line-height: 1.08; }
  .hero-statement { font-size: 17.5px; line-height: 1.42; margin-top: 18px; }
  .hero-support { font-size: 15.5px; line-height: 1.52; margin-top: 16px; }
  .hero-meta { margin-top: 22px; }
  .hero-role { margin-top: 20px; font-size: 13.5px; }

  h2 { font-size: 24px; }
  .lede { font-size: 16.5px; }
  .body-copy { font-size: 15px; line-height: 1.52; }
  .strong-line { font-size: 17.5px; }
  .goal-final { font-size: 19px; }

  .flow-strip { margin: 28px 0 32px; padding: 14px 16px; }
  .flow-step { font-size: 13px; padding: 6px 10px; }
  .goal-line { margin-top: 30px; }

  .metrics { margin: 30px 0 34px; }
  .arch { margin-top: 36px; }
  .process-strip { margin: 30px 0 38px; }

  .final-statement {
    margin-top: 28px;
    padding: 30px 24px;
    font-size: 20px;
    line-height: 1.32;
    border-radius: var(--radius-md);
  }

  .role-pills { margin: 22px 0 30px; }
}

/* ---------- Desktop readability pass: enlarge specific small chip/strip
   elements flagged as hard to read on 1440px (hero meta pills, the two
   process/flow strips, and the "What I own" role pills). Mobile sizing
   (set above and in the earlier mobile-density pass) is intentionally left
   untouched — gated to min-width so nothing here reaches small screens. ---------- */
@media (min-width: 901px) {
  .hero-meta { gap: 14px; }
  .hero-meta .pill {
    font-size: 17px;
    font-weight: 700;
    padding: 14px 22px;
  }

  .flow-strip { padding: 22px 30px; }
  .flow-step { font-size: 17px; padding: 10px 18px; }
  .flow-arrow { font-size: 18px; }

  .process-strip { gap: 10px; }
  .process-step { font-size: 16.5px; padding: 12px 20px; }
  .process-arrow { font-size: 17px; }

  .role-pills { gap: 14px; }
  .role-pills .pill {
    font-size: 15.5px;
    padding: 11px 18px;
  }
}

