/* 表札デザイン入稿 — refined UI (v3, 2026-11-06)
   Reference: soft blue-grey gradient backdrop, frosted layered cards,
   large radii (24-28px), deep soft shadows, pill controls, Inter. */
:root {
  --ink: #0e1319;
  --copy: #52616f;
  --accent: #46689c;
  --line: rgba(14,19,25,.12);
  --card-radius: 26px;
  --shadow-card: 0 24px 48px -24px rgba(21,42,66,.28), 0 2px 6px rgba(21,42,66,.05), inset 0 1px 0 rgba(255,255,255,.85);
  --glass-bg: rgba(255,255,255,.68);
  --glass-line: rgba(255,255,255,.7);
}
* { box-sizing: border-box; }
body {
  font-family: "Inter", "Hiragino Kaku Gothic ProN", "Noto Sans JP", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
  margin: 0;
  background: linear-gradient(180deg, #c7d7e7 0%, #dbe6f0 30%, #ecf2f7 62%, #f8fafc 100%) fixed;
  color: var(--ink);
}
button, a { font: inherit; }
::selection { background: rgba(70,104,156,.20); }

/* ---------- animated background texture (kept from v2) ---------- */
body { isolation: isolate; }
body::before {
  content: "";
  position: fixed;
  inset: -120px;
  z-index: -2;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' seed='8' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)' opacity='.6'/%3E%3C/svg%3E");
  opacity: .38;
  mix-blend-mode: soft-light;
  animation: grain-drift 9s ease-in-out infinite alternate;
}
body::after {
  content: "";
  position: fixed;
  inset: -20%;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 55% 40% at 18% 8%, rgba(255,255,255,.55), transparent 70%),
    radial-gradient(ellipse 48% 38% at 85% 92%, rgba(96,132,190,.16), transparent 70%),
    radial-gradient(ellipse 40% 30% at 78% 10%, rgba(148,178,224,.14), transparent 70%);
  animation: ambient-drift 30s ease-in-out infinite alternate;
}
@keyframes grain-drift {
  from { transform: translate3d(-56px, -34px, 0); }
  to   { transform: translate3d(56px, 38px, 0); }
}
@keyframes ambient-drift {
  from { transform: translate3d(-2.5%, -1.5%, 0) scale(1); }
  to   { transform: translate3d(2.5%, 2%, 0) scale(1.06); }
}
@media (prefers-reduced-motion: reduce) {
  body::before, body::after { animation: none; }
}

/* ---------- header ---------- */
header.top {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(233,240,247,.55);
  backdrop-filter: blur(16px) saturate(1.5);
  -webkit-backdrop-filter: blur(16px) saturate(1.5);
  border-bottom: 1px solid rgba(255,255,255,.5);
  color: var(--ink);
  padding: 12px 20px;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
header.top .brand { font-weight: 650; font-size: 16px; letter-spacing: .01em; margin-right: 10px; }
header.top a {
  color: var(--copy);
  text-decoration: none;
  font-size: 13.5px;
  padding: 7px 13px;
  border-radius: 999px;
  transition: background .18s ease, color .18s ease, box-shadow .18s ease;
}
header.top a:hover { background: rgba(255,255,255,.92); color: var(--ink); box-shadow: 0 4px 14px -6px rgba(21,42,66,.25); }

main { max-width: 1180px; margin: 0 auto; padding: 26px 18px 48px; }
h1 { font-size: 22px; margin: 6px 0 16px; font-weight: 650; letter-spacing: .01em; }
h2 { font-size: 17px; margin: 30px 0 12px; font-weight: 650; letter-spacing: .01em; }

/* ---------- hero (index) ---------- */
.masthead {
  display: grid;
  grid-template-columns: minmax(0,1fr) minmax(0, clamp(260px, 32vw, 483px));
  gap: clamp(16px, 3vw, 40px);
  align-items: start;
  margin: clamp(18px, 5vh, 52px) 0 8px;
}
@media (max-width: 767px) { .masthead { grid-template-columns: minmax(0,1fr); } }
.headline {
  margin: 0;
  max-width: 100%;
  color: #0c1420;
  font-size: clamp(30px, min(3.9vw, 6.6vh), 56px);
  font-weight: 550;
  letter-spacing: .01em;
  line-height: 1.32;
}
.headline__line { display: flex; flex-wrap: nowrap; align-items: center; }
.headline__line > .line-text { white-space: pre; }
.dot-word {
  display: inline-block;
  flex: 0 0 auto;
  width: 4.851em;
  height: .766em;
  margin-left: .319em;
  color: var(--ink);
  transform: translateY(.085em);
}
.dot-svg { display: block; overflow: visible; color: inherit; }
.dot-word .dot-svg { width: 100%; height: 100%; }
.intro {
  width: 100%;
  margin: .34em 0 0;
  color: #46545f;
  font-size: clamp(13px, min(1.36vw, 2.6vh), 17px);
  font-weight: 400;
  letter-spacing: -.01em;
  line-height: 1.8;
}
.steps { display: flex; gap: 10px; flex-wrap: wrap; margin: 22px 0 6px; }
.step {
  display: flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,.60);
  backdrop-filter: blur(12px) saturate(1.4);
  -webkit-backdrop-filter: blur(12px) saturate(1.4);
  border: 1px solid var(--glass-line);
  border-radius: 999px;
  padding: 9px 18px 9px 12px;
  box-shadow: 0 10px 24px -14px rgba(21,42,66,.35), inset 0 1px 0 rgba(255,255,255,.8);
  font-size: 13.5px; color: var(--ink);
}
.step .dot-number { display: block; width: 32px; color: var(--ink); }
.dot-number .dot-svg { width: 100%; height: auto; }

/* ---------- glass panels & cards ---------- */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(18px) saturate(1.5);
  -webkit-backdrop-filter: blur(18px) saturate(1.5);
  border: 1px solid var(--glass-line);
  border-radius: var(--card-radius);
  box-shadow: var(--shadow-card);
  padding: 20px 22px;
}
/* layered "stacked card" look, like the reference's peeking progress card */
.stack-card { position: relative; z-index: 0; margin-top: 34px !important; }
.stack-card::before,
.stack-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: rgba(255,255,255,.45);
  border: 1px solid rgba(255,255,255,.5);
  z-index: -1;
}
.stack-card::before { transform: translateY(-13px) scale(.965); }
.stack-card::after  { transform: translateY(-25px) scale(.93); background: rgba(255,255,255,.26); z-index: -2; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.card {
  background: var(--glass-bg);
  backdrop-filter: blur(18px) saturate(1.5);
  -webkit-backdrop-filter: blur(18px) saturate(1.5);
  border: 1px solid var(--glass-line);
  border-radius: 24px;
  padding: 10px 10px 0;
  box-shadow: var(--shadow-card);
  transition: transform .22s ease, box-shadow .22s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 34px 60px -26px rgba(21,42,66,.38), 0 2px 6px rgba(21,42,66,.06), inset 0 1px 0 rgba(255,255,255,.85); }
.card img { width: 100%; height: 150px; object-fit: cover; display: block; border-radius: 16px; background: #dfe6ec; }
.card .body { padding: 14px 10px 16px; }
.card .name { font-weight: 650; font-size: 15.5px; letter-spacing: .01em; }
.card .meta { color: var(--copy); font-size: 13px; margin: 5px 0 12px; }

/* ---------- buttons (pill) ---------- */
.btn {
  display: inline-block;
  background: #0b0d10;
  color: #fff;
  border: 0;
  border-radius: 999px;
  padding: 11px 22px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -.01em;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 14px 26px -12px rgba(11,13,16,.55);
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 18px 32px -12px rgba(11,13,16,.55); }
.btn.sub { background: rgba(255,255,255,.88); color: var(--ink); box-shadow: 0 10px 22px -12px rgba(21,42,66,.35), inset 0 1px 0 rgba(255,255,255,.9); }
.btn.ghost { background: rgba(255,255,255,.25); color: var(--ink); border: 1px solid rgba(14,19,25,.20); box-shadow: none; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.btn:disabled { opacity: .5; cursor: default; transform: none; }
.btn.sm { padding: 7px 14px; font-size: 13px; }
.btn:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(70,104,156,.40);
  outline-offset: 2px;
}

/* ---------- forms ---------- */
input[type=text], input[type=email], input[type=number], input[type=password], select, textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  font-size: 14px;
  background: rgba(255,255,255,.94);
  color: var(--ink);
  box-shadow: inset 0 1px 2px rgba(21,42,66,.05);
}
label { font-size: 13px; color: var(--copy); display: block; margin: 12px 0 5px; }
.row { display: flex; gap: 10px; } .row > * { flex: 1; }

/* ---------- tables / notices ---------- */
table { width: 100%; border-collapse: collapse; background: rgba(255,255,255,.85); border-radius: 18px; overflow: hidden; box-shadow: var(--shadow-card); }
th, td { border-bottom: 1px solid rgba(14,19,25,.07); padding: 10px 12px; text-align: left; font-size: 14px; vertical-align: top; }
th { background: rgba(14,19,25,.04); font-weight: 650; }
.notice { background: #fff8e6; border: 1px solid #e5cf8f; border-radius: 16px; padding: 12px 14px; font-size: 14px; }
.error { background: #fdecea; border: 1px solid #e5a49d; border-radius: 16px; padding: 12px 14px; }
.ok { background: #eaf6ea; border: 1px solid #a9d3a9; border-radius: 16px; padding: 12px 14px; }
.muted { color: var(--copy); font-size: 13px; }

/* ---------- editor ---------- */
.editor-wrap { display: grid; grid-template-columns: 1fr 308px; gap: 18px; align-items: start; }
@media (max-width: 900px) { .editor-wrap { grid-template-columns: 1fr; } }
.stage {
  background: linear-gradient(180deg, rgba(255,255,255,.66), rgba(255,255,255,.34));
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border: 1px solid var(--glass-line);
  border-radius: var(--card-radius);
  box-shadow: var(--shadow-card);
  padding: 18px;
  overflow: auto;
}
.stage svg { background: #fff; width: 100%; height: auto; display: block; border-radius: 14px; box-shadow: 0 18px 38px -18px rgba(21,42,66,.45); touch-action: none; }
.panel {
  background: var(--glass-bg);
  backdrop-filter: blur(18px) saturate(1.5);
  -webkit-backdrop-filter: blur(18px) saturate(1.5);
  border: 1px solid var(--glass-line);
  border-radius: var(--card-radius);
  box-shadow: var(--shadow-card);
  padding: 18px;
}
.panel h3 { margin: 4px 0 10px; font-size: 15.5px; font-weight: 650; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; align-items: center; }
.objlist { list-style: none; margin: 8px 0; padding: 0; }
.objlist li { padding: 8px 11px; border: 1px solid rgba(14,19,25,.10); border-radius: 12px; margin-bottom: 6px; cursor: pointer; font-size: 13px; display: flex; justify-content: space-between; gap: 6px; background: rgba(255,255,255,.75); transition: background .15s ease, border-color .15s ease; }
.objlist li:hover { background: #fff; }
.objlist li.sel { background: rgba(70,104,156,.10); border-color: rgba(70,104,156,.45); }
.warn { color: #b3261e; font-size: 13px; }
dialog { border: 1px solid var(--glass-line); border-radius: var(--card-radius); padding: 24px; max-width: 480px; width: 92%; box-shadow: 0 34px 70px -20px rgba(21,42,66,.45); }
dialog code { background: rgba(14,19,25,.06); padding: 2px 7px; border-radius: 6px; }
.kv { font-size: 15px; margin: 6px 0; }

/* ---------- entrance (one-shot) ---------- */
html.entrance-active .headline__line,
html.entrance-active .intro,
html.entrance-active .steps .step,
html.entrance-active .cards .card,
html.entrance-active .glass,
html.entrance-active .stage,
html.entrance-active .panel {
  will-change: opacity, translate, scale, clip-path, filter;
}
@keyframes headline-reveal {
  from { opacity: 0; translate: 0 .52em; clip-path: inset(0 0 56% 0); }
  to   { opacity: 1; translate: none; clip-path: inset(-8% -2% -8% -2%); }
}
@keyframes support-reveal {
  from { opacity: 0; translate: 0 8px; }
  to   { opacity: 1; translate: none; }
}
@keyframes card-establish {
  from { opacity: .52; translate: 0 10px; scale: .985; }
  to   { opacity: 1; translate: none; scale: none; }
}
html.entrance-active .headline__line { animation: headline-reveal .84s cubic-bezier(.16,1,.3,1) both; }
html.entrance-active .headline__line--1 { animation-delay: .08s; }
html.entrance-active .headline__line--2 { animation-delay: .17s; }
html.entrance-active .intro { animation: support-reveal .72s cubic-bezier(.22,1,.36,1) .25s both; }
html.entrance-active .steps .step { animation: support-reveal .54s cubic-bezier(.22,1,.36,1) both; }
html.entrance-active .steps .step:nth-child(1) { animation-delay: .34s; }
html.entrance-active .steps .step:nth-child(2) { animation-delay: .42s; }
html.entrance-active .steps .step:nth-child(3) { animation-delay: .50s; }
html.entrance-active .glass { animation: card-establish .76s cubic-bezier(.16,1,.3,1) .46s both; }
html.entrance-active .cards .card { animation: card-establish .76s cubic-bezier(.16,1,.3,1) both; }
html.entrance-active .cards .card:nth-child(1) { animation-delay: .46s; }
html.entrance-active .cards .card:nth-child(2) { animation-delay: .58s; }
html.entrance-active .cards .card:nth-child(3) { animation-delay: .70s; }
html.entrance-active .cards .card:nth-child(4) { animation-delay: .82s; }
html.entrance-active .cards .card:nth-child(n+5) { animation-delay: .9s; }
html.entrance-active .stage { animation: card-establish .76s cubic-bezier(.16,1,.3,1) .30s both; }
html.entrance-active .panel { animation: card-establish .76s cubic-bezier(.16,1,.3,1) .42s both; }
@media (prefers-reduced-motion: reduce) {
  html.entrance-active .headline__line,
  html.entrance-active .intro,
  html.entrance-active .steps .step,
  html.entrance-active .cards .card,
  html.entrance-active .glass,
  html.entrance-active .stage,
  html.entrance-active .panel { animation: none; }
  * { transition-duration: .01ms !important; }
}
