:root {
  color-scheme: light;
  --paper: #f7f5ec;
  --paper-deep: #edeadd;
  --ink: #263a2d;
  --ink-soft: #667264;
  --gold: #dbaa32;
  --green: #36533e;
  --serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --sans: 'DM Sans', 'Avenir Next', Avenir, sans-serif;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { min-width: 320px; background: var(--paper); }

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.home-page::after {
  position: fixed;
  z-index: 50;
  inset: 0;
  background: #20372e;
  content: '';
  pointer-events: none;
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform .62s cubic-bezier(.72, 0, .28, 1);
}

.home-page.is-leaving::after { transform: scaleY(1); }

a { color: inherit; }

.landing {
  position: relative;
  display: flex;
  min-height: 100svh;
  flex-direction: column;
  overflow: hidden;
  padding: 0 clamp(24px, 6.2vw, 100px);
  background:
    radial-gradient(ellipse at 79% 51%, rgba(229, 231, 208, .55), transparent 38%),
    var(--paper);
}

.topbar {
  position: relative;
  z-index: 2;
  display: flex;
  height: 104px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-start;
  border-bottom: 1px solid rgba(51, 70, 54, .13);
  animation: home-reveal .8s .05s ease both;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -.055em;
  white-space: nowrap;
  text-decoration: none;
}

.wordmark__flower {
  width: 29px;
  height: 29px;
  flex: 0 0 auto;
  color: #e0ad2e;
  filter: drop-shadow(0 2px 2px rgba(123, 83, 24, .12));
  overflow: visible;
  transition: transform .35s cubic-bezier(.2,.8,.25,1);
}
.wordmark:hover .wordmark__flower { transform: rotate(12deg) scale(1.05); }
.wordmark__petals { stroke: #c89320; stroke-width: .55; }
.wordmark__light { color: #78806f; font-weight: 500; }

.personalize-trigger {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  gap: 7px;
  padding: 0 15px;
  border: 1px solid rgba(54, 83, 62, .24);
  border-radius: 999px;
  color: var(--green);
  background: rgba(255,255,255,.3);
  cursor: pointer;
  font: 600 11px var(--sans);
  transition: transform .2s ease, background-color .2s ease, border-color .2s ease;
}
.personalize-trigger span { color: #c5952c; font-size: 14px; }
.personalize-trigger:hover { transform: translateY(-1px); border-color: rgba(54, 83, 62, .5); background: rgba(255,255,255,.7); }

.hero {
  display: grid;
  width: 100%;
  max-width: 1440px;
  flex: 1 0 auto;
  grid-template-columns: .98fr 1.02fr;
  align-items: center;
  gap: clamp(26px, 5vw, 84px);
  margin: 0 auto;
  padding: 28px 0 35px;
}

.hero__copy { position: relative; z-index: 1; padding: 0 0 6px 2px; }
.hero__copy > * { animation: home-reveal .75s cubic-bezier(.2,.75,.25,1) both; }
.hero__copy > :nth-child(1) { animation-delay: .18s; }
.hero__copy > :nth-child(2) { animation-delay: .28s; }
.hero__copy > :nth-child(3) { animation-delay: .4s; }
.hero__copy > :nth-child(4) { animation-delay: .5s; }
.hero__copy > :nth-child(5) { animation-delay: .62s; }

.hero h1 {
  max-width: 700px;
  margin: 0;
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(55px, 5.1vw, 76px);
  font-weight: 500;
  letter-spacing: -.071em;
  line-height: .99;
}

.hero h1 em { color: #c5952c; font-weight: 500; }

.hero__description {
  max-width: 420px;
  margin: 25px 0 31px;
  color: #70786c;
  font-size: 16px;
  line-height: 1.85;
}

.button {
  display: inline-flex;
  min-height: 58px;
  align-items: center;
  justify-content: center;
  gap: 28px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: transform .25s ease, background-color .25s ease, box-shadow .25s ease;
}

.button--primary {
  padding: 0 10px 0 25px;
  color: #fffdf6;
  background: var(--green);
  box-shadow: 0 10px 24px rgba(43, 67, 48, .12);
}

.button--primary:hover { transform: translateY(-2px); background: #294633; box-shadow: 0 14px 28px rgba(43, 67, 48, .18); }
.button:focus-visible, .wordmark:focus-visible { outline: 3px solid #d9a928; outline-offset: 4px; }

.button__arrow {
  display: grid;
  width: 39px;
  height: 39px;
  place-items: center;
  border-radius: 50%;
  color: #2e4a37;
  background: #f1d478;
  font-size: 18px;
  transition: transform .25s ease;
}

.button--primary:hover .button__arrow { transform: rotate(45deg); }

.hero__art { position: relative; display: flex; min-width: 0; flex-direction: column; align-items: center; justify-content: center; perspective: 1100px; animation: art-enter 1.05s .22s cubic-bezier(.2,.75,.25,1) both; }

.bouquet-customize { margin-top: 16px; padding: 0 18px; background: rgba(255,255,255,.56); box-shadow: 0 8px 24px rgba(45,61,42,.08); }

.art-card {
  position: relative;
  width: min(100%, 548px);
  padding: 17px 19px 13px;
  border: 1px solid rgba(96, 100, 77, .12);
  border-radius: 7px;
  background: #eeeddf;
  box-shadow: 0 28px 70px rgba(45, 61, 42, .13), 0 3px 9px rgba(45, 61, 42, .08);
  transform: rotate(var(--tilt, 0deg)) rotateY(var(--turn-y, 0deg)) rotateX(var(--turn-x, 0deg));
  transform-style: preserve-3d;
  transition: transform .35s ease, box-shadow .35s ease;
  will-change: transform;
}

.art-card__topline, .art-card__caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #858774;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.art-card__topline { height: 24px; padding: 0 5px; }
.bouquet { display: block; width: 100%; height: auto; overflow: visible; }
.bouquet > g[transform^="translate"] { transform-box: fill-box; transform-origin: center; animation: bouquet-float 4.8s ease-in-out infinite alternate; }
.bouquet > g[transform^="translate"]:nth-of-type(2n) { animation-duration: 5.6s; animation-delay: -.9s; }
.bouquet-decoration { transition: opacity .25s ease; }
.bouquet-decoration.is-off { display: none; }
.art-card__caption { height: 30px; padding: 0 5px; color: #59694e; font-family: var(--serif); font-size: 12px; font-style: italic; font-weight: 500; letter-spacing: .04em; text-transform: none; }
.caption__heart { color: #c89230; font-family: var(--sans); font-size: 12px; }

.art-card__spark { position: absolute; z-index: 1; color: #d9aa39; pointer-events: none; }
.art-card__spark--one { top: 30%; left: 7%; font-size: 19px; animation: twinkle 3.5s ease-in-out infinite; }
.art-card__spark--two { top: 51%; right: 5%; font-size: 16px; animation: twinkle 4s ease-in-out .7s infinite; }

.art-note {
  position: absolute;
  right: -33px;
  bottom: 49px;
  color: #737967;
  font-family: var(--serif);
  font-size: 13px;
  font-style: italic;
  line-height: 1.45;
  transform: rotate(-7deg);
}

.art-note span { color: #c19634; font-family: var(--sans); font-style: normal; }

.personalizer {
  width: min(92vw, 540px);
  max-height: 92svh;
  padding: 0;
  border: 0;
  border-radius: 18px;
  color: var(--ink);
  background: transparent;
  overflow: auto;
}
.personalizer::backdrop { background: rgba(24, 43, 33, .68); backdrop-filter: blur(7px); }
.personalizer[open] { animation: dialog-enter .3s cubic-bezier(.2,.75,.25,1) both; }
.personalizer__panel { position: relative; display: grid; gap: 17px; padding: clamp(26px, 5vw, 42px); border: 1px solid rgba(90,100,76,.2); border-radius: 18px; background: #f7f5ec; box-shadow: 0 28px 90px rgba(16,34,24,.28); }
.personalizer__close { position: absolute; top: 15px; right: 17px; width: 34px; height: 34px; border: 0; border-radius: 50%; color: #667264; background: #ebe9dc; cursor: pointer; font-size: 23px; line-height: 1; }
.personalizer__eyebrow { margin: 0; color: #aa8027; font-size: 9px; font-weight: 700; letter-spacing: .2em; }
.personalizer h2 { max-width: 410px; margin: 0; font: 500 clamp(31px, 6vw, 43px)/1.05 var(--serif); letter-spacing: -.045em; }
.personalizer__intro { margin: -5px 0 3px; color: #70786c; font-size: 13px; line-height: 1.55; }
.personalizer label { display: grid; gap: 7px; color: #4e5d50; font-size: 11px; font-weight: 700; letter-spacing: .04em; }
.personalizer input, .personalizer textarea { width: 100%; border: 1px solid #d5d5c5; border-radius: 10px; outline: 0; color: #2d4233; background: #fffdf6; font: 14px/1.5 var(--sans); transition: border-color .2s, box-shadow .2s; }
.personalizer input { height: 46px; padding: 0 13px; }
.personalizer textarea { min-height: 98px; padding: 11px 13px; resize: vertical; }
.personalizer input:focus, .personalizer textarea:focus { border-color: #b68c30; box-shadow: 0 0 0 3px rgba(202,159,55,.14); }
.palette-picker, .flower-picker { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; border: 0; }
.palette-picker legend, .flower-picker legend { width: 100%; margin-bottom: 2px; color: #4e5d50; font-size: 11px; font-weight: 700; letter-spacing: .04em; }
.palette-picker label, .flower-picker label { position: relative; display: inline-flex; min-height: 38px; flex: 1; min-width: 102px; align-items: center; justify-content: center; gap: 7px; padding: 0 10px; border: 1px solid #d5d5c5; border-radius: 10px; background: #fffdf6; cursor: pointer; font-size: 11px; letter-spacing: 0; }
.palette-picker input, .flower-picker input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.palette-picker label:has(input:checked), .flower-picker label:has(input:checked) { border-color: #a77d28; box-shadow: 0 0 0 2px rgba(202,159,55,.13); }
.flower-picker label > span { color: #bd8d29; font-family: Georgia, serif; font-size: 17px; }
.palette-dot { width: 15px; height: 15px; border: 1px solid rgba(80,70,40,.16); border-radius: 50%; box-shadow: inset 0 0 0 3px rgba(255,255,255,.25); }
.palette-dot--gold { background: #edc646; }
.palette-dot--cream { background: #f8e8a5; }
.palette-dot--peach { background: #eda46c; }
.personalizer__actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 2px; }
.personalizer__reset, .personalizer__save { min-height: 45px; border-radius: 999px; cursor: pointer; font: 600 12px var(--sans); }
.personalizer__reset { padding: 0 4px; border: 0; color: #7b7f72; background: transparent; text-decoration: underline; text-underline-offset: 4px; }
.personalizer__save { display: inline-flex; align-items: center; gap: 16px; padding: 0 20px; border: 0; color: #fffdf6; background: var(--green); }
.personalizer__save span { color: #f1d478; font-size: 17px; }
.personalizer button:focus-visible, .personalizer input:focus-visible, .personalizer textarea:focus-visible, .personalize-trigger:focus-visible { outline: 3px solid #d9a928; outline-offset: 3px; }

@keyframes twinkle { 0%,100% { opacity: .45; transform: scale(.84) rotate(0); } 50% { opacity: 1; transform: scale(1.12) rotate(14deg); } }
@keyframes home-reveal { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes art-enter { from { opacity: 0; transform: translateY(30px) rotate(1.5deg) scale(.97); } to { opacity: 1; transform: translateY(0) rotate(0) scale(1); } }
@keyframes bouquet-float { from { translate: 0 1px; } to { translate: 0 -5px; } }
@keyframes dialog-enter { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }

@media (min-width: 1500px) {
  .hero { gap: 90px; }
  .art-card { width: 580px; }
}

@media (max-width: 900px) {
  .landing { padding-right: clamp(26px, 5vw, 48px); padding-left: clamp(26px, 5vw, 48px); }
  .topbar { height: 82px; }
  .hero { grid-template-columns: 1fr 1fr; gap: 22px; }
  .hero h1 { font-size: clamp(53px, 7.2vw, 68px); }
  .hero__description { max-width: 350px; font-size: 15px; }
  .art-card { padding: 13px 14px 10px; }
  .art-note { right: -9px; bottom: 34px; font-size: 11px; }
}

@media (max-width: 640px) {
  .landing { min-height: 100svh; padding-right: 22px; padding-left: 22px; }
  .topbar { height: 70px; }
  .wordmark { gap: 7px; font-size: 17px; }
  .wordmark__flower { width: 26px; height: 26px; }
  .bouquet-customize { min-height: 38px; margin-top: 12px; padding: 0 14px; font-size: 10px; }
  .hero { grid-template-columns: 1fr; gap: 8px; padding: 30px 0 25px; }
  .hero__copy { padding: 0; }
  .hero h1 { font-size: clamp(49px, 11vw, 68px); letter-spacing: -.073em; line-height: .98; }
  .hero__description { max-width: 390px; margin: 15px 0 19px; font-size: 15px; line-height: 1.65; }
  .button { min-height: 53px; font-size: 12px; }
  .button__arrow { width: 35px; height: 35px; }
  .hero__art { width: min(82%, 360px); justify-self: center; margin: 8px 12px 0 0; }
  .art-card { padding: 9px 10px 7px; }
  .art-card__topline { height: 18px; font-size: 7px; }
  .art-card__caption { height: 23px; font-size: 10px; }
  .art-note { right: -37px; bottom: 72px; font-size: 10px; }
  .art-card__spark--one { left: -5%; font-size: 15px; }
  .art-card__spark--two { right: -5%; font-size: 13px; }
  .personalizer { width: calc(100vw - 28px); }
  .personalizer__panel { gap: 14px; padding: 28px 20px 22px; }
  .palette-picker label, .flower-picker label { min-width: 86px; padding: 0 7px; font-size: 10px; }
  .personalizer__actions { align-items: stretch; flex-direction: column-reverse; }
  .personalizer__save { justify-content: center; }
}

@media (max-width: 380px) {
  .landing { padding-right: 18px; padding-left: 18px; }
  .wordmark { gap: 5px; font-size: 15px; }
  .wordmark__flower { width: 24px; height: 24px; }
  .hero h1 { font-size: 47px; }
  .hero__art { width: 78%; }
  .art-note { right: -39px; }
}

@media (max-height: 740px) and (min-width: 641px) {
  .topbar { height: 76px; }
  .hero { padding-top: 20px; padding-bottom: 20px; }
  .hero h1 { font-size: clamp(52px, 5.8vw, 76px); }
  .art-card { width: min(100%, 460px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .home-page::after { display: none; }
}

/* Full-size bouquet workspace */
.studio-open { overflow: hidden; }
.bouquet-studio { width: min(1180px, calc(100vw - 32px)); max-width: none; height: min(900px, calc(100svh - 32px)); max-height: none; padding: 0; border: 1px solid #dadbcc; border-radius: 20px; color: var(--ink); background: #f7f5ec; overflow: auto; }
.bouquet-studio::backdrop { background: rgba(20,36,27,.8); }
.studio-header { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 22px 28px; border-bottom: 1px solid #dedfd1; }
.studio-header h2 { margin: 8px 0 0; font: 500 clamp(23px,3vw,34px)/1.1 var(--serif); letter-spacing: -.04em; }
.studio-close { flex-shrink: 0; border: 1px solid #d2d6c6; background: transparent; color: var(--ink); border-radius: 50%; width: 44px; height: 44px; font-size: 26px; cursor: pointer; }
.studio-body { display: grid; grid-template-columns: minmax(0,1fr) 320px; min-height: 0; }
.studio-canvas { display: flex; justify-content: center; align-items: center; padding: 22px; background: #e3e6da; }
.studio-canvas .art-card { width: min(100%, 490px); transform: none !important; transition: none; will-change: auto; padding: 14px; }
.studio-canvas .bouquet > g, .studio-canvas .art-card__spark { animation: none !important; }
.studio-controls { padding: 24px; display: flex; flex-direction: column; gap: 18px; }
.studio-hint { color: #6c7869; font-size: 12px; line-height: 1.6; margin: 0; }
.studio-controls h3 { font: 500 27px var(--serif); margin: 0; }
.paper-settings, .decoration-settings { display: grid; gap: 14px; padding-top: 17px; border-top: 1px solid #dedfd1; }
.paper-settings h3, .decoration-settings h3 { font: 500 22px var(--serif); }
.decoration-settings .studio-hint { margin-top: -8px; }
.decoration-options { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
.decoration-options label { position: relative; display: grid; min-width: 0; min-height: 72px; place-items: center; align-content: center; gap: 7px; padding: 8px 4px; border: 1px solid #d5d5c5; border-radius: 10px; color: #4e5d50; background: #fffdf6; cursor: pointer; font-size: 10px; font-weight: 600; text-align: center; transition: border-color .18s ease, background-color .18s ease, transform .18s ease; }
.decoration-options label:hover { transform: translateY(-1px); }
.decoration-options label:has(input:checked) { border-color: #8b762e; background: #f4f0da; box-shadow: 0 0 0 2px rgba(202,159,55,.13); }
.decoration-options input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.decoration-options span { color: #607b59; font: 700 19px/1 Georgia, serif; letter-spacing: -5px; transform: translateX(-2px); }
.decoration-options label:nth-child(2) span { font-size: 27px; letter-spacing: 0; transform: none; }
.decoration-options label:nth-child(3) span { color: #c29b35; font-size: 23px; letter-spacing: 0; transform: none; }
.paper-patterns { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin: 0; padding: 0; border: 0; }
.paper-patterns legend { grid-column: 1 / -1; margin-bottom: 3px; color: #4e5d50; font-size: 11px; font-weight: 700; }
.paper-patterns label { position: relative; display: grid; justify-items: center; gap: 6px; padding: 7px 3px; border: 1px solid #d5d5c5; border-radius: 9px; background: #fffdf6; cursor: pointer; font-size: 10px; }
.paper-patterns label:has(input:checked) { border-color: #a77d28; box-shadow: 0 0 0 2px rgba(202,159,55,.13); }
.paper-patterns input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.paper-sample { width: 34px; height: 27px; border: 1px solid #ded8ca; border-radius: 4px; background-color: #f0e4cf; }
.paper-sample--dots { background-image: radial-gradient(#536d48 1px, transparent 1px); background-size: 8px 8px; }
.paper-sample--botanical { background-image: linear-gradient(135deg, transparent 44%, #536d4866 45% 48%, transparent 49%), linear-gradient(35deg, transparent 43%, #536d484d 44% 47%, transparent 48%); background-size: 15px 15px; }
.paper-sample--plain { background: #f0e4cf; }
.flower-tabs { display: grid; grid-template-columns: repeat(6,1fr); gap: 5px; }
.flower-tabs button { min-height: 40px; border: 1px solid #ced2c0; border-radius: 50%; cursor: pointer; color: #294332; background: var(--flower-color); font: 600 13px var(--sans); }
.flower-tabs button[aria-pressed="true"] { outline: 2px solid #36533e; outline-offset: 2px; }
.flower-selection { display: none; stroke: #36533e; stroke-width: 2; stroke-dasharray: 5 5; pointer-events: none; }
.studio-canvas .bouquet-flower { cursor: pointer; }
.studio-canvas .bouquet-flower.is-selected .flower-selection { display: block; }
.studio-controls .flower-picker label { min-width: 0; min-height: 44px; }
.studio-colors { padding: 0; margin: 0; border: 0; }
.studio-colors legend { font-size: 11px; font-weight: 700; color: #4e5d50; margin-bottom: 12px; }
#flower-colors, #paper-colors { display: flex; flex-wrap: wrap; gap: 10px; }
#flower-colors button, #paper-colors button { width: 34px; height: 34px; border: 3px solid #f7f5ec; border-radius: 50%; background: var(--swatch); box-shadow: 0 0 0 1px #d3d6c8; cursor: pointer; transition: transform .18s ease, box-shadow .18s ease; }
#flower-colors button:hover, #paper-colors button:hover { transform: translateY(-1px); }
#flower-colors button[aria-pressed="true"], #paper-colors button[aria-pressed="true"] { box-shadow: 0 0 0 2px #36533e; }
.custom-color { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: #4e5d50; }
.custom-color input { width: 52px; height: 36px; padding: 2px; border: 1px solid #d2d6c6; border-radius: 6px; background: transparent; cursor: pointer; }
.studio-primary, .studio-secondary { min-height: 44px; padding: 10px 15px; border-radius: 999px; font: 600 12px var(--sans); cursor: pointer; }
.studio-primary { color: #fffdf6; border: 1px solid #36533e; background: #36533e; }
.studio-secondary { color: #36533e; border: 1px solid #ccd2bf; background: transparent; }
.studio-export { display: grid; gap: 10px; padding-top: 18px; border-top: 1px solid #dedfd1; }
#studio-status { font-size: 12px; line-height: 1.5; margin: 0; color: #6c7869; }
.bouquet-studio button:focus-visible, .bouquet-studio input:focus-visible, .studio-canvas .bouquet-flower:focus-visible { outline: 3px solid #b78726; outline-offset: 4px; }
.bouquet-studio button:disabled { opacity: .5; cursor: wait; }
.picture-view { padding: 20px; text-align: center; }
.picture-view[hidden] { display: none; }
.picture-view img { display: block; max-width: 100%; max-height: calc(100svh - 150px); width: auto; height: auto; margin: auto; box-shadow: 0 10px 30px #243d2520; }
.picture-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; padding-top: 16px; }
.show-picture .studio-header, .show-picture .studio-body { display: none; }
@media (max-width: 700px) {
  .bouquet-studio { width: 100%; height: 100svh; border-radius: 0; max-height: 100svh; margin: 0; }
  .studio-header { padding: 16px; }
  .studio-body { grid-template-columns: 1fr; }
  .studio-canvas { padding: 16px; }
  .studio-canvas .art-card { width: min(100%, 310px); }
  .studio-controls { padding: 20px; gap: 15px; }
  .flower-tabs { max-width: 340px; }
  .picture-view { padding: 12px; }
}
