/* /demos/: working prototypes. Layered on /insights/article.css, so it keeps
   the fresco sky, the pill nav and the soft corners of the inner pages.
   One accent, the site blue, and it means one thing on these pages: where
   you are, or what you can move.
   Copied to public/demos/. */

.is-demos main { overflow-x: clip; }

.d-head,
.d-cards,
.w,
.d-steps,
.d-contact,
.d-notes {
  max-width: var(--max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--gut);
  padding-right: var(--gut);
}

/* ------------------------------------------------------------------ head */

.d-head { padding-top: clamp(64px, 9vw, 120px); padding-bottom: clamp(24px, 3vw, 40px); }
.d-head-demo { padding-top: clamp(40px, 6vw, 80px); }
.d-head h1 {
  max-width: 16ch;
  margin: 0;
  font-size: clamp(2.6rem, 6.6vw, 5.6rem);
  font-weight: 400;
  line-height: 0.96;
  letter-spacing: -0.04em;
  text-wrap: balance;
}
html[lang='ja'] .d-head h1 { max-width: 12em; font-size: clamp(2.2rem, 5.4vw, 4.6rem); letter-spacing: -0.02em; line-height: 0.98; word-break: auto-phrase; }
.d-lede {
  max-width: 40rem;
  margin: 24px 0 0;
  font-size: clamp(1.05rem, 1.5vw, 1.25rem);
  line-height: 1.45;
  color: var(--ink-2);
  text-wrap: pretty;
}
.d-meta {
  display: block;
  margin: 0 0 16px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--ink-3);
}
.d-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 32px;
  font-size: 14px;
  color: var(--ink-2);
  text-decoration: none;
}
.d-back::before { content: ''; width: 7px; height: 7px; border-left: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); }
.d-back:hover { color: var(--ink); }

/* ---------------------------------------------------------------- index */

.d-cards { list-style: none; margin-top: 0; margin-bottom: 0; display: grid; gap: 24px; }
.d-card a {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: center;
  padding: 16px;
  border-radius: 24px;
  background: #fff;
  box-shadow: var(--shadow);
  color: inherit;
  text-decoration: none;
}
.d-card-media { display: block; overflow: hidden; border-radius: 12px; aspect-ratio: 16 / 10; background: #e9edf2; }
.d-card-media img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s var(--e-out); }
.d-card-text { display: flex; flex-direction: column; align-items: flex-start; padding: 8px 16px 8px 0; }
.d-card-title { font-size: clamp(1.75rem, 3vw, 2.75rem); font-weight: 400; line-height: 0.96; letter-spacing: -0.03em; text-wrap: balance; }
html[lang='ja'] .d-card-title { letter-spacing: -0.01em; line-height: 1; }
.d-card-line { margin-top: 16px; max-width: 30rem; font-size: 16px; line-height: 1.45; color: var(--ink-2); }
.d-open {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  margin-top: 32px;
  padding: 0 20px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}
@media (hover: hover) and (pointer: fine) {
  .d-card a:hover .d-card-media img { transform: scale(1.03); }
  .d-card a:hover .d-open { background: #262a38; }
}
.d-card a:active .d-open { transform: scale(0.97); }
@media (max-width: 820px) {
  .d-card a { grid-template-columns: 1fr; gap: 16px; padding: 12px; border-radius: 20px; }
  .d-card-text { padding: 4px 8px 12px; }
  .d-open { margin-top: 24px; }
}

/* ------------------------------------------------------------- the stage */

.w-stage {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  max-height: calc(100svh - 112px);
  min-height: 420px;
  width: 100%;
  border-radius: var(--radius);
  background: #e9edf2;
  box-shadow: var(--shadow);
  isolation: isolate;
}
@media (max-width: 720px) {
  .w-stage { aspect-ratio: 4 / 5; min-height: 0; max-height: calc(100svh - 96px); }
}
.w-poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
  transition: opacity 0.4s var(--e-out), visibility 0.4s;
}
.is-ready .w-poster { opacity: 0; visibility: hidden; }
.w-canvas { display: block; width: 100%; height: 100%; outline: none; touch-action: pan-y; cursor: grab; -webkit-tap-highlight-color: transparent; }
.w-canvas:active { cursor: grabbing; }
.w-canvas:focus-visible { box-shadow: inset 0 0 0 2px #0000ee; }
.w[data-mode='edit'] .w-canvas { touch-action: none; }
.is-dragging .w-canvas { cursor: grabbing !important; }

.w-room,
.w-mini,
.w-bar,
.w-reset,
.w-labels { position: absolute; z-index: 2; }
.w-reset { top: 16px; right: 16px; }
.w-reset[hidden] { display: none; }

.w-room {
  top: 16px;
  left: 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-width: calc(100% - 300px);
  padding: 10px 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s var(--e-out);
}
.is-ready .w-room { opacity: 1; }
.w[data-mode='edit'] .w-room { opacity: 0; }
.w-room b { font-size: 16px; font-weight: 500; line-height: 1.2; }
.w-room span { font-size: 13px; line-height: 1.35; color: var(--ink-2); font-variant-numeric: tabular-nums; }

.w-mini {
  top: 16px;
  right: 16px;
  width: 248px;
  height: 140px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 1px 2px rgba(17, 18, 20, 0.06), 0 8px 24px -8px rgba(17, 18, 20, 0.18);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.25s var(--e-out);
}
.is-ready .w-mini { opacity: 1; }
.w[data-mode='edit'] .w-mini { opacity: 0; pointer-events: none; }

.w-bar {
  left: 16px;
  bottom: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.w-seg {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(243, 244, 246, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.w-seg button,
.w-text {
  height: 36px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  color: #4a4e5e;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.18s var(--e-out), color 0.18s var(--e-out);
}
.w-seg button[aria-pressed='true'] { background: var(--ink); color: #fff; }
.w-text { height: 44px; padding: 0 20px; background: rgba(255, 255, 255, 0.92); color: var(--ink); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
@media (hover: hover) and (pointer: fine) {
  .w-seg button:not([aria-pressed='true']):hover { color: var(--ink); background: rgba(255, 255, 255, 0.7); }
  .w-text:hover { background: #fff; }
}
.w-seg button:active,
.w-text:active { transform: scale(0.97); }
.w-seg button:focus-visible,
.w-text:focus-visible { outline: 2px solid #0000ee; outline-offset: 2px; }

.w-labels { inset: 0; pointer-events: none; }
.w-label {
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 4px 16px -6px rgba(17, 18, 20, 0.25);
  text-align: center;
  white-space: nowrap;
  will-change: transform;
}
.w-label b { font-size: 13px; font-weight: 500; line-height: 1.2; }
.w-label i { font-size: 11px; font-style: normal; line-height: 1.3; color: var(--ink-3); }
.w-label span { margin-top: 2px; font-family: var(--mono); font-size: 11px; line-height: 1.2; color: #0000ee; font-variant-numeric: tabular-nums; }
.w-label.is-small { padding: 4px 8px; }
.w-label.is-small i { display: none; }

.w-noscript {
  position: absolute;
  left: 16px;
  bottom: 16px;
  z-index: 3;
  margin: 0;
  padding: 10px 16px;
  border-radius: 12px;
  background: #fff;
  font-size: 14px;
}

.w-under {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 24px;
  padding-top: 16px;
  font-size: 14px;
  line-height: 1.4;
}
.w-under p { margin: 0; }
.w-hint { color: var(--ink-2); min-height: 1.4em; }
.w-note { color: var(--ink-3); text-align: right; }
.w-log {
  grid-column: 1 / -1;
  display: flex;
  gap: 10px;
  align-items: baseline;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.w-log::before { content: ''; flex: none; width: 8px; height: 8px; border-radius: 50%; background: #0000ee; transform: translateY(-1px); }
.w-log[hidden] { display: none; }
.is-nogl .w-bar,
.is-nogl .w-mini,
.is-nogl .w-room { display: none; }

@media (max-width: 720px) {
  .w-room { top: 12px; left: 12px; max-width: calc(100% - 184px); padding: 8px 12px; }
  .w-room b { font-size: 15px; }
  .w-room span { font-size: 12px; }
  .w-mini { top: 12px; right: 12px; width: 152px; height: 88px; border-radius: 10px; }
  .w-bar { left: 12px; right: 12px; bottom: 12px; }
  .w-seg { flex: 1 1 100%; }
  .w-seg button { flex: 1; padding: 0 8px; height: 40px; }
  .w-text { height: 40px; padding: 0 16px; }
  .w-reset { top: 12px; right: 12px; }
  /* the Tour button already replays; one row of controls on a phone */
  [data-replay] { display: none !important; }
  .w-label { padding: 4px 8px; }
  .w-label i { display: none; }
  .w-label b { font-size: 12px; }
  .w-label.is-tight { padding: 2px 6px; }
  .w-label.is-tight b { font-size: 10px; }
  .w-label.is-tight span { display: none; }
  .w-under { grid-template-columns: 1fr; }
  .w-note { text-align: left; }
}

/* ------------------------------------------------------------ the steps */

.d-steps { padding-top: clamp(96px, 12vw, 160px); }
.d-steps > h2,
.d-notes h2 {
  margin: 0;
  font-size: clamp(1.75rem, 3.4vw, 2.75rem);
  font-weight: 400;
  line-height: 0.96;
  letter-spacing: -0.03em;
}
html[lang='ja'] .d-steps > h2,
html[lang='ja'] .d-notes h2 { letter-spacing: -0.01em; line-height: 1.04; }
.d-step-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px clamp(24px, 4vw, 56px);
  margin: 48px 0 0;
  padding: 0;
}
.d-step-list li { padding-top: 24px; border-top: 1px solid var(--line); }
.d-num { font-family: var(--mono); font-size: 12px; letter-spacing: 0.04em; color: var(--ink-3); }
.d-step-list h3 { margin: 8px 0 0; font-size: 20px; font-weight: 500; line-height: 1.15; letter-spacing: -0.01em; }
.d-step-list p { margin: 12px 0 0; font-size: 16px; line-height: 1.45; color: var(--ink-2); }
@media (max-width: 820px) {
  .d-step-list { grid-template-columns: 1fr; margin-top: 32px; }
}

.d-io {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: 24px;
  margin-top: 64px;
  align-items: stretch;
}
.d-fig { display: flex; flex-direction: column; margin: 0; }
.d-fig > svg,
.d-objects { flex: 1; border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.d-fig figcaption { margin-top: 12px; font-family: var(--mono); font-size: 12px; letter-spacing: 0.04em; color: var(--ink-3); }
.d-plan { display: block; width: 100%; height: auto; padding: 16px; }
.d-plan .p-l,
.d-plan .p-m,
.d-plan .p-s,
.d-plan .p-d { text-anchor: middle; font-family: var(--font); fill: #111214; }
.d-plan .p-l { font-size: 17px; font-weight: 500; }
.d-plan .p-m { font-size: 13px; font-weight: 500; }
.d-plan .p-s { font-size: 10px; fill: #4a4e5e; }
.d-plan .p-d { font-family: var(--mono); font-size: 10px; fill: #686c7e; }
.d-objects { display: flex; flex-direction: column; min-width: 0; padding: 24px; }
.d-counts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 24px; margin: 0; }
.d-counts div { padding-bottom: 12px; border-bottom: 1px solid var(--line-soft); }
.d-counts dt { font-size: 13px; line-height: 1.35; color: var(--ink-2); }
.d-counts dd { margin: 4px 0 0; font-size: 32px; line-height: 1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.d-excerpt-label { margin: 24px 0 8px; font-size: 13px; color: var(--ink-2); }
.d-json {
  flex: 1;
  overflow: auto;
  max-height: 360px;
  margin: 0;
  padding: 16px;
  border-radius: 10px;
  background: #f4f5f7;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.5;
  color: #2b2e36;
  tab-size: 2;
}
@media (max-width: 960px) {
  .d-io { grid-template-columns: 1fr; margin-top: 48px; }
}

/* ------------------------------------------------------------ the notes */

.d-notes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 48px clamp(24px, 5vw, 80px);
  padding-top: clamp(120px, 13vw, 176px);
}
.d-notes h2 { max-width: 18ch; font-size: clamp(1.5rem, 2.6vw, 2.1rem); }
html[lang='ja'] .d-notes h2 { max-width: 16em; }
.d-notes p { max-width: 34rem; margin: 16px 0 0; font-size: 16px; line-height: 1.45; color: var(--ink-2); }
@media (max-width: 820px) {
  .d-notes { grid-template-columns: 1fr; }
}

/* ----------------------------------------------------------- inquiry */

.d-contact {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 48px clamp(24px, 5vw, 80px);
  align-items: start;
  padding-top: clamp(120px, 13vw, 176px);
  padding-bottom: clamp(48px, 6vw, 80px);
  scroll-margin-top: 24px;
}
.d-contact h2 { max-width: 12ch; margin: 0; font-size: clamp(2.2rem, 4.6vw, 3.8rem); font-weight: 400; line-height: 0.98; letter-spacing: -0.04em; }
html[lang='ja'] .d-contact h2 { max-width: 9em; letter-spacing: -0.01em; line-height: 1.08; }
.d-contact-copy p { max-width: 30rem; margin: 24px 0 0; font-size: 18px; line-height: 1.45; color: var(--ink-2); }
.d-contact-copy ul { margin: 32px 0 0; padding: 0; list-style: none; }
.d-contact-copy li { padding: 12px 0; border-top: 1px solid var(--line); font-size: 16px; line-height: 1.4; }
.d-contact-copy li:last-child { border-bottom: 1px solid var(--line); }
.d-mail { display: inline-block; margin-top: 24px; font-size: 16px; color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
.d-mail:hover { color: var(--blue); }
.d-form { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 16px; padding: 32px; border-radius: 24px; background: #f3f4f6; }
.d-field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.d-field-wide { grid-column: 1 / -1; }
.d-field label { padding-left: 4px; font-size: 14px; line-height: 1.3; color: var(--ink-2); }
.d-field input, .d-field select, .d-field textarea {
  width: 100%; height: 52px; padding: 0 16px; border: 1px solid transparent; border-radius: 16px;
  background: #fff; color: var(--ink); font: 400 16px/1.4 var(--font); appearance: none;
}
.d-field textarea { height: auto; min-height: 120px; padding: 14px 16px; resize: vertical; }
.d-field select { background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%); background-position: calc(100% - 24px) 23px, calc(100% - 18px) 23px; background-size: 6px 6px; background-repeat: no-repeat; }
.d-field input:hover, .d-field select:hover, .d-field textarea:hover { border-color: #b9bcc6; }
.d-field input:focus-visible, .d-field select:focus-visible, .d-field textarea:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }
.d-field input:user-invalid { border-color: #b3261e; }
.d-field ::placeholder { color: #7a7f87; }
.d-form-foot { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.d-form-foot .a-btn { border: 0; cursor: pointer; }
.d-form-foot .a-btn:disabled { opacity: 0.6; cursor: default; }
.d-form-note { margin: 0; font-size: 14px; line-height: 1.4; color: var(--ink-2); }
.d-form-note[data-tone='ok'] { color: #1c7a4b; }
.d-form-note[data-tone='err'] { color: #b3261e; }
.d-form-privacy { margin: 0; font-size: 13px; line-height: 1.4; color: var(--ink-3); }
.d-form-privacy a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.d-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
@media (max-width: 820px) {
  .d-contact { grid-template-columns: 1fr; }
  .d-form { grid-template-columns: 1fr; padding: 20px; border-radius: 20px; }
}

.is-demos .a-cta { margin-top: clamp(96px, 11vw, 144px); }
.is-demos .a-cta h2 { line-height: 0.98; }
