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

:root {
  --navy: #17263d;
  --panel: #ffffff;
  --panel-raised: #fff9fb;
  --surface: #fffdfd;
  --line: #e7cfd8;
  --muted: #5f6878;
  --text: #17263d;
  --accent: #a95470;
  --accent-bright: #bd6683;
  --accent-soft: #f6e8ed;
  --warning: #866528;
}

* { box-sizing: border-box; }

html { min-height: 100%; }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 92% 5%, rgba(236, 190, 207, .28), transparent 26rem),
    radial-gradient(circle at 8% 78%, rgba(249, 227, 235, .35), transparent 24rem),
    linear-gradient(135deg, #fffdfd 0%, #fff9fb 54%, #fff6f8 100%);
  font-family: 'DM Sans', sans-serif;
  letter-spacing: .01em;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .25;
  background-image: linear-gradient(rgba(169,84,112,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(169,84,112,.025) 1px, transparent 1px);
  background-size: 44px 44px;
}

#mainSection {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 58px 0 80px;
  position: relative;
}

.brand-lockup {
  margin-bottom: 34px;
}

.brand-name {
  color: var(--navy);
  font-size: clamp(2.35rem, 5vw, 4.6rem);
  line-height: .98;
  letter-spacing: -.06em;
  font-weight: 700;
}

.brand-byline {
  margin-top: 10px;
  color: var(--accent);
  font: 700 .76rem 'Space Mono', monospace;
  letter-spacing: .12em;
  text-transform: uppercase;
}

h1, h2, h3, p { margin-top: 0; }
h1 {
  color: var(--navy);
  font-size: clamp(2.25rem, 5vw, 4.4rem);
  line-height: 1.02;
  letter-spacing: -.055em;
  font-weight: 700;
}

.eyebrow, .field-label, .result-label {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: .16em;
  font: 700 .68rem 'Space Mono', monospace;
}

.eyebrow { margin-bottom: 22px; }

#mainSection > p {
  color: var(--muted);
  line-height: 1.75;
  max-width: 690px;
  font-size: 1rem;
}

#mainSection > p.disclaimer {
  border-left: 3px solid var(--accent);
  padding-left: 16px;
  font-size: .82rem;
  max-width: 600px;
  color: #4e596b;
}

.origin-story {
  max-width: 760px;
  margin: 28px 0 22px;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 4px;
  background: rgba(255, 255, 255, .82);
  box-shadow: 0 10px 28px rgba(23, 38, 61, .05);
}

.origin-story h2 {
  margin: 9px 0 12px;
  color: var(--navy);
  font-size: clamp(1.25rem, 2.4vw, 1.65rem);
  font-weight: 700;
  letter-spacing: -.025em;
}

.origin-story p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: .96rem;
  line-height: 1.7;
}

.origin-story .origin-story-note {
  margin-bottom: 0;
  color: #5d2942;
  font-weight: 600;
}

#image {
  display: block;
  width: min(100%, 540px);
  max-height: 340px;
  object-fit: cover;
  object-position: center;
  margin: 0 0 42px auto;
  border: 1px solid var(--line);
  border-radius: 3px;
  opacity: .9;
  filter: saturate(.7) contrast(1.05);
  box-shadow: 18px 18px 0 rgba(169, 84, 112, .12), 0 14px 34px rgba(23, 38, 61, .10);
}

#title { max-width: 760px; margin-bottom: 18px; }
#subtitle {
  color: var(--accent);
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  font-weight: 500;
  margin-bottom: 28px;
}

.mainButton {
  border: 1px solid var(--accent);
  border-radius: 3px;
  padding: 14px 23px;
  color: #fff;
  background: var(--accent);
  font: 700 .78rem 'Space Mono', monospace;
  text-transform: uppercase;
  letter-spacing: .1em;
  cursor: pointer;
  transition: transform .2s ease, background-color .2s ease, box-shadow .2s ease;
  box-shadow: 0 7px 0 rgba(104, 44, 66, .18);
}

.mainButton:hover:not(:disabled) { background: #91445f; transform: translateY(-2px); box-shadow: 0 9px 0 rgba(104, 44, 66, .16); }
.mainButton:focus-visible,
.secondaryButton:focus-visible,
.pageButton:focus-visible,
.form-control:focus-visible { outline: 3px solid rgba(189, 102, 131, .34); outline-offset: 3px; }
.mainButton:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 3px 0 rgba(104, 44, 66, .16); }
.mainButton:disabled { opacity: .65; cursor: wait; }

#continueButton { margin-top: 30px; }

.site-footer {
  margin-top: 64px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .76rem;
  letter-spacing: .04em;
}

/* calculator */
#options {
  margin-top: 38px;
  padding: clamp(22px, 4vw, 40px);
  background: rgba(255, 255, 255, .88);
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: 0 18px 42px rgba(23, 38, 61, .08);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px 28px;
}

.scenario-panel {
  margin-bottom: 20px;
  padding: clamp(18px, 3vw, 28px);
  border: 1px solid #e6c3d0;
  border-left: 4px solid var(--accent);
  border-radius: 4px;
  background: linear-gradient(120deg, #fff7fa, #fffdfd 72%);
}
.section-kicker {
  margin-bottom: 8px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: .15em;
  font: 700 .65rem 'Space Mono', monospace;
}
.scenario-heading h2,
.form-section-heading {
  color: var(--navy);
  font-size: 1rem;
  font-weight: 700;
}
.scenario-heading p {
  max-width: 720px;
  margin: 0 0 22px;
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.6;
}
.sample-input-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  margin: 18px 0 22px;
  padding: 18px;
  border: 1px solid #e9b5ca;
  border-left: 4px solid var(--accent);
  border-radius: 4px;
  background: #fff4f8;
}
.sample-input-status {
  margin: 0;
  color: var(--muted);
  font-size: .8rem;
  line-height: 1.5;
}
.sample-input-guidance {
  max-width: 700px;
  margin: 0;
  color: #5d2942;
  font-size: .86rem;
  line-height: 1.6;
}
#sampleInputsButton {
  min-height: 48px;
  border: 1px solid #a51f58;
  padding: 12px 18px;
  color: #fff;
  background: #a51f58;
  box-shadow: 0 4px 0 rgba(104, 44, 66, .16);
  font-size: .74rem;
  letter-spacing: .06em;
}
#sampleInputsButton:hover {
  border-color: #851747;
  color: #fff;
  background: #851747;
  transform: translateY(-1px);
}
#sampleInputsButton:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 rgba(104, 44, 66, .16);
}
#sampleInputsButton:focus-visible {
  outline: 3px solid rgba(189, 102, 131, .4);
  outline-offset: 3px;
}
.scenario-panel .form-grid { gap: 20px 24px; }
.simulation-safety-note {
  margin: 18px 0 28px;
  padding: 14px 16px;
  border: 1px solid #e8d6ad;
  border-radius: 3px;
  color: #55451f;
  background: #fffaf0;
  font-size: .82rem;
  line-height: 1.6;
}
.form-section-heading {
  margin: 0 0 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.optionsInput { margin: 0 !important; display: flex; flex-direction: column; gap: 9px; }
.optionsInput.full-width { grid-column: 1 / -1; }
.input-group-text {
  display: block;
  padding: 0;
  border: 0;
  color: var(--navy);
  background: transparent;
  font-size: .82rem;
  font-weight: 700;
}
.input-group-text small { color: var(--muted); font-size: .82em; font-weight: 500; }
.form-control {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 3px !important;
  color: var(--navy);
  background: var(--surface, #fffdfd);
  padding: 12px 14px;
  transition: border-color .2s ease, background-color .2s ease;
}
.optionsInput > .form-control {
  flex: 0 0 auto;
  width: 100%;
}
.form-control::placeholder { color: #5f7488; }
.form-control:focus {
  color: var(--navy);
  background: #fff;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(181,99,122,.18);
}
.form-control:hover { border-color: #c993a7; }
.scenario-help {
  color: var(--muted);
  font-size: .78rem;
  line-height: 1.55;
}
.form-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 34px;
}
.form-actions #calculateButton { margin-top: 0; }
#resetButton { min-height: 48px; }

#loading { display: none; margin: 26px 0 0; color: var(--accent); font: .78rem 'Space Mono', monospace; }
#loading .btn { color: var(--accent); background: transparent; border: 0; padding: 0; }
#loading .spinner-border { width: 16px; height: 16px; border-width: 2px; }
#result { display: none; margin-top: 54px; }
#result h3 { font-size: 1.25rem; letter-spacing: -.02em; margin-bottom: 20px; }
.simulation-summary {
  margin-bottom: 14px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--navy);
  background: #fff9fb;
  font-size: .9rem;
  line-height: 1.7;
  overflow-wrap: anywhere;
}
#result .simulation-safety-note { margin: 0 0 22px; }
.result-warning {
  border-color: #e8a6be;
  color: #63223f;
  background: #fff0f5;
  font-weight: 600;
}
.procedure-education {
  margin-bottom: 34px;
  padding: clamp(18px, 3vw, 28px);
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  background: #fff9fb;
}
.procedure-education h3 { margin-bottom: 12px; }
.procedure-education > p {
  color: var(--text);
  font-size: .9rem;
  line-height: 1.7;
}
.procedure-duration-card {
  margin: 18px 0;
  padding: 16px 18px;
  border: 1px solid #e8b6c9;
  background: #fff;
}
.procedure-duration-card h4,
.procedure-education-grid h4 {
  color: #762449;
  font-size: .85rem;
  font-weight: 700;
}
#procedureDurationOutput {
  margin: 6px 0;
  color: var(--accent);
  font: 700 1.2rem 'Space Mono', monospace;
}
#procedureCompletionNote {
  margin: 0;
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.6;
}
.procedure-education-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.procedure-education-grid > div {
  padding: 16px 18px;
  border: 1px solid var(--line);
  background: #fff;
}
.procedure-education-grid ul {
  margin: 8px 0 0;
  padding-left: 20px;
  color: var(--text);
  font-size: .86rem;
  line-height: 1.7;
}
.procedure-education-caveat {
  margin: 18px 0 0 !important;
  color: #6d5261 !important;
  font-size: .78rem !important;
}
#cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
#cards .card {
  width: auto !important;
  min-height: 150px;
  border: 1px solid var(--line);
  border-top: 2px solid var(--accent);
  border-radius: 3px;
  color: var(--text);
  background: var(--panel);
  text-align: left !important;
}
#cards .card-body { padding: 24px; }
#cards .card-title { color: var(--navy); font-size: .83rem; font-weight: 700; margin-bottom: 22px; }
#cards .card-text { color: var(--accent); font: 700 clamp(1.8rem, 4vw, 2.6rem) 'Space Mono', monospace; margin: 0; overflow-wrap: anywhere; }

/* time-checkpoint preview */
.timeline-panel {
  position: relative;
  margin-top: 36px;
  padding: clamp(22px, 4vw, 38px);
  border: 1px solid #e9b5ca;
  border-radius: 4px;
  background: rgba(255, 254, 254, .92);
  box-shadow: 0 16px 38px rgba(87, 34, 59, .07);
}
.timeline-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}
.timeline-topline h2 {
  margin: 0;
  color: var(--navy);
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: -.04em;
}
.preview-stamp {
  flex: 0 0 auto;
  padding: 7px 10px;
  border: 1px solid #efa9c3;
  border-radius: 2px;
  color: #a62359;
  background: #fff2f7;
  font: 700 .62rem 'Space Mono', monospace;
  letter-spacing: .07em;
}
.timeline-stage-note {
  margin: 22px 0 12px;
  padding: 13px 16px;
  border-left: 3px solid var(--accent);
  color: #5d2942;
  background: #fff0f6;
  font-size: .91rem;
  font-weight: 700;
  line-height: 1.55;
}
.timeline-intro {
  max-width: 720px;
  margin: 0 0 18px;
  color: var(--muted);
  font-size: .88rem;
  line-height: 1.65;
}
.secondaryButton,
.pageButton {
  min-height: 42px;
  border: 1px solid #d84a83;
  border-radius: 3px;
  padding: 10px 14px;
  color: #a51f58;
  background: #fff;
  font: 700 .7rem 'Space Mono', monospace;
  letter-spacing: .025em;
  cursor: pointer;
  transition: background-color .18s ease, transform .18s ease, border-color .18s ease;
}
.secondaryButton:hover,
.pageButton:hover:not(:disabled) {
  border-color: #b81d60;
  background: #fff0f6;
  transform: translateY(-1px);
}
.sample-input-actions { margin: 18px 0 22px; }
.sample-input-status {
  margin: 0;
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.55;
}
.timeline-message {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.55;
}
.timeline-message:empty { display: none; }
.timeline-content { margin-top: 20px; }
.timeline-content[hidden] { display: none; }
.timeline-meta {
  margin-bottom: 12px;
  color: #765365;
  font: 700 .68rem 'Space Mono', monospace;
  letter-spacing: .03em;
}
.timeline-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 3px;
}
.timeline-table {
  width: 100%;
  border-collapse: collapse;
  color: var(--text);
  font-size: .88rem;
}
.timeline-table th {
  padding: 12px 16px;
  color: #762449;
  background: #fff0f6;
  text-align: left;
  font: 700 .65rem 'Space Mono', monospace;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.timeline-table td {
  padding: 11px 16px;
  border-top: 1px solid #f2dce5;
  vertical-align: middle;
}
.timeline-table tbody tr:nth-child(even) { background: #fff9fb; }
.timeline-time {
  width: 34%;
  color: #a51f58;
  font: 700 .78rem 'Space Mono', monospace;
  white-space: nowrap;
}
.timeline-stage { color: #4f3948; }
.timeline-note { max-width: 560px; color: #4f3948; }
.timeline-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 14px;
}
.pageButton:disabled {
  border-color: #e8d9e0;
  color: #9b8993;
  background: #faf6f8;
  cursor: not-allowed;
}
#timelinePageStatus {
  color: var(--muted);
  font: 700 .68rem 'Space Mono', monospace;
  text-align: center;
}

#errorMessage {
  color: #8a3346 !important;
  border: 1px solid #d99aaa !important;
  background: #fff0f3;
  padding: 14px !important;
}

@media (max-width: 700px) {
  #mainSection { width: min(100% - 28px, 600px); padding: 34px 0 52px; }
  #image { width: 100%; margin: 0 0 34px; box-shadow: 10px 10px 0 rgba(169, 84, 112, .12), 0 12px 26px rgba(23, 38, 61, .08); }
  .form-grid, #cards, .procedure-education-grid { grid-template-columns: 1fr; }
  .optionsInput.full-width { grid-column: auto; }
  .scenario-panel { padding: 18px; }
  .timeline-panel { padding: 20px 16px; }
  .timeline-topline { flex-direction: column; }
  .timeline-stage-note { margin-top: 17px; }
  .secondaryButton { width: 100%; }
  .form-actions { flex-direction: column; align-items: stretch; }
  .form-actions > button { width: 100%; }
  h1 { font-size: clamp(2.25rem, 12vw, 3.7rem); }
}