:root {
  --paper: #f7f7f4;
  --soft: #eef0ec;
  --ink: #1e2923;
  --muted: #56615a;
  --line: #d3d9d2;
  --accent: #244f3c;
  --detail: #a17d66;
  --font: "DM Sans", "Trebuchet MS", sans-serif;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 32px;
  max-width: 100%;
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  position: relative;
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

a:focus-visible,
summary:focus-visible,
button:focus-visible,
input:focus-visible,
.level-tool:focus-visible,
.game-house:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.shell {
  width: calc(100% - 56px);
  max-width: 1120px;
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  top: -60px;
  left: 16px;
  z-index: 100;
  padding: 12px 16px;
  background: var(--ink);
  color: white;
}

.skip-link:focus { top: 12px; }

.site-header { position: relative; z-index: 40; border-bottom: 1px solid var(--line); }

.header-inner {
  min-height: 76px;
  display: flex;
  align-items: center;
  gap: 40px;
}

.brand {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  min-width: 230px;
}

.brand strong { font-size: 20px; letter-spacing: -.04em; }
.brand span { margin-top: 3px; font-size: 11px; color: var(--muted); }

.desktop-nav {
  display: flex;
  gap: 28px;
  margin-inline: auto;
}

.desktop-nav a,
.header-actions a {
  font-size: 13px;
  font-weight: 600;
}

.desktop-nav a:hover,
.header-actions a:hover,
.plain-link:hover,
.site-footer a:hover { color: var(--accent); }

.header-actions {
  display: flex;
  align-items: center;
  gap: 26px;
  white-space: nowrap;
}

.header-phone { text-decoration: underline; text-underline-offset: 4px; }
.mobile-menu { display: none; }

.hero {
  position: relative;
  padding: 102px 0 106px;
  border-bottom: 1px solid var(--line);
  background: #f6f6f1;
}

.hero .shell::before {
  content: "";
  display: block;
  width: 42px;
  height: 2px;
  margin-bottom: 28px;
  background: var(--detail);
}

h1, h2, h3, p { margin-top: 0; }

.hero h1 {
  max-width: 900px;
  overflow-wrap: break-word;
  margin-bottom: 24px;
  font-size: clamp(52px, 6.7vw, 86px);
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -.065em;
}

.hero p {
  max-width: 700px;
  margin-bottom: 30px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.65;
}

.hero-actions { display: flex; align-items: center; gap: 28px; }

.button {
  display: inline-block;
  padding: 14px 20px;
  background: var(--accent);
  border: 1px solid var(--accent);
  color: white;
  font-size: 14px;
  font-weight: 600;
  transition: background-color .2s, border-color .2s;
}

.button:hover { background: var(--ink); border-color: var(--ink); }

.plain-link {
  display: inline-block;
  border-bottom: 1px solid currentColor;
  padding-bottom: 3px;
  font-size: 14px;
  font-weight: 600;
}

.section { padding: 76px 0; }

.section h2 {
  margin-bottom: 26px;
  font-size: clamp(32px, 3.6vw, 46px);
  font-weight: 600;
  letter-spacing: -.05em;
  line-height: 1.15;
}

.service-list { border-top: 1px solid var(--line); }

.service-row {
  display: grid;
  grid-template-columns: 36% 1fr;
  gap: 28px;
  align-items: baseline;
  padding: 21px 0;
  border-bottom: 1px solid var(--line);
}

.service-row h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -.02em;
}

.service-row p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}

.level-start {
  position: absolute;
  top: 62px;
  right: max(198px, calc(50vw - 390px));
  width: 0;
  height: 0;
}

.level-overlay {
  position: absolute;
  inset: 0;
  z-index: 30;
  pointer-events: none;
}

.level-tool {
  position: absolute;
  left: 50%;
  top: 50%;
  display: flex;
  align-items: center;
  justify-content: space-around;
  width: 330px;
  height: 62px;
  border: 2px solid #5b4a2d;
  background: #c9a85f;
  box-shadow: inset 0 4px 0 #e0c27a, inset 0 -4px 0 #a88445, 3px 4px 0 #1e29232b;
  cursor: grab;
  pointer-events: auto;
  touch-action: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  transform: translate(-50%, -50%);
}
.level-tool:active { cursor: grabbing; }
.level-rotate-handle {
  position: absolute;
  right: -22px;
  top: 50%;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--paper);
  transform: translateY(-50%);
  cursor: crosshair;
}
.level-rotate-handle svg { width: 22px; height: 22px; fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.level-endcap { width: 10px; height: 100%; background: #65563b; box-shadow: inset 3px 0 0 #877552; }
.level-vial,
.game-vial {
  position: relative;
  display: block;
  width: 66px;
  height: 25px;
  overflow: hidden;
  border: 2px solid #596b4e;
  border-radius: 8px;
  background: #cadca9;
  box-shadow: inset 0 0 0 2px #a9c08c;
}
.level-vial::before,
.level-vial::after,
.game-vial::before,
.game-vial::after {
  content: "";
  position: absolute;
  z-index: 1;
  top: 3px;
  bottom: 3px;
  width: 1px;
  background: #4c6541;
}
.level-vial::before,
.game-vial::before { left: 38%; }
.level-vial::after,
.game-vial::after { right: 38%; }
.level-vial-vertical { width: 48px; transform: rotate(90deg); }
.level-vial-main { width: 86px; }
.level-vial-diagonal { width: 52px; transform: rotate(45deg); }
.level-bubble {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 50%;
  width: 16px;
  height: 16px;
  border: 1px solid #829b67;
  border-radius: 50%;
  background: #eef6d9;
  box-shadow: inset -2px -2px 0 #dcebb9, inset 1px 1px 0 #ffffffb3;
  transform: translate3d(0, -50%, 0) translateX(-50%);
  will-change: transform;
}

.about { background: var(--soft); }

.about-grid,
.contact-grid {
  display: grid;
  grid-template-columns: 36% 1fr;
  gap: 28px;
}

.about-grid h2 { margin: 0; }

.about-grid p {
  max-width: 630px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}

.about-grid .about-since {
  margin-bottom: 13px;
  padding-left: 15px;
  border-left: 2px solid var(--detail);
  color: var(--ink);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -.03em;
}

.contact-grid > div:first-child p {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
}

.contact-links a {
  display: block;
  overflow-wrap: anywhere;
  padding: 4px 0 12px;
  border-bottom: 1px solid var(--line);
  font-size: clamp(23px, 2.6vw, 32px);
  font-weight: 500;
  letter-spacing: -.035em;
}

.contact-links a + a { margin-top: 13px; }
.contact-links a:hover { color: var(--accent); }

.contact-links p {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.location {
  display: grid;
  grid-template-columns: 36% 1fr;
  gap: 28px;
  margin-top: 62px;
  padding-top: 30px;
  border-top: 1px solid var(--line);
}

.location h3 {
  margin-bottom: 14px;
  font-size: 14px;
  font-weight: 600;
}

.location address {
  margin-bottom: 18px;
  font-size: 16px;
  font-style: normal;
  line-height: 1.6;
}

.map-wrap {
  position: relative;
  contain: layout paint;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 250px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #cbd0c3 url("map-fallback.svg") center / cover no-repeat;
}

.map-wrap iframe {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  max-width: 100%;
  height: 100%;
  border: 0;
}

.site-footer { border-top: 1px solid var(--line); }

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding-block: 24px;
  color: var(--muted);
  font-size: 12px;
}
.footer-actions { display: flex; align-items: center; gap: 22px; }
.easter-trigger {
  padding: 0;
  border: 0;
  border-bottom: 1px dotted currentColor;
  background: none;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
}
.easter-trigger:hover { color: var(--accent); }

.game-dialog {
  width: min(560px, calc(100% - 32px));
  max-height: min(90vh, 750px);
  padding: 26px;
  overflow-y: auto;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  box-shadow: 8px 10px 0 #1e29234d;
}
.game-dialog::backdrop { background: #111d18b3; }
.game-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 24px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.game-top button { padding: 5px 0; border: 0; border-bottom: 1px solid currentColor; background: none; color: var(--muted); font: inherit; font-size: 11px; cursor: pointer; }
.game-dialog h2 { margin-bottom: 9px; font-size: clamp(28px, 6vw, 40px); font-weight: 600; letter-spacing: -.05em; }
.game-dialog > p:not(.game-result) { margin-bottom: 19px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.game-copy-motion { display: none; }
.game-dialog.is-motion .game-copy-desktop { display: none; }
.game-dialog.is-motion .game-copy-motion { display: block; }
.game-stage { position: relative; display: grid; place-items: center; height: 290px; overflow: hidden; border: 1px solid var(--line); background: #e8ebe3; }
.game-stage::after { content: ""; position: absolute; top: 79%; right: 10%; left: 10%; border-top: 1px dashed #92a497; pointer-events: none; }
.game-wind { position: absolute; inset: 0; width: 100%; height: 100%; fill: none; stroke: #618c7d; stroke-width: 2.5; stroke-linecap: round; opacity: var(--wind-opacity, .45); pointer-events: none; }
.game-wind path { stroke-dasharray: 58 35 10 46; vector-effect: non-scaling-stroke; }
.game-wind path:nth-child(2) { opacity: .8; }
.game-wind path:nth-child(3) { opacity: .9; }
.game-wind path:nth-child(4) { opacity: .7; }
.game-house { position: relative; z-index: 1; width: 250px; height: 215px; cursor: grab; touch-action: none; user-select: none; transform-origin: 50% 50%; }
.game-house:active { cursor: grabbing; }
.game-dialog.is-motion .game-house { cursor: default; }
.game-house svg { display: block; width: 100%; height: 100%; fill: none; stroke: var(--ink); stroke-width: 7; stroke-linecap: square; stroke-linejoin: miter; }
.game-vial { position: absolute; left: 50%; bottom: 3px; width: 80px; transform: translateX(-50%); }
.game-guide { width: min(250px, 100%); margin: 11px auto 0; text-align: center; pointer-events: none; }
.game-guide-label { display: block; margin-bottom: 2px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.game-guide-track { position: relative; display: block; height: 19px; border-bottom: 1px solid #849789; }
.game-guide-zone { position: absolute; bottom: 0; left: 39.583%; width: 20.834%; height: 14px; background: #afc9ac; }
.game-guide-marker { position: absolute; bottom: -3px; left: 50%; width: 3px; height: 22px; background: var(--ink); transform: translateX(-50%); }
.game-progress { height: 8px; margin-top: 16px; overflow: hidden; background: #dce2d8; }
.game-progress span { display: block; width: 0; height: 100%; background: var(--accent); }
.game-result { min-height: 24px; margin: 15px 0 0; color: var(--accent); font-size: 14px; font-weight: 600; }

@media (max-width: 900px) {
  .desktop-nav, .header-phone { display: none; }
  .header-actions { margin-left: auto; }
  .mobile-menu { display: block; position: relative; }
  .mobile-menu summary {
    cursor: pointer;
    list-style: none;
    font-size: 13px;
    font-weight: 600;
  }
  .mobile-menu summary::-webkit-details-marker { display: none; }
  .mobile-menu nav {
    position: absolute;
    top: 30px;
    right: 0;
    z-index: 10;
    width: 220px;
    padding: 8px 18px;
    border: 1px solid var(--line);
    background: var(--paper);
  }
  .mobile-menu nav a {
    display: block;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
    font-size: 14px;
  }
  .mobile-menu nav a:last-child { border-bottom: 0; }
}

@media (max-width: 650px) {
  .shell { width: calc(100% - 32px); }
  .header-inner { min-height: 66px; gap: 20px; }
  .brand { min-width: 0; }
  .brand strong { font-size: 18px; }
  .brand span { font-size: 10px; }
  .header-actions { display: none; }
  .mobile-menu { margin-left: auto; }

  .hero { padding: 72px 0 76px; }
  .hero .shell::before { width: 34px; margin-bottom: 24px; }
  .hero h1 { font-size: clamp(40px, 10vw, 56px); }
  .hero p { font-size: 16px; }
  .hero-actions { flex-wrap: wrap; gap: 22px; }

  .section { padding: 58px 0; }
  .section h2 { margin-bottom: 22px; font-size: 34px; }
  .service-row { display: block; padding: 19px 0; }
  .service-row h3 { margin-bottom: 6px; font-size: 17px; }
  .service-row p { font-size: 14px; }

  .level-tool { width: min(230px, 66vw); height: 54px; }
  .level-start { top: 47px; right: 160px; }
  .level-vial { width: 47px; }
  .level-vial-main { width: 68px; }
  .level-vial-vertical { width: 43px; }
  .level-vial-diagonal { width: 45px; }

  .about-grid, .contact-grid, .location { display: block; }
  .about-grid h2 { margin-bottom: 20px; }
  .about-grid .about-since { font-size: 20px; }
  .contact-links { margin-top: 24px; }
  .location { margin-top: 42px; }
  .map-wrap { margin-top: 30px; background-position: right center; }
  .footer-inner { align-items: flex-start; }
  .game-dialog { padding: 20px; }
  .game-stage { height: 250px; }
  .game-house { width: 210px; height: 180px; }
}

.level-tool.is-touch .level-rotate-handle { display: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
