:root {
  --paper: #f8f1e4;
  --paper-deep: #efe1cc;
  --ink: #30251e;
  --muted: #776a5f;
  --line: rgba(75, 56, 42, 0.18);
  --sage: #9eb49a;
  --rose: #c98693;
  --citrus: #e8b75b;
  --sky: #8db8b8;
  --cedar: #8f6a52;
  --shadow: 0 24px 70px rgba(80, 54, 31, 0.16);
  --space-bg: rgba(169, 154, 216, 0.28);
  --space-mist: rgba(142, 191, 186, 0.26);
  --space-light: rgba(232, 183, 91, 0.24);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at 14% 10%, rgba(226, 174, 142, 0.28), transparent 26rem),
    radial-gradient(circle at 88% 22%, rgba(152, 186, 156, 0.24), transparent 24rem),
    linear-gradient(110deg, #fbf5e9 0%, var(--paper) 48%, #f3eadb 100%);
  font-family: "Noto Serif KR", serif;
  overflow-x: hidden;
}

.intro-wash {
  position: fixed;
  inset: 0;
  z-index: 100;
  background:
    linear-gradient(#fffaf0, #f8f1e4),
    repeating-linear-gradient(0deg, rgba(82, 61, 43, 0.035) 0 1px, transparent 1px 7px);
  pointer-events: none;
  animation: introFadeOut 5s cubic-bezier(0.76, 0, 0.24, 1) forwards;
  will-change: opacity, visibility;
}

.intro-wash canvas {
  width: 100%;
  height: 100%;
  display: block;
}

button,
input {
  font: inherit;
}

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

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 80;
  opacity: 0.45;
  mix-blend-mode: multiply;
  background-image:
    linear-gradient(rgba(88, 68, 48, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(88, 68, 48, 0.035) 1px, transparent 1px);
  background-size: 5px 7px, 8px 6px;
}

.cursor-wash {
  position: fixed;
  width: 150px;
  height: 150px;
  left: 0;
  top: 0;
  z-index: 25;
  pointer-events: none;
  border-radius: 50%;
  opacity: 0;
  filter: blur(18px);
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(201, 134, 147, 0.24), rgba(232, 183, 91, 0.12) 46%, transparent 72%);
  transition: opacity 220ms ease;
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px clamp(18px, 4vw, 58px);
  background: linear-gradient(rgba(248, 241, 228, 0.86), rgba(248, 241, 228, 0.48));
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(83, 58, 37, 0.08);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: "Cormorant Garamond", serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0;
}

.brand-mark {
  width: 25px;
  height: 31px;
  color: #6f8c76;
  overflow: visible;
  flex: 0 0 auto;
  filter: drop-shadow(0 5px 9px rgba(99, 78, 58, 0.08));
}

.brand-mark path {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand-stem {
  stroke-width: 1.45;
}

.brand-leaf {
  stroke-width: 1.18;
  opacity: 0.78;
}

.brand-bloom {
  fill: rgba(169, 154, 216, 0.16);
  stroke: #8f7fb8;
  stroke-width: 1.05;
  opacity: 0.86;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: clamp(10px, 2vw, 28px);
  color: var(--muted);
  font-family: Inter, sans-serif;
  font-size: 13px;
  font-weight: 600;
}

.main-nav a {
  padding: 8px 0;
}

.sound-toggle,
.dialog-close {
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  background: rgba(255, 252, 245, 0.62);
  color: var(--ink);
  cursor: pointer;
}

.sound-toggle {
  grid-auto-flow: column;
  gap: 3px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
}

.sound-toggle span {
  width: 3px;
  border-radius: 999px;
  background: currentColor;
}

.sound-toggle span:nth-child(1) {
  height: 10px;
}

.sound-toggle span:nth-child(2) {
  height: 18px;
}

.sound-toggle span:nth-child(3) {
  height: 13px;
}

.sound-toggle[aria-pressed="true"] span {
  animation: soundBars 900ms ease-in-out infinite alternate;
}

.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  align-items: center;
  padding: 112px clamp(20px, 6vw, 92px) 82px;
  overflow: hidden;
}

.hero-art {
  position: absolute;
  inset: 5vh 0 auto auto;
  width: min(74vw, 1120px);
  height: min(78vh, 780px);
  object-fit: cover;
  object-position: center;
  opacity: 0.78;
  filter: saturate(0.96) contrast(0.98);
  mask-image: radial-gradient(circle at 56% 46%, #000 0 52%, rgba(0, 0, 0, 0.68) 66%, transparent 86%);
}

.hero-breeze {
  position: absolute;
  inset: 5vh 0 auto auto;
  width: min(74vw, 1120px);
  height: min(78vh, 780px);
  z-index: 1;
  pointer-events: none;
  opacity: 0.48;
  filter: saturate(0.98);
  mask-image: radial-gradient(circle at 56% 46%, #000 0 54%, rgba(0, 0, 0, 0.5) 70%, transparent 86%);
}

.breeze-fragment {
  position: absolute;
  inset: 0;
  display: block;
  background-image: url("assets/scent-landscape-watercolor.png");
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  mix-blend-mode: multiply;
  transform-origin: 50% 92%;
  will-change: transform;
}

.breeze-lavender {
  clip-path: ellipse(14% 32% at 31% 43%);
  transform-origin: 31% 76%;
  animation: botanicalSwayA 6.4s ease-in-out infinite alternate;
}

.breeze-herb {
  clip-path: ellipse(12% 27% at 57% 43%);
  transform-origin: 56% 74%;
  animation: botanicalSwayB 7.6s ease-in-out infinite alternate;
}

.breeze-eucalyptus {
  clip-path: ellipse(15% 31% at 84% 29%);
  transform-origin: 82% 72%;
  animation: botanicalSwayC 7s ease-in-out infinite alternate;
}

.breeze-wood {
  clip-path: ellipse(22% 18% at 77% 76%);
  transform-origin: 68% 88%;
  animation: botanicalSwayD 8.8s ease-in-out infinite alternate;
}

.hero-canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  opacity: 0.8;
}

.hero-copy {
  position: relative;
  z-index: 2;
  max-width: 640px;
  animation: riseIn 1200ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.eyebrow,
.postcard-kicker {
  margin: 0 0 12px;
  color: #936d57;
  font-family: Inter, sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Cormorant Garamond", "Noto Serif KR", serif;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(58px, 9vw, 132px);
  line-height: 0.96;
  max-width: 820px;
  word-break: keep-all;
  overflow-wrap: normal;
}

.hero-copy p:not(.eyebrow) {
  max-width: 600px;
  margin: 28px 0 0;
  color: #5f5148;
  font-size: clamp(16px, 2vw, 20px);
  line-height: 2;
  word-break: keep-all;
  overflow-wrap: normal;
}

.hero-actions,
.panel-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.primary-link,
.ghost-link,
.ink-button,
.ghost-button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(55, 41, 31, 0.2);
  padding: 12px 22px;
  font-family: Inter, "Noto Serif KR", sans-serif;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.primary-link,
.ink-button {
  color: #fffaf2;
  background:
    radial-gradient(circle at 28% 16%, rgba(255, 255, 255, 0.32), transparent 28%),
    linear-gradient(135deg, #8b5d50, #b7856f 48%, #6f8c76);
  box-shadow: 0 18px 45px rgba(94, 61, 45, 0.22);
}

.ghost-link,
.ghost-button {
  color: var(--ink);
  background: rgba(255, 252, 245, 0.54);
}

.primary-link:hover,
.ghost-link:hover,
.ink-button:hover,
.ghost-button:hover {
  transform: translateY(-2px);
}

.ink-button:disabled,
.ghost-button:disabled {
  cursor: wait;
  opacity: 0.58;
  transform: none;
}

.section-preview {
  position: absolute;
  left: clamp(20px, 6vw, 92px);
  right: clamp(20px, 6vw, 92px);
  bottom: 24px;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  color: rgba(54, 42, 32, 0.68);
  font-family: Inter, sans-serif;
  font-size: 12px;
}

.section-preview span {
  padding-top: 12px;
  border-top: 1px solid rgba(63, 46, 34, 0.22);
}

.section,
.studio-section {
  position: relative;
  padding: 104px clamp(18px, 5vw, 78px);
}

.section-heading {
  max-width: 760px;
  margin-bottom: 34px;
}

.section-heading h2 {
  font-size: clamp(38px, 5vw, 76px);
  line-height: 1.08;
}

.palette-layout,
.studio-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 430px);
  gap: clamp(24px, 4vw, 54px);
  align-items: start;
}

.studio-grid {
  grid-template-columns: minmax(210px, 260px) minmax(0, 1fr) minmax(320px, 430px);
  gap: clamp(18px, 3vw, 34px);
}

.oil-palette {
  display: grid;
  grid-template-columns: repeat(5, minmax(96px, 1fr));
  gap: clamp(12px, 2vw, 22px);
  min-height: 520px;
  align-content: start;
}

.oil-swatch {
  position: relative;
  min-height: 108px;
  border: 0;
  color: var(--ink);
  background: transparent;
  cursor: grab;
  isolation: isolate;
}

.oil-swatch:active {
  cursor: grabbing;
}

.oil-swatch::before {
  content: "";
  position: absolute;
  inset: 7px 4px 20px;
  z-index: -1;
  border-radius: 43% 57% 61% 39% / 52% 38% 62% 48%;
  background:
    radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.52), transparent 18%),
    radial-gradient(circle at 68% 62%, color-mix(in srgb, var(--oil-color), #ffffff 22%), transparent 30%),
    var(--oil-color);
  filter: saturate(0.9);
  opacity: 0.78;
  box-shadow: inset 0 0 30px rgba(255, 255, 255, 0.32), 0 16px 34px rgba(84, 55, 34, 0.1);
  transform: rotate(var(--tilt));
  transition: transform 200ms ease, opacity 200ms ease;
}

.oil-swatch:hover::before,
.oil-swatch.is-active::before {
  opacity: 0.95;
  transform: rotate(var(--tilt)) scale(1.05);
}

.oil-swatch span {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 0;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}

.oil-detail,
.blend-panel {
  position: sticky;
  top: 92px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 251, 242, 0.64);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.detail-illustration {
  height: 190px;
  margin-bottom: 22px;
  border-radius: 6px;
  background:
    linear-gradient(180deg, rgba(255, 252, 246, 0.04), rgba(248, 241, 228, 0.16)),
    radial-gradient(circle at 18% 16%, color-mix(in srgb, var(--detail-color), transparent 38%), transparent 24%),
    var(--detail-image) center / cover;
  border: 1px solid rgba(78, 58, 41, 0.1);
  position: relative;
  overflow: hidden;
}

.detail-illustration::before,
.detail-illustration::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.detail-illustration::before {
  inset: 0;
  background:
    linear-gradient(rgba(255, 252, 246, 0), rgba(255, 252, 246, 0.14)),
    repeating-linear-gradient(0deg, rgba(82, 61, 43, 0.025) 0 1px, transparent 1px 7px);
  mix-blend-mode: multiply;
}

.detail-illustration::after {
  inset: 10px;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 4px;
}

.detail-family {
  margin: 0 0 8px;
  color: #916956;
  font-family: Inter, sans-serif;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.oil-detail h3 {
  font-size: 42px;
}

.oil-detail p,
.oil-detail dd,
.recipe-postcard p,
.scent-landscape p {
  color: #62564f;
  line-height: 1.95;
  word-break: keep-all;
  overflow-wrap: normal;
}

.oil-detail dl {
  display: grid;
  gap: 14px;
  margin: 22px 0;
}

.oil-detail dt {
  color: var(--ink);
  font-weight: 700;
}

.oil-detail dd {
  margin: 5px 0 0;
}

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

.scene-card {
  position: relative;
  overflow: hidden;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid rgba(83, 58, 37, 0.13);
  border-radius: 8px;
  padding: 22px;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 252, 246, 0.18), rgba(44, 32, 24, 0.1)),
    radial-gradient(circle at 22% 20%, color-mix(in srgb, var(--scene-color), transparent 26%), transparent 36%),
    var(--scene-image) center / cover;
  box-shadow: 0 16px 40px rgba(80, 54, 31, 0.09);
  cursor: pointer;
  text-align: left;
  transition: transform 200ms ease, box-shadow 200ms ease;
}

.scene-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 252, 246, 0.38), rgba(255, 252, 246, 0.68));
  z-index: 0;
}

.scene-card > * {
  position: relative;
  z-index: 1;
}

.scene-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 56px rgba(80, 54, 31, 0.14);
}

.scene-card strong {
  font-size: 24px;
  word-break: keep-all;
}

.scene-card span {
  color: #6d6259;
  line-height: 1.85;
  max-width: 15em;
  word-break: keep-all;
  overflow-wrap: normal;
}

.studio-section {
  background:
    radial-gradient(circle at 74% 18%, rgba(141, 184, 184, 0.18), transparent 30rem),
    linear-gradient(180deg, transparent, rgba(238, 225, 206, 0.42));
}

.studio-workbench {
  min-width: 0;
}

.studio-oil-tray {
  position: sticky;
  top: 92px;
  max-height: calc(100svh - 118px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 251, 242, 0.62);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.tray-heading {
  padding: 20px 18px 12px;
  border-bottom: 1px solid rgba(83, 58, 37, 0.1);
}

.tray-heading h3 {
  font-size: 28px;
}

.studio-oil-list {
  display: grid;
  gap: 8px;
  max-height: calc(100svh - 232px);
  overflow-y: auto;
  padding: 12px;
}

.studio-oil {
  display: grid;
  grid-template-columns: 38px 1fr;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  border: 1px solid rgba(83, 58, 37, 0.12);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 50%, color-mix(in srgb, var(--oil-color), transparent 62%), transparent 42%),
    rgba(255, 252, 246, 0.5);
  cursor: grab;
  text-align: left;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.studio-oil:hover,
.studio-oil.is-selected {
  transform: translateX(2px);
  border-color: color-mix(in srgb, var(--oil-color), #5b4635 26%);
  background:
    radial-gradient(circle at 12% 50%, color-mix(in srgb, var(--oil-color), transparent 42%), transparent 48%),
    rgba(255, 252, 246, 0.72);
}

.studio-oil:active {
  cursor: grabbing;
}

.studio-oil-mark {
  width: 34px;
  height: 34px;
  border-radius: 45% 55% 58% 42% / 54% 42% 58% 46%;
  background:
    radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.58), transparent 24%),
    var(--oil-color);
  box-shadow: inset 0 0 16px rgba(255, 255, 255, 0.35);
}

.studio-oil-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.studio-oil-text strong {
  font-size: 14px;
}

.studio-oil-text small {
  color: var(--muted);
  font-family: Inter, sans-serif;
  font-size: 11px;
}

.canvas-shell {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(83, 58, 37, 0.15);
  border-radius: 8px;
  background:
    linear-gradient(rgba(255, 252, 246, 0.9), rgba(255, 252, 246, 0.84)),
    repeating-linear-gradient(0deg, rgba(82, 61, 43, 0.032) 0 1px, transparent 1px 7px);
  box-shadow: var(--shadow);
  aspect-ratio: 4 / 3;
}

#blendCanvas {
  display: block;
  width: 100%;
  height: 100%;
}

.drop-hint {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  color: rgba(74, 57, 44, 0.52);
  font-size: clamp(18px, 2.5vw, 34px);
  font-weight: 600;
  pointer-events: none;
  transition: opacity 200ms ease;
}

.drop-hint.is-hidden {
  opacity: 0;
}

.blend-slots {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.blend-chip {
  min-height: 82px;
  display: grid;
  align-content: center;
  gap: 6px;
  border: 1px solid rgba(83, 58, 37, 0.13);
  border-radius: 8px;
  padding: 10px;
  background: rgba(255, 252, 246, 0.58);
}

.blend-chip-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.blend-chip strong {
  font-size: 13px;
}

.remove-oil {
  width: 26px;
  height: 26px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(83, 58, 37, 0.16);
  border-radius: 50%;
  color: #6a5142;
  background: rgba(255, 252, 246, 0.68);
  cursor: pointer;
  line-height: 1;
}

.remove-oil:hover {
  color: #fffaf2;
  background: #8b5d50;
}

.blend-chip input {
  width: 100%;
  accent-color: var(--chip-color);
}

.blend-name-row {
  display: grid;
  gap: 8px;
}

.blend-name-row label {
  font-weight: 700;
}

.blend-name-row input {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
  color: var(--ink);
  background: transparent;
  font-family: "Cormorant Garamond", "Noto Serif KR", serif;
  font-size: 34px;
  outline: 0;
}

.timeline {
  margin: 28px 0;
}

.timeline-labels {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 8px;
  color: #786b61;
  font-size: 12px;
}

.timeline input {
  width: 100%;
  accent-color: #8f6a52;
}

.scent-landscape {
  display: grid;
  gap: 14px;
}

.landscape-image {
  position: relative;
  overflow: hidden;
  min-height: 238px;
  aspect-ratio: 12 / 7;
  border-radius: 6px;
  border: 1px solid rgba(83, 58, 37, 0.13);
  background:
    linear-gradient(rgba(255, 252, 246, 0.22), rgba(248, 241, 228, 0.08)),
    url("assets/scent-landscape-watercolor.png") center / cover;
  filter: saturate(var(--landscape-saturation, 0.92)) brightness(var(--landscape-brightness, 1));
}

.landscape-image canvas {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 238px;
}

.recipe-postcard {
  margin-top: 24px;
  padding: 24px;
  border: 1px solid rgba(90, 65, 45, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(rgba(255, 252, 245, 0.86), rgba(255, 248, 235, 0.78)),
    repeating-linear-gradient(90deg, rgba(92, 68, 48, 0.035) 0 1px, transparent 1px 9px);
  box-shadow: inset 0 0 0 8px rgba(255, 255, 255, 0.16);
}

.recipe-postcard h3 {
  font-size: 38px;
  line-height: 1.14;
  word-break: keep-all;
}

.recipe-oils {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0;
}

.mini-oil {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(84, 61, 43, 0.16);
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.42);
  font-size: 12px;
  font-weight: 700;
}

.mini-dot {
  width: 16px;
  height: 16px;
  border-radius: 50% 42% 56% 44%;
  background: var(--mini-color);
}

.recipe-meta {
  display: grid;
  gap: 8px;
  font-size: 13px;
}

.recipe-line {
  display: grid;
  grid-template-columns: 78px 1fr 42px;
  gap: 8px;
  align-items: center;
}

.recipe-bar {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(75, 56, 42, 0.1);
}

.recipe-bar span {
  display: block;
  height: 100%;
  background: var(--bar-color);
}

.history-album {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  min-height: 250px;
}

.history-empty {
  grid-column: 1 / -1;
  padding: 56px 20px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  text-align: center;
}

.history-print {
  min-height: 260px;
  padding: 12px 12px 18px;
  border: 1px solid rgba(83, 58, 37, 0.12);
  border-radius: 6px;
  background: rgba(255, 252, 246, 0.8);
  box-shadow: 0 18px 42px rgba(80, 54, 31, 0.12);
  cursor: pointer;
  transform: rotate(var(--rotate));
  text-align: left;
}

.history-photo {
  height: 178px;
  border-radius: 4px;
  background:
    radial-gradient(circle at 26% 28%, var(--h1), transparent 30%),
    radial-gradient(circle at 70% 44%, var(--h2), transparent 32%),
    url("assets/scent-landscape-watercolor.png") center / cover;
  filter: saturate(0.9);
}

.history-photo img,
.dialog-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.history-print strong {
  display: block;
  margin-top: 14px;
  font-size: 18px;
}

.history-print span {
  color: var(--muted);
  font-size: 13px;
}

.history-dialog {
  width: min(760px, calc(100vw - 32px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 34px 90px rgba(41, 28, 21, 0.3);
}

.history-dialog::backdrop {
  background: rgba(41, 30, 22, 0.42);
  backdrop-filter: blur(8px);
}

.generated-space {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: grid;
  place-items: center;
  padding: clamp(18px, 4vw, 54px);
  background:
    radial-gradient(circle at 22% 20%, var(--space-light), transparent 28rem),
    radial-gradient(circle at 78% 28%, var(--space-mist), transparent 30rem),
    radial-gradient(circle at 48% 76%, var(--space-bg), transparent 34rem),
    linear-gradient(130deg, rgba(255, 250, 240, 0.94), rgba(239, 225, 206, 0.92));
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 900ms ease, visibility 900ms ease;
  overflow: hidden;
}

.generated-space.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.space-mist {
  position: absolute;
  inset: -18%;
  background:
    radial-gradient(circle at 28% 46%, var(--space-bg), transparent 24rem),
    radial-gradient(circle at 68% 42%, var(--space-mist), transparent 28rem);
  filter: blur(26px);
  opacity: 0.78;
  animation: spaceBreath 9s ease-in-out infinite alternate;
}

.space-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.space-particles span {
  position: absolute;
  width: clamp(42px, 7vw, 96px);
  aspect-ratio: 1;
  border-radius: 44% 56% 58% 42% / 50% 42% 58% 50%;
  background: radial-gradient(circle, var(--space-light), transparent 68%);
  opacity: 0.42;
  filter: blur(8px);
  animation: floatingPetal 11s ease-in-out infinite alternate;
}

.space-particles span:nth-child(1) {
  left: 10%;
  top: 22%;
}

.space-particles span:nth-child(2) {
  left: 72%;
  top: 14%;
  animation-duration: 13s;
}

.space-particles span:nth-child(3) {
  left: 18%;
  top: 72%;
  animation-duration: 12s;
}

.space-particles span:nth-child(4) {
  left: 82%;
  top: 66%;
  animation-duration: 15s;
}

.space-particles span:nth-child(5) {
  left: 48%;
  top: 9%;
  animation-duration: 10s;
}

.space-particles span:nth-child(6) {
  left: 56%;
  top: 82%;
  animation-duration: 14s;
}

.image-loader {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  gap: 18px;
  color: #5f5148;
  font-weight: 700;
  text-align: center;
  transition: opacity 500ms ease, transform 500ms ease;
}

.image-loader span {
  width: 132px;
  aspect-ratio: 1;
  border-radius: 48% 52% 50% 50%;
  background:
    radial-gradient(circle at 45% 45%, rgba(201, 134, 147, 0.6), rgba(169, 154, 216, 0.28) 42%, transparent 72%),
    radial-gradient(circle at 60% 55%, var(--space-mist), transparent 70%);
  filter: blur(4px);
  animation: loaderBloom 1600ms ease-in-out infinite alternate;
}

.generated-space.is-ready .image-loader {
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
}

.generated-frame {
  position: relative;
  z-index: 1;
  width: min(1100px, 100%);
  margin: 0;
  opacity: 0;
  transform: translateY(18px) scale(0.985);
  transition: opacity 1000ms ease 220ms, transform 1000ms ease 220ms;
}

.generated-space.is-ready .generated-frame {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.generated-frame img {
  display: block;
  width: 100%;
  max-height: min(68vh, 720px);
  object-fit: cover;
  border: 1px solid rgba(83, 58, 37, 0.13);
  border-radius: 8px;
  box-shadow: 0 34px 90px rgba(63, 43, 30, 0.24);
  filter: saturate(0.94) contrast(0.98);
}

.generated-frame figcaption {
  max-width: 780px;
  margin-top: 18px;
  color: #5f5148;
}

.generated-frame h2 {
  color: var(--ink);
  font-size: clamp(42px, 6vw, 84px);
  line-height: 1.02;
}

.stage-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(83, 58, 37, 0.18);
  border-radius: 50%;
  color: var(--ink);
  background: rgba(255, 252, 246, 0.7);
  backdrop-filter: blur(12px);
  cursor: pointer;
  font-size: 24px;
}

.dialog-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 22px;
}

.dialog-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  padding: 34px;
}

.dialog-image {
  min-height: 360px;
  border-radius: 6px;
  overflow: hidden;
  background:
    radial-gradient(circle at 24% 24%, var(--h1), transparent 34%),
    radial-gradient(circle at 68% 42%, var(--h2), transparent 32%),
    url("assets/scent-landscape-watercolor.png") center / cover;
}

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

@keyframes introFadeOut {
  0% {
    opacity: 1;
  }
  72% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    visibility: hidden;
  }
}

@keyframes botanicalSwayA {
  from {
    transform: translate3d(-2px, 1px, 0) rotate(-0.7deg) scale(1.003);
  }
  to {
    transform: translate3d(5px, -2px, 0) rotate(1.2deg) scale(1.012);
  }
}

@keyframes botanicalSwayB {
  from {
    transform: translate3d(1px, -1px, 0) rotate(0.45deg) scale(1);
  }
  to {
    transform: translate3d(-4px, 2px, 0) rotate(-0.9deg) scale(1.01);
  }
}

@keyframes botanicalSwayC {
  from {
    transform: translate3d(-1px, 2px, 0) rotate(-0.35deg) scale(1.002);
  }
  to {
    transform: translate3d(4px, -2px, 0) rotate(0.8deg) scale(1.009);
  }
}

@keyframes botanicalSwayD {
  from {
    transform: translate3d(0, 1px, 0) rotate(0.18deg);
  }
  to {
    transform: translate3d(-3px, -1px, 0) rotate(-0.45deg);
  }
}

@keyframes spaceBreath {
  from {
    transform: translate3d(-1.2%, 0, 0) scale(1);
  }
  to {
    transform: translate3d(1.4%, -1%, 0) scale(1.04);
  }
}

@keyframes floatingPetal {
  from {
    transform: translate3d(-10px, 8px, 0) rotate(-4deg);
  }
  to {
    transform: translate3d(18px, -16px, 0) rotate(6deg);
  }
}

@keyframes loaderBloom {
  from {
    transform: scale(0.72) rotate(-4deg);
    opacity: 0.5;
  }
  to {
    transform: scale(1.28) rotate(5deg);
    opacity: 0.9;
  }
}

@media (prefers-reduced-motion: reduce) {
  .breeze-fragment,
  .space-mist,
  .space-particles span,
  .image-loader span {
    animation: none;
  }
}

@keyframes soundBars {
  to {
    transform: scaleY(0.55);
    opacity: 0.55;
  }
}

@media (max-width: 1080px) {
  .palette-layout,
  .studio-grid {
    grid-template-columns: 1fr;
  }

  .oil-detail,
  .blend-panel,
  .studio-oil-tray {
    position: relative;
    top: auto;
  }

  .studio-oil-tray,
  .studio-oil-list {
    max-height: none;
  }

  .studio-oil-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .scene-grid,
  .history-album {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .oil-palette {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .site-header {
    display: none;
  }

  .brand,
  .sound-toggle {
    display: none;
  }

  .hero {
    min-height: 92svh;
    padding: 76px 18px 92px;
  }

  .hero-art {
    inset: 12vh -42vw auto auto;
    width: 132vw;
    height: 58vh;
  }

  .hero-breeze {
    inset: 12vh -42vw auto auto;
    width: 132vw;
    height: 58vh;
    opacity: 0.38;
  }

  h1 {
    max-width: calc(100vw - 36px);
    font-size: clamp(44px, 13.5vw, 58px);
    line-height: 1.12;
    word-break: keep-all;
    overflow-wrap: normal;
  }

  .hero-copy p:not(.eyebrow) {
    max-width: calc(100vw - 36px);
    font-size: 15px;
    line-height: 1.92;
  }

  .scene-card span,
  .oil-detail p,
  .recipe-postcard p,
  .scent-landscape p {
    max-width: 100%;
    overflow-wrap: break-word;
  }

  .section,
  .studio-section {
    padding: 78px 16px;
  }

  .oil-palette {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .scene-grid,
  .history-album,
  .blend-slots,
  .studio-oil-list,
  .dialog-body {
    grid-template-columns: 1fr;
  }

  .scene-card {
    min-height: 170px;
  }

  .blend-panel,
  .oil-detail {
    padding: 20px;
  }

  .recipe-line {
    grid-template-columns: 68px 1fr 36px;
  }

  .landscape-image,
  .landscape-image canvas {
    min-height: 210px;
  }

  .generated-space {
    padding: 16px;
  }

  .generated-frame img {
    max-height: 56vh;
  }

  .generated-frame h2 {
    font-size: clamp(36px, 11vw, 52px);
  }

  .section-preview {
    display: none;
  }
}
