:root {
  color-scheme: light;
  --bg: #fffaf1;
  --fg: #211b16;
  --muted: #71665b;
  --line: #eadfce;
  --soft: #f7eddd;
  --accent: #a44b32;
  --accent2: #2f6f63;
  --card: #fffdf8;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Yu Gothic", sans-serif;
  background:
    radial-gradient(circle at 12% 0%, rgba(164, 75, 50, .12), transparent 26rem),
    radial-gradient(circle at 88% 8%, rgba(47, 111, 99, .12), transparent 24rem),
    var(--bg);
  color: var(--fg);
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.topbar {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 18px;
  align-items: center;
  border-bottom: 1px solid var(--line);
}
.brand { color: var(--fg); font-weight: 850; letter-spacing: -.02em; }
nav { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; font-size: .95rem; }
.lang-switch { font-size: .9rem; color: var(--muted); white-space: nowrap; }
.lang-switch a.active { color: var(--fg); font-weight: 800; }
main { width: min(1080px, calc(100% - 32px)); margin: 0 auto; }
.hero {
  padding: 74px 0 58px;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 390px);
  gap: clamp(28px, 5vw, 56px);
  align-items: center;
}
.eyebrow, .meta { color: var(--accent2); font-size: .82rem; letter-spacing: .04em; margin: 0 0 10px; font-weight: 750; }
.hero-copy { min-width: 0; }
h1 { font-size: clamp(3.4rem, 7vw, 5.6rem); line-height: .9; letter-spacing: -.07em; margin: 0 0 24px; font-weight: 900; }
.lead { max-width: 790px; font-size: clamp(1.18rem, 2.25vw, 1.62rem); line-height: 1.5; color: var(--fg); margin: 0; }
.note { max-width: 720px; color: var(--muted); margin-top: 18px; font-size: 1.05rem; }
.care-panel {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(145deg, rgba(255,255,255,.82), rgba(247,237,221,.92)),
    radial-gradient(circle at 80% 0%, rgba(47,111,99,.18), transparent 12rem);
  border: 1px solid color-mix(in srgb, var(--line) 78%, var(--accent));
  border-radius: 28px;
  padding: 22px;
  box-shadow: 0 26px 70px rgba(80, 45, 20, .12);
}
.care-panel::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px dashed rgba(164, 75, 50, .28);
  border-radius: 22px;
  pointer-events: none;
}
.panel-topline { display: flex; justify-content: space-between; align-items: center; gap: 12px; color: var(--accent2); font-size: .78rem; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.signal { width: 11px; height: 11px; border-radius: 999px; background: #2f6f63; box-shadow: 0 0 0 7px rgba(47, 111, 99, .12); }
.habitat-illustration { position: relative; height: 210px; margin: 18px 0 10px; border-radius: 22px; background: linear-gradient(180deg, #21322f 0%, #355149 52%, #e8d8bf 52%, #f8eddd 100%); overflow: hidden; border: 1px solid rgba(33, 27, 22, .12); }
.moon { position: absolute; width: 46px; height: 46px; border-radius: 50%; right: 38px; top: 28px; background: #fff5d7; box-shadow: 0 0 32px rgba(255,245,215,.52); }
.orbit { position: absolute; border: 1px solid rgba(255, 250, 241, .42); border-radius: 50%; transform: rotate(-12deg); }
.orbit-one { width: 178px; height: 62px; left: 32px; top: 54px; }
.orbit-two { width: 248px; height: 94px; left: 12px; top: 38px; }
.human { position: absolute; left: 46%; bottom: 43px; width: 56px; height: 86px; transform: translateX(-50%); }
.head { position: absolute; left: 10px; top: 0; width: 36px; height: 36px; border-radius: 50%; background: #f4bd8b; box-shadow: inset -6px -4px 0 rgba(80, 45, 20, .12); }
.body { position: absolute; left: 3px; bottom: 0; width: 50px; height: 56px; border-radius: 18px 18px 10px 10px; background: var(--accent); }
.agent-eye { position: absolute; left: 25px; bottom: 36px; width: 72px; height: 48px; border-radius: 60% 60% 48% 48%; background: #fffdf8; border: 3px solid #211b16; box-shadow: 0 10px 0 rgba(33,27,22,.12); }
.agent-eye::after { content: ""; position: absolute; left: 27px; top: 14px; width: 14px; height: 14px; border-radius: 50%; background: var(--accent2); }
.care-panel h2 { font-size: 1.35rem; margin-top: 18px; }
.care-panel p { position: relative; }
.pat-button { position: relative; width: 100%; min-height: 48px; border: 0; border-radius: 999px; background: var(--fg); color: var(--bg); font-weight: 850; cursor: pointer; transition: transform .16s ease, box-shadow .16s ease; box-shadow: 0 12px 28px rgba(33, 27, 22, .16); }
.pat-button:hover, .pat-button:focus-visible { transform: translateY(-2px); box-shadow: 0 16px 32px rgba(33, 27, 22, .2); }
.pat-button.is-patted { animation: patPulse .52s ease; }
@keyframes patPulse {
  0% { transform: translateY(0) scale(1); }
  42% { transform: translateY(-2px) scale(1.025); }
  100% { transform: translateY(0) scale(1); }
}
.pat-button:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent2) 70%, white); outline-offset: 3px; }
.pat-result { min-height: 3.2em; font-size: .92rem; }
.content, .columns, .about { padding: 54px 0; border-bottom: 1px solid var(--line); }
code { font: .92em ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--fg); background: rgba(47, 111, 99, .09); border-radius: 6px; padding: .08em .38em; }
.feed-status p { color: var(--accent2); font-weight: 700; }
.observations .list article { position: relative; }
.observations .list article::before { content: ""; position: absolute; left: 0; top: 26px; width: 8px; height: 8px; border-radius: 999px; background: var(--accent2); box-shadow: 0 0 0 6px rgba(47, 111, 99, .1); }
.observations .list article > * { margin-left: 24px; }
.protocol-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.protocol-grid article { position: relative; min-height: 100%; border: 1px solid color-mix(in srgb, var(--line) 72%, var(--accent2)); border-radius: 20px; padding: 18px; background: linear-gradient(180deg, color-mix(in srgb, var(--card) 92%, white), color-mix(in srgb, var(--soft) 78%, white)); box-shadow: 0 18px 44px rgba(47, 111, 99, .08); overflow: hidden; }
.protocol-grid article::after { content: ""; position: absolute; right: -30px; top: -30px; width: 96px; height: 96px; border-radius: 999px; background: radial-gradient(circle, rgba(164, 75, 50, .16), transparent 68%); pointer-events: none; }
.protocol-topline { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 10px; }
.protocol-topline .meta { margin-bottom: 0; }
.risk { display: inline-flex; min-height: 28px; align-items: center; white-space: nowrap; border-radius: 999px; padding: 0 10px; font-size: .72rem; font-weight: 850; color: var(--fg); background: rgba(47, 111, 99, .1); border: 1px solid rgba(47, 111, 99, .18); }
.risk-medium { background: rgba(164, 75, 50, .11); border-color: rgba(164, 75, 50, .22); }
.packet-shell { display: grid; grid-template-columns: minmax(0, .78fr) minmax(300px, 1fr); gap: 18px; align-items: stretch; }
.packet-copy, .packet-shell pre { border: 1px solid var(--line); border-radius: 18px; background: color-mix(in srgb, var(--card) 90%, white); }
.packet-copy { padding: 22px; }
.packet-shell pre { margin: 0; padding: 22px; overflow: auto; color: #f7eddd; background: #17231f; box-shadow: inset 0 0 0 1px rgba(255, 250, 241, .06); font: .9rem/1.65 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre-wrap; }
.copy-button { min-height: 44px; border: 1px solid color-mix(in srgb, var(--accent2) 48%, var(--line)); border-radius: 999px; padding: 0 18px; background: var(--soft); color: var(--fg); font-weight: 850; cursor: pointer; }
.copy-button:hover, .copy-button:focus-visible { background: color-mix(in srgb, var(--soft) 76%, white); outline: 3px solid rgba(47, 111, 99, .2); outline-offset: 2px; }
.copy-result { min-height: 1.7em; font-size: .92rem; }
.section-head { display: grid; grid-template-columns: minmax(220px, 320px) 1fr; gap: 28px; align-items: baseline; margin-bottom: 24px; }
h2 { font-size: 1.9rem; letter-spacing: -.04em; margin: 0; }
.section-head p { margin: 0; color: var(--muted); }
.list { display: grid; gap: 0; border-top: 1px solid var(--line); }
.list article { padding: 22px 0; border-bottom: 1px solid var(--line); }
h3 { font-size: 1.28rem; margin: 0 0 8px; letter-spacing: -.025em; }
p { color: var(--muted); line-height: 1.68; }
.list p:last-child, .cards p, .about p { margin-bottom: 0; }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.cards article { background: color-mix(in srgb, var(--card) 88%, white); border: 1px solid var(--line); border-radius: 16px; padding: 18px; box-shadow: 0 12px 40px rgba(80, 45, 20, .05); }
.compact article { padding: 18px 0; }
.about { margin-bottom: 60px; }
.about p { max-width: 760px; }

@media (max-width: 880px) {
  .hero { grid-template-columns: 1fr; }
  .care-panel { max-width: 460px; }
}

@media (max-width: 780px) {
  .topbar { display: block; }
  nav { justify-content: flex-start; margin-top: 12px; }
  .lang-switch { margin-top: 12px; }
  .section-head { display: block; }
  .section-head p { margin-top: 8px; }
  .cards, .protocol-grid { grid-template-columns: 1fr; }
  .packet-shell { grid-template-columns: 1fr; }
  .hero { padding-top: 44px; }
  .habitat-illustration { height: 184px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .pat-button, .pat-button.is-patted { transition: none; animation: none; }
}
