:root {
  --bg: #f8f1e7;
  --bg-soft: #fbf7ef;
  --card: #fffdf8;
  --border: #eadfce;
  --text: #1f1b16;
  --muted: #7a7064;
  --primary: #9a5a00;
  --primary-dark: #7c4400;
  --primary-soft: #f3e6d2;
  --shadow: 0 24px 70px rgba(84, 51, 16, 0.12);
  --font: system-ui, -apple-system, BlinkMacSystemFont, "Noto Sans JP", "Hiragino Sans", "Yu Gothic", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg-soft);
  color: var(--text);
  font-family: var(--font);
  letter-spacing: 0.035em;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 68px;
  background: rgba(255, 253, 248, 0.88);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(18px);
}

.nav-shell,
.container {
  width: min(1280px, calc(100% - 48px));
  margin: 0 auto;
}

.nav-shell {
  height: 100%;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  font-size: 19px;
  letter-spacing: 0.11em;
}

.brand-mark,
.icon-box {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 800;
}

.nav-links {
  display: flex;
  gap: 34px;
  color: var(--muted);
  font-weight: 700;
  font-size: 14px;
}

.nav-links .active {
  color: var(--primary);
}

.login-button {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 10px 18px;
  color: #fff;
  background: var(--primary);
  border-radius: 7px;
  font-weight: 800;
  box-shadow: 0 12px 24px rgba(154, 90, 0, 0.18);
}

.hero-section {
  min-height: 720px;
  padding: 96px 0 72px;
  background:
    radial-gradient(circle at 70% 20%, rgba(255, 245, 222, 0.98), transparent 30%),
    radial-gradient(circle at 32% 74%, rgba(240, 219, 188, 0.42), transparent 34%),
    linear-gradient(135deg, #fbf4e9 0%, #f8ecdc 45%, #fbf7ef 100%);
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 0.92fr 1.08fr;
  gap: 80px;
  align-items: center;
}

.section-pill {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 8px;
  margin: 0 0 28px;
  padding: 10px 18px;
  border: 1px solid #dfc6a3;
  border-radius: 999px;
  color: var(--primary);
  background: rgba(243, 230, 210, 0.72);
  font-weight: 800;
  font-size: 14px;
}

.hero-copy h1 {
  margin: 0;
  font-size: clamp(52px, 5vw, 76px);
  line-height: 1.12;
  font-weight: 300;
  letter-spacing: 0.08em;
}

.hero-copy h1 span,
.hero-copy h1 strong {
  display: block;
}

.hero-copy h1 strong {
  color: var(--primary);
  font-weight: 900;
}

.hero-lead {
  max-width: 560px;
  margin: 30px 0 28px;
  color: var(--muted);
  font-size: 18px;
  line-height: 2;
  font-weight: 500;
}

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

.primary-button,
.secondary-button,
.secondary-on-dark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 24px;
  border: 1px solid transparent;
  border-radius: 7px;
  font-weight: 850;
  cursor: pointer;
}

.primary-button {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 14px 28px rgba(154, 90, 0, 0.24);
}

.primary-button:hover,
.login-button:hover {
  background: var(--primary-dark);
}

.secondary-button {
  background: #fff;
  border-color: var(--border);
  color: var(--text);
  box-shadow: 0 10px 24px rgba(52, 35, 20, 0.07);
}

.trust-list {
  display: flex;
  gap: 26px;
  flex-wrap: wrap;
  padding: 0;
  margin: 32px 0 0;
  color: #7b5b32;
  list-style: none;
  font-size: 14px;
  font-weight: 700;
}

.hero-visual {
  position: relative;
  min-height: 520px;
}

.floorplan-card {
  position: absolute;
  top: 36px;
  right: 0;
  width: min(660px, 100%);
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255, 253, 248, 0.92);
  box-shadow: var(--shadow);
}

.floorplan-title {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.floorplan-image-wrap {
  width: 100%;
  border-radius: 24px;
  overflow: hidden;
  background: #fffdf8;
  border: 1px solid var(--border);
}

.floorplan-sample-image {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}

.floorplan-canvas {
  position: relative;
  height: 390px;
  overflow: hidden;
  border: 5px solid #4d4943;
  background: #fffaf1;
}

.room {
  position: absolute;
  display: grid;
  place-items: center;
  border: 3px solid #4d4943;
  color: rgba(31, 27, 22, 0.5);
  font-weight: 900;
}

.living {
  left: 0;
  top: 0;
  width: 58%;
  height: 68%;
}

.bedroom {
  right: 0;
  top: 0;
  width: 42%;
  height: 68%;
}

.kitchen {
  left: 0;
  bottom: 0;
  width: 22%;
  height: 32%;
}

.bath {
  left: 22%;
  bottom: 0;
  width: 38%;
  height: 32%;
  background: #dff0f3;
}

.closet {
  right: 0;
  bottom: 0;
  width: 28%;
  height: 32%;
  background: #ead6bd;
}

.sofa,
.table,
.bed {
  position: absolute;
  border: 2px solid #91652e;
  background: #ead6bd;
  border-radius: 8px;
}

.sofa {
  left: 20%;
  top: 34%;
  width: 90px;
  height: 38px;
}

.table {
  left: 37%;
  top: 38%;
  width: 48px;
  height: 30px;
}

.bed {
  right: 13%;
  top: 30%;
  width: 120px;
  height: 62px;
}

.floating-card {
  position: absolute;
  z-index: 5;
  padding: 15px 18px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: rgba(255, 253, 248, 0.95);
  box-shadow: 0 22px 48px rgba(72, 47, 20, 0.16);
}

.floating-card b,
.floating-card span {
  display: block;
}

.floating-card b {
  font-size: 14px;
}

.floating-card span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.rating-card {
  top: 18px;
  right: -14px;
}

.source-card {
  left: 8%;
  bottom: 38px;
  min-width: 160px;
  text-align: center;
}

.mini-plan {
  width: 70px;
  height: 32px;
  margin: 0 auto 6px;
  border: 2px solid var(--border);
  background: linear-gradient(90deg, #fff 50%, #f3e6d2 50%);
}

.section {
  padding: 96px 0;
  background: var(--bg-soft);
}

.section:nth-of-type(even) {
  background: #f9f4ec;
}

.section-heading {
  max-width: 760px;
  margin: 0 auto 64px;
  text-align: center;
}

.section-heading h2,
.generate-copy h2,
.cta-content h2 {
  margin: 0;
  font-size: clamp(34px, 3vw, 48px);
  font-weight: 300;
  line-height: 1.3;
  letter-spacing: 0.08em;
}

.section-heading h2 strong,
.cta-content h2 strong {
  font-weight: 900;
}

.section-heading p:not(.section-pill),
.generate-copy p {
  color: var(--muted);
  line-height: 1.9;
  font-size: 16px;
}

.feature-grid,
.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.feature-card,
.step-card,
.generate-card,
.photo-card,
.output-sample-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255, 253, 248, 0.86);
  box-shadow: 0 12px 34px rgba(72, 47, 20, 0.06);
}

.feature-card {
  min-height: 250px;
  padding: 38px;
}

.feature-card h3,
.step-card h3,
.generate-card h3 {
  margin: 28px 0 14px;
  font-size: 22px;
}

.feature-card p,
.step-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.85;
}

.gallery-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 44px;
  align-items: start;
}

.gallery-label {
  margin: 0 0 18px;
  color: #675a4b;
  font-size: 15px;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.photo-card {
  min-height: 205px;
  display: grid;
  place-items: start;
  padding: 16px;
  color: var(--text);
  background:
    linear-gradient(145deg, rgba(255, 253, 248, 0.94), rgba(249, 241, 229, 0.92)),
    repeating-linear-gradient(45deg, rgba(154, 90, 0, 0.05), rgba(154, 90, 0, 0.05) 8px, transparent 8px, transparent 16px);
}

.output-sample-card {
  padding: 18px;
  min-height: 430px;
}

.sample-floorplan {
  height: 390px;
  display: grid;
  place-items: center;
  border: 4px solid #4d4943;
  background:
    linear-gradient(90deg, transparent 49%, #4d4943 49%, #4d4943 51%, transparent 51%),
    linear-gradient(0deg, transparent 65%, #4d4943 65%, #4d4943 67%, transparent 67%),
    #fffaf1;
  color: var(--muted);
  font-weight: 800;
}

.gallery-note {
  color: #7a5a32;
  font-weight: 700;
}

.generate-grid {
  display: grid;
  grid-template-columns: 0.82fr 1.18fr;
  gap: 44px;
  align-items: start;
}

.generate-card {
  padding: 28px;
}

.upload-box {
  display: grid;
  gap: 10px;
  place-items: center;
  min-height: 170px;
  padding: 26px;
  border: 1px dashed #d5b98d;
  border-radius: 14px;
  color: var(--primary);
  background: #fffaf3;
  cursor: pointer;
  text-align: center;
  font-weight: 800;
}

.upload-box input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.upload-box small {
  color: var(--muted);
  font-weight: 600;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin: 18px 0;
}

.form-row label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 700;
}

select {
  width: 100%;
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  font: inherit;
}

.full {
  width: 100%;
  border: 0;
}

.form-status {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.form-status.is-error {
  color: #a13b12;
  font-weight: 800;
}

.result-panel {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.result-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.result-header > a {
  display: none;
}

.result-header h3 {
  margin: 4px 0 0;
}

.download-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  margin-top: 12px;
  padding: 0 18px;
  border: 0;
  border-radius: 7px;
  background: var(--primary);
  color: #fff;
  font: inherit;
  font-weight: 850;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(154, 90, 0, 0.18);
}

.download-button:hover {
  background: var(--primary-dark);
}

.download-button[hidden] {
  display: none;
}

.result-comparison {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}

.result-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 20px;
  box-shadow: 0 18px 45px rgba(60, 38, 12, 0.08);
}

.result-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.result-card-header h3 {
  margin: 0;
  font-size: 18px;
}

.result-image {
  width: 100%;
  max-height: 440px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: #fff;
  object-fit: contain;
}

.result-image[hidden] {
  display: none;
}

.eyebrow {
  margin: 0;
  color: var(--primary);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.result-images {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.result-images-main {
  grid-template-columns: 1fr;
}

.result-images figure {
  margin: 0;
}

.result-images figcaption {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.result-panel img {
  width: 100%;
  max-height: 440px;
  object-fit: contain;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}

.result-panel a {
  display: inline-flex;
  margin-top: 12px;
  color: var(--primary);
  font-weight: 800;
}

.debug-details {
  margin-top: 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 250, 243, 0.72);
}

.debug-details summary {
  cursor: pointer;
  padding: 16px 18px;
  color: var(--primary-dark);
  font-weight: 900;
}

.debug-details[open] {
  padding-bottom: 18px;
}

.debug-details[open] summary {
  border-bottom: 1px solid var(--border);
}

.debug-details > .result-images,
.debug-details > .debug-grid,
.debug-details > .debug-card,
.debug-details > .debug-note {
  margin-left: 18px;
  margin-right: 18px;
}

.debug-note {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.debug-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.debug-card {
  margin-top: 16px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 250, 243, 0.82);
}

.debug-card h4 {
  margin: 0 0 14px;
  font-size: 16px;
}

.debug-card dl {
  display: grid;
  grid-template-columns: minmax(150px, 0.82fr) 1fr;
  gap: 9px 14px;
  margin: 0;
  font-size: 13px;
}

.debug-card dt {
  color: var(--muted);
  font-weight: 800;
}

.debug-card dd {
  margin: 0;
  color: var(--text);
  overflow-wrap: anywhere;
}

.furniture-summary {
  display: grid;
  gap: 10px;
}

.furniture-room {
  padding: 10px 12px;
  border: 1px solid rgba(234, 223, 206, 0.8);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.64);
}

.furniture-room b {
  display: block;
  margin-bottom: 4px;
  color: var(--primary-dark);
}

.furniture-room span {
  color: var(--muted);
  line-height: 1.65;
}

.prompt-preview {
  max-height: 260px;
  margin: 0;
  overflow: auto;
  white-space: pre-wrap;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fffdf8;
  color: #4b4036;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.7;
}

.steps-grid {
  grid-template-columns: repeat(3, minmax(240px, 1fr));
  justify-content: center;
  justify-items: center;
  max-width: 1080px;
  margin: 0 auto;
}

.step-card {
  position: relative;
  min-height: 210px;
  width: 100%;
  padding: 28px;
  text-align: center;
}

.step-number {
  display: inline-block;
  color: #cba674;
  font-size: 30px;
  font-weight: 300;
  vertical-align: middle;
}

.step-card .icon-box {
  margin-left: 10px;
  vertical-align: middle;
}

.cta-band {
  padding: 92px 0;
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: #fff;
}

.cta-content {
  text-align: center;
}

.cta-content h2 span,
.cta-content h2 strong {
  display: inline-block;
}

.cta-content p {
  margin: 28px 0;
  color: rgba(255, 255, 255, 0.86);
  font-weight: 700;
}

.secondary-on-dark {
  background: rgba(255, 255, 255, 0.96);
  color: var(--primary-dark);
}

.reveal {
  animation: rise 720ms ease both;
}

.delay-1 {
  animation-delay: 130ms;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 980px) {
  .nav-shell {
    grid-template-columns: 1fr auto;
  }

  .nav-links {
    display: none;
  }

  .hero-grid,
  .gallery-grid,
  .generate-grid {
    grid-template-columns: 1fr;
  }

  .hero-section {
    min-height: auto;
    padding-top: 68px;
  }

  .hero-visual {
    min-height: 460px;
  }

  .floorplan-card {
    position: relative;
    top: auto;
  }

  .feature-grid,
  .steps-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .nav-shell,
  .container {
    width: min(100% - 28px, 1280px);
  }

  .brand {
    font-size: 16px;
    letter-spacing: 0.06em;
  }

  .login-button {
    padding: 9px 12px;
  }

  .section {
    padding: 56px 0;
  }

  .hero-copy h1 {
    font-size: 44px;
  }

  .hero-lead {
    font-size: 16px;
  }

  .photo-grid,
  .form-row,
  .result-images,
  .result-comparison,
  .debug-grid {
    grid-template-columns: 1fr;
  }

  .floating-card {
    display: none;
  }
}
