:root {
  --paper: #f3ead7;
  --paper-dark: #e8dcc0;
  --ink: #2a2419;
  --ink-soft: #4a3f2f;
  --sepia: #8b6f47;
  --rust: #a0421a;
  --moss: #5b6b3a;
  --shell: #6b5436;
  --stamp-red: #9c2a1f;
  --highlight: #e9d391;
}

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

html, body {
  background: var(--paper);
  color: var(--ink);
  font-family: 'Cormorant Garamond', serif;
  font-size: 19px;
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

/* Paper texture overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background-image:
    radial-gradient(ellipse at 20% 30%, rgba(139,111,71,0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 70%, rgba(160,66,26,0.06) 0%, transparent 50%),
    url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.55 0 0 0 0 0.45 0 0 0 0 0.3 0 0 0 0.18 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
  opacity: 0.55;
}

/* Vignette */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(42,36,25,0.25) 100%);
}

.container {
  position: relative;
  z-index: 3;
  max-width: 980px;
  margin: 0 auto;
  padding: 60px 40px 100px;
}

/* Decorative fixed corner ornaments — give the page that bound-volume feel */
.corner-ornament {
  position: fixed;
  width: 80px;
  height: 80px;
  pointer-events: none;
  z-index: 2;
  opacity: 0.5;
  color: var(--sepia);
}
.corner-ornament.tl { top: 20px; left: 20px; }
.corner-ornament.tr { top: 20px; right: 20px; transform: scaleX(-1); }
.corner-ornament.bl { bottom: 20px; left: 20px; transform: scaleY(-1); }
.corner-ornament.br { bottom: 20px; right: 20px; transform: scale(-1, -1); }

@media (max-width: 760px) {
  .corner-ornament { width: 50px; height: 50px; opacity: 0.35; }
}

/* Floating margin annotations — tiny atmospheric details */
.margin-note {
  position: fixed;
  font-family: 'Caveat', cursive;
  font-size: 14px;
  color: var(--sepia);
  opacity: 0.45;
  pointer-events: none;
  z-index: 2;
  transform: rotate(-4deg);
  max-width: 110px;
  line-height: 1.2;
}
.margin-note.left {
  top: 35%;
  left: 20px;
  transform: rotate(-90deg);
  transform-origin: top left;
}
.margin-note.right {
  top: 60%;
  right: 30px;
  transform: rotate(8deg);
}

@media (max-width: 1100px) {
  .margin-note { display: none; }
}

/* HEADER */
header {
  text-align: center;
  margin-bottom: 50px;
  position: relative;
}

.establishment {
  font-family: 'Special Elite', monospace;
  font-size: 11px;
  letter-spacing: 0.3em;
  color: var(--sepia);
  text-transform: uppercase;
  margin-bottom: 18px;
}

h1 {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 500;
  font-size: clamp(42px, 6vw, 72px);
  line-height: 0.95;
  letter-spacing: -0.02em;
  color: var(--ink);
  font-style: italic;
}

h1 .amp { font-style: normal; color: var(--rust); font-weight: 400; }

.subtitle {
  font-family: 'Special Elite', monospace;
  font-size: 13px;
  letter-spacing: 0.15em;
  color: var(--ink-soft);
  margin-top: 14px;
  text-transform: uppercase;
}

.credentials {
  margin-top: 22px;
  font-size: 15px;
  color: var(--sepia);
  font-style: italic;
}
.credentials::before, .credentials::after {
  content: '◆';
  margin: 0 12px;
  color: var(--rust);
  font-style: normal;
}

/* Decorative rule */
.ornament {
  text-align: center;
  color: var(--sepia);
  font-size: 22px;
  margin: 40px 0;
  letter-spacing: 8px;
}

/* MAIN LAYOUT */
.session {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 50px;
  align-items: start;
}

@media (max-width: 760px) {
  .session { grid-template-columns: 1fr; }
  .container { padding: 30px 20px 60px; }
}

/* TORTOISE */
.tortoise-card {
  position: sticky;
  top: 30px;
  text-align: center;
  padding: 24px 18px;
  border: 1px solid var(--sepia);
  background: rgba(255,250,235,0.4);
  box-shadow: 4px 4px 0 rgba(139,111,71,0.18);
}

.tortoise-svg {
  width: 100%;
  max-width: 240px;
  margin: 0 auto;
  display: block;
  filter: drop-shadow(2px 4px 0 rgba(42,36,25,0.15));
  animation: bob 6s ease-in-out infinite;
}

@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.tortoise-name {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 22px;
  margin-top: 14px;
  color: var(--ink);
}

.tortoise-title {
  font-family: 'Special Elite', monospace;
  font-size: 9px;
  letter-spacing: 0.2em;
  color: var(--sepia);
  text-transform: uppercase;
  margin-top: 4px;
}

.tortoise-quote {
  margin-top: 16px;
  font-size: 14px;
  color: var(--ink-soft);
  font-style: italic;
  line-height: 1.4;
  border-top: 1px dashed var(--sepia);
  padding-top: 14px;
  min-height: 60px;
  transition: opacity 0.5s ease;
}

/* Tortoise blink */
.eye-lid {
  transform-origin: center;
  transform-box: fill-box;
  animation: blink 5.5s infinite;
}
@keyframes blink {
  0%, 92%, 100% { transform: scaleY(0); }
  94%, 96% { transform: scaleY(1); }
}

/* Hand tap (gestures while talking) */
.gesture-arm {
  transform-origin: 130px 215px;
  animation: gesture 7s ease-in-out infinite;
}
@keyframes gesture {
  0%, 70%, 100% { transform: rotate(0deg); }
  75% { transform: rotate(-8deg); }
  80% { transform: rotate(0deg); }
  85% { transform: rotate(-5deg); }
  90% { transform: rotate(0deg); }
}

/* INTAKE FORM */
.intake {
  background: rgba(255,250,235,0.5);
  border: 1px solid var(--sepia);
  padding: 36px 38px;
  position: relative;
  box-shadow: 6px 6px 0 rgba(139,111,71,0.18);
}

.intake::before {
  content: 'FORM-D-77';
  position: absolute;
  top: 12px;
  right: 14px;
  font-family: 'Special Elite', monospace;
  font-size: 9px;
  color: var(--sepia);
  letter-spacing: 0.15em;
}

.stamp {
  position: absolute;
  top: 18px;
  left: -30px;
  transform: rotate(-12deg);
  border: 2px solid var(--stamp-red);
  color: var(--stamp-red);
  padding: 4px 14px;
  font-family: 'Special Elite', monospace;
  font-size: 11px;
  letter-spacing: 0.15em;
  background: rgba(255,250,235,0.7);
  opacity: 0.85;
}

.form-label {
  font-family: 'Special Elite', monospace;
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--ink-soft);
  text-transform: uppercase;
  margin-bottom: 10px;
  display: block;
}

.question {
  font-family: 'Cormorant Garamond', serif;
  font-size: 24px;
  font-style: italic;
  color: var(--ink);
  margin-bottom: 22px;
  line-height: 1.3;
}

.preset-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 24px;
}
@media (max-width: 540px) {
  .preset-grid { grid-template-columns: 1fr; }
}

.preset-btn {
  background: transparent;
  border: 1px solid var(--sepia);
  padding: 13px 16px;
  font-family: 'Cormorant Garamond', serif;
  font-size: 17px;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
  position: relative;
  line-height: 1.3;
}

.preset-btn::before {
  content: '☐';
  margin-right: 8px;
  color: var(--sepia);
  font-size: 14px;
}

.preset-btn:hover {
  background: var(--highlight);
  transform: translate(-2px, -2px);
  box-shadow: 3px 3px 0 var(--ink-soft);
}

.preset-btn.selected {
  background: var(--highlight);
  border-color: var(--ink);
}
.preset-btn.selected::before { content: '☒'; color: var(--rust); }

.divider-or {
  text-align: center;
  margin: 22px 0;
  font-family: 'Special Elite', monospace;
  font-size: 11px;
  letter-spacing: 0.3em;
  color: var(--sepia);
  position: relative;
}
.divider-or::before, .divider-or::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 38%;
  height: 1px;
  background: var(--sepia);
  opacity: 0.4;
}
.divider-or::before { left: 0; }
.divider-or::after { right: 0; }

textarea {
  width: 100%;
  min-height: 90px;
  background: rgba(255,255,250,0.6);
  border: none;
  border-bottom: 2px solid var(--ink-soft);
  padding: 12px 4px;
  font-family: 'Caveat', cursive;
  font-size: 22px;
  color: var(--ink);
  resize: vertical;
  line-height: 1.3;
  background-image: repeating-linear-gradient(
    transparent,
    transparent 31px,
    rgba(139,111,71,0.25) 31px,
    rgba(139,111,71,0.25) 32px
  );
}
textarea:focus { outline: none; border-bottom-color: var(--rust); }
textarea::placeholder { color: var(--sepia); opacity: 0.6; font-style: italic; }

.submit-btn {
  margin-top: 28px;
  background: var(--ink);
  color: var(--paper);
  border: none;
  padding: 16px 32px;
  font-family: 'Special Elite', monospace;
  font-size: 13px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  cursor: pointer;
  width: 100%;
  transition: all 0.2s ease;
  position: relative;
}
.submit-btn:hover {
  background: var(--rust);
  transform: translate(-2px, -2px);
  box-shadow: 4px 4px 0 var(--sepia);
}
.submit-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* DIAGNOSIS */
.diagnosis {
  margin-top: 50px;
  padding: 40px 42px;
  background: rgba(255,250,235,0.6);
  border: 1px solid var(--sepia);
  box-shadow: 6px 6px 0 rgba(139,111,71,0.18);
  position: relative;
  display: none;
  animation: emerge 0.8s ease;
}

.diagnosis.visible { display: block; }

@keyframes emerge {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.diagnosis::before {
  content: 'CONFIDENTIAL';
  position: absolute;
  top: -10px;
  left: 30px;
  background: var(--paper);
  padding: 0 12px;
  font-family: 'Special Elite', monospace;
  font-size: 10px;
  letter-spacing: 0.3em;
  color: var(--rust);
}

.diagnosis-stamp {
  position: absolute;
  top: 30px;
  right: 30px;
  transform: rotate(8deg);
  border: 3px double var(--stamp-red);
  color: var(--stamp-red);
  padding: 6px 14px;
  font-family: 'Special Elite', monospace;
  font-size: 12px;
  letter-spacing: 0.15em;
  opacity: 0.8;
  text-align: center;
  line-height: 1.2;
}

.case-num {
  font-family: 'Special Elite', monospace;
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--sepia);
  margin-bottom: 6px;
}

.diagnosis-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 36px;
  font-weight: 500;
  font-style: italic;
  color: var(--ink);
  line-height: 1.1;
  margin-bottom: 8px;
  padding-right: 100px;
}

.diagnosis-subtitle {
  font-family: 'Caveat', cursive;
  font-size: 22px;
  color: var(--rust);
  margin-bottom: 28px;
}

.section-head {
  font-family: 'Special Elite', monospace;
  font-size: 11px;
  letter-spacing: 0.25em;
  color: var(--ink-soft);
  text-transform: uppercase;
  margin-top: 32px;
  margin-bottom: 14px;
  border-bottom: 1px dashed var(--sepia);
  padding-bottom: 6px;
}

.section-body {
  font-size: 20px;
  color: var(--ink);
  line-height: 1.65;
}

.section-body p { margin-bottom: 14px; }
.section-body p:last-child { margin-bottom: 0; }

.symptoms-list {
  list-style: none;
  padding-left: 0;
  font-size: 19px;
}
.symptoms-list li {
  padding: 10px 0 10px 28px;
  position: relative;
  border-bottom: 1px dotted rgba(139,111,71,0.3);
  line-height: 1.4;
}
.symptoms-list li::before {
  content: '✦';
  position: absolute;
  left: 4px;
  top: 10px;
  color: var(--rust);
}

.severity {
  display: inline-block;
  padding: 4px 12px;
  background: var(--ink);
  color: var(--paper);
  font-family: 'Special Elite', monospace;
  font-size: 11px;
  letter-spacing: 0.2em;
  margin-top: 12px;
}

.signature {
  margin-top: 30px;
  padding-top: 18px;
  border-top: 1px solid var(--sepia);
  display: flex;
  justify-content: space-between;
  align-items: end;
  flex-wrap: wrap;
  gap: 16px;
}

.sig-block { font-size: 14px; color: var(--ink-soft); }
.sig-line {
  font-family: 'Caveat', cursive;
  font-size: 32px;
  color: var(--ink);
  border-bottom: 1px solid var(--ink);
  padding: 0 20px 2px;
  margin-bottom: 4px;
  transform: rotate(-2deg);
}

.actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.secondary-btn {
  flex: 1;
  background: transparent;
  border: 1px solid var(--ink);
  padding: 12px 16px;
  font-family: 'Special Elite', monospace;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 160px;
}
.secondary-btn:hover {
  background: var(--ink);
  color: var(--paper);
}

/* Loading state */
.thinking {
  display: none;
  text-align: center;
  padding: 40px 20px;
  margin-top: 40px;
  font-family: 'Caveat', cursive;
  font-size: 26px;
  color: var(--ink-soft);
}
.thinking.visible { display: block; }
.thinking .dots::after {
  content: '';
  animation: dots 1.5s steps(4, end) infinite;
}
@keyframes dots {
  0% { content: ''; }
  25% { content: '.'; }
  50% { content: '..'; }
  75% { content: '...'; }
}

/* DISCLAIMER footer */
footer {
  margin-top: 70px;
  text-align: center;
  font-family: 'Special Elite', monospace;
  font-size: 10px;
  letter-spacing: 0.15em;
  color: var(--sepia);
  line-height: 1.7;
  text-transform: uppercase;
  border-top: 1px solid var(--sepia);
  padding-top: 24px;
}
footer .big-disc {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 16px;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink-soft);
  margin-bottom: 10px;
}
