/*
  Think First — polished UX layer
  Adapts the compact operational layout language of AI Website Launch OS
  while preserving the Parenting framework's warm visual identity.
*/

:root {
  --app-bg: #f1f5f3;
  --surface: #fffefa;
  --surface-soft: #f8faf8;
  --sidebar: #123b35;
  --sidebar-deep: #0d2f2a;
  --primary: #1f6b5b;
  --primary-bright: #2c876f;
  --primary-soft: #e8f5f0;
  --accent-soft: #fff3ed;
  --ui-line: #dbe4df;
  --ui-muted: #65736e;
  --ui-shadow: 0 14px 42px rgba(22, 59, 52, .08);
  --ui-radius: 19px;
}

body {
  background:
    radial-gradient(circle at 82% 0%, rgba(205, 235, 220, .42), transparent 24rem),
    var(--app-bg);
  color: var(--ink);
  font-size: 15px;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 10px;
  left: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  background: #fff;
  color: var(--deep);
  font-weight: 700;
  text-decoration: none;
  transform: translateY(-150%);
  transition: transform .15s ease;
}

.skip-link:focus { transform: none; }

.app-shell { grid-template-columns: 244px minmax(0, 1fr); }

.sidebar {
  padding: 20px 14px 16px;
  background: linear-gradient(180deg, var(--sidebar), var(--sidebar-deep));
  overflow: hidden;
}

.brand {
  min-height: 50px;
  padding: 0 4px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, .1);
}

.brand-orbit {
  width: 40px;
  height: 40px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, .16);
}

.brand small { font-size: 9px; }
.brand b { font-size: 18px; }

.brand-note {
  margin: 12px 5px 5px;
  font-size: 12px;
  line-height: 1.5;
}

.step-nav {
  display: block;
  flex: 1;
  padding: 3px 0 10px;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(246, 204, 87, .35) transparent;
}

.nav-phase {
  display: block;
  padding: 12px 9px 5px;
  color: rgba(255, 255, 255, .38);
  font: 700 9px var(--font-mono, monospace);
  letter-spacing: .11em;
  text-transform: uppercase;
}

.step-nav button {
  position: relative;
  grid-template-columns: 28px 1fr;
  gap: 9px;
  padding: 8px 9px;
  margin: 1px 0;
  border-radius: 10px;
}

.step-nav button.active::before {
  content: "";
  position: absolute;
  inset: 7px auto 7px -14px;
  width: 3px;
  border-radius: 0 5px 5px 0;
  background: var(--yellow);
}

.step-nav i {
  width: 26px;
  height: 26px;
  font-size: 9px;
}

.step-nav b { font-size: 12px; line-height: 1.25; }
.step-nav small { font-size: 10px; line-height: 1.3; }

.side-rule {
  margin-top: 0;
  padding: 13px 6px 0;
}

.side-rule p { font-size: 10px; line-height: 1.5; }

.topbar {
  min-height: 60px;
  padding: 0 clamp(18px, 3vw, 34px);
  border-bottom-color: rgba(23, 63, 56, .1);
  background: rgba(241, 245, 243, .9);
  backdrop-filter: blur(18px);
}

.topbar > div:first-child {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.topbar small {
  flex: 0 0 auto;
  padding: 6px 9px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 10px;
  letter-spacing: .08em;
}

.topbar b {
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top-actions { gap: 8px; }

.quiet-button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border: 1px solid var(--ui-line);
  border-radius: 10px;
  background: #fff;
  color: #42524d;
  font-size: 12px;
  box-shadow: 0 4px 14px rgba(22, 59, 52, .04);
}

.quiet-button:hover { border-color: #a9c7bd; color: var(--primary); }
.quiet-button.light { border-color: rgba(255, 255, 255, .2); background: rgba(255, 255, 255, .08); color: #fff; }

.reset-button {
  width: 38px;
  height: 38px;
  border-color: var(--ui-line);
  background: #fff;
  box-shadow: 0 4px 14px rgba(22, 59, 52, .04);
}

.progress { top: 60px; height: 4px; background: #dfe8e3; }
.progress i { background: linear-gradient(90deg, var(--primary-bright), var(--coral)); }

.panel {
  width: min(100% - 48px, 1120px);
  padding: 28px 0 88px;
}

.hero {
  min-height: 440px;
  border: 1px solid var(--ui-line);
  border-radius: 26px;
  box-shadow: var(--ui-shadow);
}

.hero-copy { padding: clamp(32px, 5vw, 54px); }

.hero-copy h1 {
  margin-bottom: 18px;
  font-size: clamp(42px, 5vw, 62px);
  line-height: 1.08;
  letter-spacing: -.045em;
}

.hero-copy p {
  font-size: 15px;
  line-height: 1.7;
}

.hero-copy .button { margin-top: 23px; }
.hero-play { min-height: 400px; }
.hero-play .sun { width: 230px; height: 230px; }
.dino { font-size: 92px; }
.block.one { width: 128px; height: 104px; }
.block.two { width: 78px; height: 74px; }

.eyebrow {
  display: inline-flex;
  width: fit-content;
  margin-bottom: 11px;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 10px;
  letter-spacing: .11em;
}

.philosophy-flow {
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 20px 0 48px;
  border: 0;
  background: transparent;
}

.philosophy-flow article {
  position: relative;
  min-height: 160px;
  padding: 18px;
  border: 1px solid var(--ui-line) !important;
  border-radius: 15px;
  background: rgba(255, 255, 255, .84);
  box-shadow: 0 8px 28px rgba(22, 59, 52, .035);
}

.philosophy-flow i { width: 28px; height: 28px; }
.philosophy-flow span { margin-top: 18px; font-size: 9px; }
.philosophy-flow b { margin: 5px 0; font-size: 15px; }
.philosophy-flow p { font-size: 12px; line-height: 1.55; }

.section-head { margin-bottom: 18px; }

.section-head h2 {
  max-width: 900px;
  margin-bottom: 10px;
  font-size: clamp(28px, 3.5vw, 40px);
  line-height: 1.18;
  letter-spacing: -.03em;
}

.section-head p { font-size: 15px; line-height: 1.65; }

.age-guide { margin: 44px 0 32px; }
.age-grid { grid-template-columns: repeat(3, 1fr); gap: 12px; }

.age-grid article,
.form-card,
.profile-aside,
.safety-card,
.guardrail-card,
.role-card,
.library-card {
  border-color: var(--ui-line);
  border-radius: var(--ui-radius);
  box-shadow: 0 8px 28px rgba(22, 59, 52, .035);
}

.age-grid article { padding: 20px; }
.age-grid h3 { min-height: auto; margin: 10px 0; font-size: 16px; }
.age-grid ul { font-size: 12px; line-height: 1.65; }

.boundary-banner {
  gap: 22px;
  padding: 18px 20px;
  border: 1px solid #f1d1c7;
  border-left: 4px solid var(--coral);
  border-radius: 15px;
  background: var(--accent-soft);
}

.boundary-banner b { font-size: 13px; }
.boundary-banner span { font-size: 12px; line-height: 1.55; }

.form-layout { grid-template-columns: 1.25fr .75fr; gap: 14px; }
.form-card, .profile-aside, .safety-card, .guardrail-card { padding: 21px; }
.profile-aside { background: linear-gradient(145deg, var(--sidebar), #1c584c); }
.profile-aside blockquote { margin: 38px 0 22px; font-size: clamp(24px, 2.6vw, 34px); }
.brief-summary span { font-size: 12px; }

.field { gap: 7px; margin-bottom: 14px; }
.field > span { font-size: 13px; }

.field input,
.field select,
.filter-bar input,
.filter-bar select {
  height: 48px;
  padding-inline: 13px;
  border: 1.5px solid #d2dcd7;
}

.field textarea { border: 1.5px solid #d2dcd7; }

.field input:focus,
.field select:focus,
.field textarea:focus,
.filter-bar input:focus,
.filter-bar select:focus {
  border-color: var(--primary-bright);
  box-shadow: 0 0 0 4px rgba(44, 135, 111, .1);
}

.option-section { margin-top: 23px; }
.option-section legend { font-size: 15px; }
.skill-grid, .material-grid { gap: 10px; }

.check-card {
  min-height: 86px;
  padding: 14px;
  border-color: var(--ui-line);
  background: rgba(255, 255, 255, .8);
}

.check-card b { font-size: 12px; }
.check-card small { margin-top: 2px; font-size: 10px; line-height: 1.35; }

.button {
  min-height: 46px;
  gap: 16px;
  padding: 10px 18px;
  border-radius: 11px;
  font-size: 14px;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}

.button:hover:not(:disabled) { transform: translateY(-1px); }

.button.primary {
  border-color: var(--primary);
  background: linear-gradient(135deg, var(--primary), var(--primary-bright));
  box-shadow: 0 8px 18px rgba(31, 107, 91, .2);
}

.button.secondary { border-color: #cbd8d2; background: #fff; }

.ai-role-grid { gap: 12px; }
.role-card { min-height: 180px; padding: 19px; }
.role-card:has(input:checked) { padding: 18px; border-color: var(--primary); box-shadow: inset 0 -5px var(--yellow), 0 10px 28px rgba(31, 107, 91, .09); }
.role-card b { margin: 26px 0 7px; font-size: 15px; }
.role-card p { font-size: 12px; line-height: 1.55; }

.safety-layout { gap: 14px; margin-top: 20px; }
.safety-head h3 { font-size: 21px; }
.safety-checks label { padding: 11px; font-size: 12px; line-height: 1.45; }
.guardrail-card ul { font-size: 12px; line-height: 1.7; }
.gate-message { border-radius: 12px; font-size: 12px; }

.prompt-shell { border-color: #24443e; border-radius: 18px; box-shadow: var(--ui-shadow); }
.prompt-toolbar { min-height: 56px; }
.prompt-toolbar b { font-size: 10px; }
.mini-button { min-height: 36px; padding: 7px 11px; border-radius: 9px; font-size: 11px; }

.prompt-box {
  min-height: 430px;
  padding: 21px;
  background: #112d29;
  color: #edf8f4;
  font-size: 12px;
}

.ai-links { font-size: 12px; }
.ai-links a { border: 1px solid var(--ui-line); }

.schema-strip {
  border-color: var(--ui-line);
  border-radius: 15px;
  background: rgba(255, 255, 255, .78);
}

.schema-strip span { font-size: 9px; }
.schema-strip b { font-size: 12px; }

.import-aside { background: linear-gradient(145deg, var(--sidebar), #1c584c); }
.import-aside ul { font-size: 12px; line-height: 1.7; }
.validation-report { font-size: 12px; }

.filter-bar {
  padding: 14px;
  border-color: var(--ui-line);
  box-shadow: 0 8px 28px rgba(22, 59, 52, .035);
}

.filter-bar label { font-size: 11px; }
.library-grid { gap: 14px; }
.library-card { min-height: 220px; padding: 19px; }
.library-card.selected { padding: 18px; }
.library-card h3 { margin: 24px 0 8px; font-size: 19px; }
.library-card p { font-size: 12px; line-height: 1.55; }
.library-tags small { font-size: 9px; }

.export-grid button {
  min-height: 160px;
  border-color: var(--ui-line);
  box-shadow: 0 8px 28px rgba(22, 59, 52, .035);
}

.export-grid button:hover { border-color: var(--primary); transform: translateY(-1px); }
.reflection-banner { border-radius: 18px; }

@media (min-width: 1440px) {
  .panel { width: min(100% - 64px, 1180px); }
}

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

@media (max-width: 850px) {
  .sidebar {
    position: sticky;
    z-index: 30;
    top: 0;
    height: 118px;
    display: grid;
    grid-template-rows: 54px 64px;
    padding: 0;
    overflow: hidden;
    background: rgba(18, 59, 53, .98);
    backdrop-filter: blur(16px);
  }

  .brand {
    height: 54px;
    padding: 7px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, .1);
  }

  .brand-orbit { width: 34px; height: 34px; }
  .brand small { display: none; }
  .brand b { margin: 0; font-size: 17px; }

  .step-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 7px 11px 9px;
    overflow-x: auto;
  }

  .nav-phase, .brand-note, .side-rule { display: none; }

  .step-nav button {
    flex: 0 0 42px;
    display: grid;
    place-items: center;
    padding: 7px;
    margin: 0;
  }

  .step-nav button.active::before { display: none; }
  .step-nav button span { display: none; }

  .topbar { top: 118px; }
  .progress { top: 178px; }
  .panel { width: min(100% - 30px, 760px); padding-top: 24px; }
  .hero { min-height: 0; }
  .hero-play { min-height: 330px; }
  .form-layout, .safety-layout, .import-grid { grid-template-columns: 1fr; }
}

@media (max-width: 580px) {
  body { font-size: 14px; }
  .sidebar { height: 110px; grid-template-rows: 52px 58px; }
  .brand { height: 52px; }
  .topbar { top: 110px; min-height: 58px; }
  .progress { top: 168px; }
  .topbar > div:first-child { gap: 7px; }
  .topbar small { padding: 5px 7px; font-size: 9px; }
  .topbar b { max-width: 44vw; font-size: 12px; }
  .reset-button { width: 36px; height: 36px; }
  .panel { width: min(100% - 24px, 560px); padding-top: 18px; }
  .hero-copy { padding: 28px 22px; }
  .hero-copy h1 { font-size: clamp(37px, 11vw, 48px); }
  .hero-play { min-height: 285px; }
  .philosophy-flow, .age-grid { grid-template-columns: 1fr; }
  .philosophy-flow article { min-height: auto; }
  .section-head h2 { font-size: 29px; }
  .boundary-banner { gap: 10px; }
  .form-card, .profile-aside, .safety-card, .guardrail-card { padding: 18px; }
  .prompt-toolbar { align-items: center; }
  .prompt-box { min-height: 520px; }
}

@media (prefers-reduced-motion: reduce) {
  .skip-link, .button { transition: none; }
}
