:root {
  color-scheme: light;
  --sand: #f3eee4;
  --sand-2: #e7ddd0;
  --paper: #fffdf8;
  --ink: #1c1612;
  --muted: #6b6258;
  --line: #d9cfc2;
  --teal: #0f766e;
  --teal-dark: #115e59;
  --teal-soft: #d7efe9;
  --copper: #c45c26;
  --copper-dark: #9a3f14;
  --moss: #4d6b3d;
  --danger: #b42318;
  --ok: #2f6b3c;
  --shadow: 0 18px 50px rgba(28, 22, 18, 0.08);
  --radius: 20px;
  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", sans-serif;
  --serif: "Iowan Old Style", Palatino, "Palatino Linotype", "Book Antiqua", Georgia, serif;
  --mono: "Cascadia Mono", "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 420px at 10% -10%, #e7f3ef 0%, transparent 55%),
    radial-gradient(900px 380px at 110% 0%, #f6e6d6 0%, transparent 50%),
    var(--sand);
  line-height: 1.55;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--teal-dark); }
a:hover { color: var(--copper-dark); }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; }
h1 { font-size: clamp(2rem, 4vw, 3.2rem); margin: 0 0 0.4em; }
h2 { font-size: clamp(1.45rem, 2.4vw, 2rem); margin: 0 0 0.55em; }
h3 { font-size: 1.15rem; margin: 0 0 0.4em; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; }

.skip-link {
  position: absolute; left: 1rem; top: -3rem; background: var(--ink); color: #fff;
  padding: 0.5rem 0.8rem; border-radius: 8px; z-index: 100;
}
.skip-link:focus { top: 0.6rem; }

.site-header {
  position: sticky; top: 0; z-index: 40;
  backdrop-filter: blur(14px);
  background: rgba(243, 238, 228, 0.86);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  max-width: 1120px; margin: 0 auto; padding: 0.7rem 1.2rem;
  display: flex; align-items: center; gap: 1rem;
}
.brand {
  display: flex; align-items: center; gap: 0.7rem;
  text-decoration: none; color: var(--ink); margin-right: auto;
}
.brand img { width: 44px; height: 44px; border-radius: 50%; background: #fff; }
.brand strong { display: block; font-family: var(--serif); font-size: 1.15rem; }
.brand small { display: block; color: var(--muted); font-size: 0.78rem; }
.nav-toggle {
  display: none; border: 1px solid var(--line); background: var(--paper);
  border-radius: 999px; padding: 0.45rem 0.9rem; font: inherit; cursor: pointer;
}
.site-nav { display: flex; align-items: center; gap: 0.2rem; flex-wrap: wrap; }
.site-nav a {
  text-decoration: none; color: var(--ink); padding: 0.45rem 0.75rem;
  border-radius: 999px; font-size: 0.95rem;
}
.site-nav a:hover, .site-nav a.is-active { background: var(--teal-soft); color: var(--teal-dark); }
.nav-cta {
  background: var(--teal) !important; color: #fff !important;
  margin-left: 0.3rem;
}
.nav-cta:hover { background: var(--teal-dark) !important; }

.wrap, .wrap-wide, .hero-wrap {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
}
.wrap { padding: 2rem 0 4rem; }
.wrap-narrow { width: min(560px, calc(100% - 2rem)); margin: 0 auto; padding: 2.4rem 0 4rem; }

.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.4rem 1rem 2rem;
  color: var(--muted); font-size: 0.9rem;
}
.footer-inner {
  width: min(1120px, calc(100% - 0rem)); margin: 0 auto;
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
}
.site-footer a { margin-right: 1rem; color: var(--muted); }

.flash {
  border-radius: 14px; padding: 0.85rem 1rem; margin: 0 0 1.2rem;
  border: 1px solid var(--line); background: var(--paper);
}
.flash-ok, .flash-success { background: #e7f6ea; border-color: #b7dfbf; color: var(--ok); }
.flash-error { background: #fdecea; border-color: #f4c0bb; color: var(--danger); }
.flash-info { background: var(--teal-soft); border-color: #b7ddd6; color: var(--teal-dark); }

.hero {
  display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 2.4rem;
  align-items: center; padding: 2.4rem 0 1rem;
}
.hero-copy p.lead { font-size: 1.15rem; color: var(--muted); max-width: 36rem; }
.hero-actions { display: flex; gap: 0.7rem; flex-wrap: wrap; margin-top: 1.4rem; }
.hero-visual {
  position: relative; border-radius: 28px; overflow: hidden;
  box-shadow: var(--shadow); min-height: 280px;
}
.hero-visual img { width: 100%; height: 420px; object-fit: cover; }
.hero-badge {
  position: absolute; left: 1rem; bottom: 1rem;
  background: rgba(255, 253, 248, 0.92); padding: 0.6rem 0.9rem;
  border-radius: 14px; font-size: 0.9rem;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  border: 0; border-radius: 999px; padding: 0.72rem 1.2rem;
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
}
.btn-primary { background: var(--teal); color: #fff; }
.btn-primary:hover { background: var(--teal-dark); color: #fff; }
.btn-copper { background: var(--copper); color: #fff; }
.btn-copper:hover { background: var(--copper-dark); color: #fff; }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn-ghost:hover { background: var(--paper); color: var(--ink); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-block { width: 100%; }
.btn-small { padding: 0.4rem 0.8rem; font-size: 0.88rem; }

.steps {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem;
  margin: 2.5rem 0 3rem;
}
.step {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.2rem 1.2rem 1.3rem;
  box-shadow: var(--shadow);
}
.step-num {
  width: 2rem; height: 2rem; border-radius: 50%;
  background: var(--teal-soft); color: var(--teal-dark);
  display: grid; place-items: center; font-weight: 700; margin-bottom: 0.7rem;
}
.step p { color: var(--muted); margin: 0; }

.app-download {
  margin: 0 0 2.8rem;
}
.app-download-inner {
  display: flex; gap: 1.2rem; align-items: center; flex-wrap: wrap;
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.2rem 1.3rem;
  box-shadow: var(--shadow);
}
.app-download-inner img {
  width: 72px; height: 72px; border-radius: 18px; background: #fff;
}
.app-download-inner h2 { margin: 0 0 0.25rem; }
.app-download-inner p { margin: 0 0 0.85rem; max-width: 42rem; }
.inline-form { display: inline; }
.admin-thumb { width: 48px; height: 48px; object-fit: cover; border-radius: 8px; }
.admin-pw {
  width: 9.5rem; display: inline-block; padding: 0.35rem 0.5rem;
  font: inherit; border: 1px solid var(--line); border-radius: 8px; margin-right: 0.3rem;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}
.tile {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: 18px; overflow: hidden; text-decoration: none; color: inherit;
  box-shadow: var(--shadow); display: flex; flex-direction: column;
}
.tile img { width: 100%; aspect-ratio: 1; object-fit: cover; background: var(--sand-2); }
.tile-body { padding: 0.75rem 0.85rem 0.95rem; }
.tile-body strong { display: block; font-size: 0.98rem; }
.muted { color: var(--muted); }
.small { font-size: 0.88rem; }

.stamp {
  display: inline-block;
  font-family: var(--mono);
  letter-spacing: 0.16em;
  font-weight: 700;
  color: var(--teal-dark);
  background: var(--teal-soft);
  border: 1.5px dashed var(--teal);
  border-radius: 8px;
  padding: 0.15rem 0.5rem;
  font-size: 0.85rem;
}

.badge {
  display: inline-block; border-radius: 999px; padding: 0.15rem 0.6rem;
  font-size: 0.78rem; font-weight: 650;
}
.badge-teal { background: var(--teal-soft); color: var(--teal-dark); }
.badge-copper { background: #f8e1d2; color: var(--copper-dark); }
.badge-moss { background: #e3efd8; color: var(--moss); }
.badge-muted { background: var(--sand-2); color: var(--muted); }

.card {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.2rem; box-shadow: var(--shadow);
}
.card + .card { margin-top: 1rem; }
.stone-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.1rem;
}
.stone-card { overflow: hidden; padding: 0; display: flex; flex-direction: column; }
.stone-card img { width: 100%; height: 210px; object-fit: cover; background: var(--sand-2); }
.stone-card .body { padding: 1rem 1.05rem 1.15rem; display: flex; flex-direction: column; gap: 0.45rem; flex: 1; }
.stone-card .actions { display: flex; flex-direction: column; gap: 0.4rem; margin-top: 0.5rem; }

.form { display: grid; gap: 0.85rem; }
label { font-weight: 650; font-size: 0.92rem; }
input[type="text"], input[type="email"], input[type="password"], input[type="file"], textarea, select {
  width: 100%; font: inherit; padding: 0.7rem 0.8rem;
  border: 1px solid var(--line); border-radius: 12px; background: #fff;
}
textarea { min-height: 110px; resize: vertical; }
.help { color: var(--muted); font-size: 0.85rem; margin: 0.25rem 0 0; }
.hp { position: absolute; left: -9999px; height: 0; overflow: hidden; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 0.7rem 0.5rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; }

.stone-hero {
  display: grid; grid-template-columns: 320px 1fr; gap: 1.5rem; align-items: start;
}
.stone-photo { border-radius: 22px; overflow: hidden; background: var(--sand-2); box-shadow: var(--shadow); }
.stone-photo img { width: 100%; aspect-ratio: 1; object-fit: cover; }
#map, .map {
  height: 420px; width: 100%; border-radius: 22px; overflow: hidden;
  border: 1px solid var(--line); background: var(--sand-2);
}
.log-list { display: grid; gap: 0.75rem; margin-top: 1rem; }
.log-item { display: grid; gap: 0.2rem; }
.log-meta { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }

.choice-row { display: grid; gap: 0.6rem; }
.choice {
  display: flex; gap: 0.75rem; align-items: flex-start;
  border: 1px solid var(--line); border-radius: 14px; padding: 0.8rem 0.9rem;
  background: #fff; cursor: pointer;
}
.choice:has(input:checked) { border-color: var(--teal); background: var(--teal-soft); }
.choice input { margin-top: 0.25rem; }
.auth-visual { border-radius: 22px; overflow: hidden; margin-bottom: 1.2rem; }
.auth-visual img { width: 100%; height: 160px; object-fit: cover; }

.section-head { display: flex; justify-content: space-between; gap: 1rem; align-items: end; margin: 2rem 0 1rem; }
.empty { color: var(--muted); padding: 1rem 0; }

.mark-box {
  display: flex; gap: 1rem; align-items: center; flex-wrap: wrap;
  background: var(--teal-soft); border: 1px solid var(--line);
  border-radius: 16px; padding: 1rem;
}
.mark-field {
  width: 160px; min-height: 110px;
  background: #fff; border: 2px solid #d8d2c8; border-radius: 10px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0.35rem; padding: 0.7rem 0.5rem; text-align: center;
  box-shadow: inset 0 0 0 1px #f4f1ea;
}
.mark-url {
  font-family: var(--serif); font-size: 0.82rem; color: var(--ink);
  letter-spacing: 0.02em;
}
.code-xl {
  font-family: var(--mono); font-size: clamp(1.35rem, 3vw, 1.9rem);
  letter-spacing: 0.16em; margin: 0; color: var(--teal-dark);
}

@media (max-width: 860px) {
  .hero, .stone-hero, .steps { grid-template-columns: 1fr; }
  .hero-visual img { height: 260px; }
  .nav-toggle { display: inline-flex; }
  .site-nav {
    display: none; position: absolute; right: 1rem; top: 4.2rem;
    background: var(--paper); border: 1px solid var(--line);
    border-radius: 16px; padding: 0.5rem; flex-direction: column;
    min-width: 220px; box-shadow: var(--shadow);
  }
  .site-nav.is-open { display: flex; }
  .header-inner { position: relative; }
  .nav-cta { margin-left: 0; }
  #map, .map { height: 300px; }
}
@media (max-width: 520px) {
  .hero-actions .btn { width: 100%; }
  .gallery { grid-template-columns: repeat(2, 1fr); }
}

@media print {
  .site-header, .site-footer, .nav-toggle, .no-print, .flash { display: none !important; }
  body { background: #fff; }
  .wrap, .wrap-narrow { width: auto; }
}

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