@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600&family=DM+Serif+Display:ital@0;1&display=swap");

:root {
  --ink: #352f2c;
  --muted: #7d716a;
  --cream: #f8f3ee;
  --paper: #fffdf9;
  --rose: #b65f68;
  --rose-dark: #8d424c;
  --blush: #ead1d0;
  --sage: #879c8a;
  --line: rgba(53, 47, 44, .14);
  --shadow: 0 24px 80px rgba(90, 65, 55, .12);
  --serif: "DM Serif Display", Georgia, serif;
  --sans: "DM Sans", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--cream); font-family: var(--sans); min-height: 100vh; }
body::before { content: ""; position: fixed; inset: 0; pointer-events: none; opacity: .25; background-image: radial-gradient(#b58c7b 0.45px, transparent .45px); background-size: 8px 8px; }
a { color: inherit; }
button, input { font: inherit; }
button, .button { min-height: 46px; }
:focus-visible { outline: 3px solid rgba(182,95,104,.4); outline-offset: 3px; }
.skip-link { position: fixed; top: -60px; left: 1rem; z-index: 10; background: var(--ink); color: white; padding: .7rem 1rem; }
.skip-link:focus { top: 1rem; }
.eyebrow { color: var(--rose-dark); font-size: .72rem; font-weight: 600; letter-spacing: .17em; text-transform: uppercase; }
h1, h2 { font-family: var(--serif); font-weight: 400; line-height: 1.04; margin: .3em 0; }
h1 { font-size: clamp(2.8rem, 8vw, 5.8rem); letter-spacing: -.025em; }
h2 { font-size: clamp(1.55rem, 3vw, 2.45rem); }
.button { border: 0; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; gap: .45rem; padding: .8rem 1.4rem; font-weight: 600; text-decoration: none; cursor: pointer; transition: transform .2s, opacity .2s, box-shadow .2s; }
.button:hover:not(:disabled) { transform: translateY(-2px); }
.button:disabled { cursor: not-allowed; opacity: .42; }
.primary { color: white; background: var(--rose); box-shadow: 0 8px 24px rgba(182,95,104,.2); }
.primary:hover:not(:disabled) { background: var(--rose-dark); }
.secondary { color: var(--ink); background: transparent; border: 1px solid var(--line); }
.text-button { background: none; border: 0; color: var(--muted); text-decoration: none; cursor: pointer; padding: .6rem; }

.login-page { background: radial-gradient(circle at 50% 40%, #fffaf7 0, var(--cream) 50%, #ecdcd7 110%); }
.login-shell { width: min(600px, calc(100% - 2rem)); min-height: 100vh; margin: auto; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 3rem 0; position: relative; }
.monogram { font-family: var(--serif); width: 92px; height: 92px; border: 1px solid var(--blush); border-radius: 50%; display: grid; place-items: center; font-size: 1.5rem; margin-bottom: 2rem; }
.monogram span, .brand span { color: var(--rose); font-size: .75em; }
.lede { color: var(--muted); line-height: 1.7; max-width: 450px; }
.login-form { width: min(440px, 100%); margin-top: 2rem; text-align: left; }
.login-form label { display: block; font-size: .8rem; font-weight: 600; margin: 0 0 .6rem .3rem; }
.input-row { border: 1px solid var(--line); background: var(--paper); border-radius: 999px; padding: .35rem; display: flex; box-shadow: var(--shadow); }
.input-row input { width: 100%; border: 0; background: transparent; padding: .7rem 1rem; outline: none; min-width: 0; }
.password-toggle { flex: 0 0 auto; border: 0; background: transparent; color: var(--rose-dark); cursor: pointer; padding: .65rem .8rem; font-size: .78rem; font-weight: 600; white-space: nowrap; }
.form-error { color: #973d45; min-height: 1.4em; font-size: .85rem; }
.login-form .form-error { text-align: center; }

.site-header { width: min(1200px, calc(100% - 2rem)); margin: auto; padding: 1.2rem 0; display: flex; justify-content: space-between; align-items: center; position: relative; z-index: 2; }
.brand { font: 1.25rem var(--serif); text-decoration: none; letter-spacing: .12em; }
.studio, .detail { width: min(1120px, calc(100% - 2rem)); margin: 0 auto; padding: 5vh 0 8rem; position: relative; }
.header-actions { display: flex; align-items: center; gap: .35rem; }
.intro { text-align: center; max-width: 760px; margin: 0 auto 3rem; }
.intro p:last-child { color: var(--muted); line-height: 1.7; }
.selector-card, .locked-card { background: rgba(255,253,249,.88); border: 1px solid rgba(255,255,255,.9); box-shadow: var(--shadow); border-radius: 34px; padding: clamp(1rem, 4vw, 3rem); }
.roll-window { border: 1px solid var(--line); border-radius: 22px; overflow: hidden; background: #fdfaf6; min-height: 320px; display: grid; place-items: center; position: relative; }
.roll-window::before, .roll-window::after { content: ""; position: absolute; left: 0; right: 0; height: 38px; z-index: 1; pointer-events: none; }
.roll-window::before { top: 0; background: linear-gradient(#fdfaf6, transparent); }
.roll-window::after { bottom: 0; background: linear-gradient(transparent, #fdfaf6); }
#roll-track { width: 100%; }
.idea-grid { display: grid; grid-template-columns: repeat(2, 1fr); }
.idea-grid > div { min-height: 150px; padding: 2rem; display: flex; flex-direction: column; justify-content: center; border-bottom: 1px solid var(--line); }
.idea-grid > div:nth-child(odd) { border-right: 1px solid var(--line); }
.idea-grid > div:nth-child(n+3) { border-bottom: 0; }
.idea-grid span, .plan-card > span { text-transform: uppercase; letter-spacing: .16em; color: var(--rose-dark); font-size: .65rem; margin-bottom: .7rem; }
.idea-grid strong { font: 400 clamp(1.25rem, 3vw, 2rem)/1.18 var(--serif); }
.empty-reel { text-align: center; color: var(--muted); }
.empty-reel span, .spark { color: var(--rose); font-size: 2rem; }
.attempts { display: flex; align-items: center; justify-content: center; gap: 1rem; color: var(--muted); font-size: .78rem; margin: 1.5rem 0; }
.attempt-dots { display: flex; gap: .35rem; }
.attempt-dots i { width: 7px; height: 7px; background: var(--blush); border-radius: 50%; }
.attempt-dots i.used { background: var(--rose); }
.actions { display: flex; justify-content: center; gap: .7rem; flex-wrap: wrap; }
.rolling-lines { display: grid; gap: 1rem; width: 70%; margin: auto; }
.rolling-lines i { height: 25px; border-radius: 99px; background: linear-gradient(90deg, #f0e4df 20%, #dbb8b7 50%, #f0e4df 80%); background-size: 200%; animation: shimmer .7s infinite linear; }
.rolling-lines i:nth-child(2n) { width: 76%; }
@keyframes shimmer { to { background-position: -200% 0; } }
.empty-state { text-align: center; padding-block: 5rem; }
.empty-state p { color: var(--muted); margin-bottom: 1.8rem; }

.archive { width: min(960px, calc(100% - 2rem)); margin: 0 auto; padding: 5vh 0 8rem; position: relative; }
.archive-intro { text-align: center; max-width: 680px; margin: 0 auto 3rem; }
.archive-intro p:last-child { color: var(--muted); line-height: 1.7; }
.archive-list { display: grid; gap: 1rem; }
.archive-card { display: grid; grid-template-columns: 1fr auto; gap: 1.5rem; align-items: center; padding: clamp(1.4rem, 3vw, 2.2rem); background: var(--paper); border: 1px solid var(--line); border-radius: 24px; text-decoration: none; box-shadow: 0 12px 40px rgba(90, 65, 55, .07); transition: transform .2s, box-shadow .2s; }
.archive-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.archive-card h2 { margin: .2rem 0 .65rem; }
.archive-slug { display: block; color: var(--muted); font-size: .75rem; overflow-wrap: anywhere; }
.archive-meta { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.1rem; }
.archive-meta span { border: 1px solid var(--line); border-radius: 999px; padding: .4rem .7rem; color: var(--muted); font-size: .75rem; }
.archive-meta .complete { color: #526b56; background: #edf2ea; border-color: #d5e0d1; }
.archive-arrow { color: var(--rose); font-size: 1.5rem; }

.date-hero { text-align: center; max-width: 920px; margin: 3vh auto 5rem; }
.date-hero h1 { font-size: clamp(3rem, 8vw, 7rem); }
.date-hero > p:last-child { color: var(--muted); font: italic 1.15rem var(--serif); }
.ornament { color: var(--rose); margin: 1.5rem; letter-spacing: .5em; }
.plan-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.plan-card { background: var(--paper); border: 1px solid var(--line); border-radius: 24px; padding: clamp(1.4rem, 3vw, 2.5rem); min-height: 290px; }
.plan-card h2 { margin-top: 1.2rem; }
.plan-card p { color: var(--muted); line-height: 1.65; margin-top: 2rem; }
.useful, .done-card { margin-top: 1rem; border-radius: 24px; padding: clamp(1.5rem, 4vw, 3rem); display: flex; align-items: center; justify-content: space-between; gap: 2rem; }
.useful { background: #e4e9df; }
.useful p { color: #59645a; line-height: 1.6; }
.ratings { padding: 6rem 0 3rem; text-align: center; }
.rating-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; margin-top: 2rem; }
.rating-card { border: 1px solid var(--line); background: var(--paper); border-radius: 24px; padding: 1.7rem; }
.rating-card legend { font: 1.7rem var(--serif); padding: 0 1rem; }
.stars { display: flex; justify-content: center; gap: .25rem; }
.stars button { border: 0; background: transparent; color: #d8cdc7; cursor: pointer; font-size: 1.8rem; min-width: 44px; min-height: 44px; }
.stars button.selected { color: var(--rose); }
.rating-copy { color: var(--muted); font-size: .8rem; }
.done-card { background: var(--ink); color: white; }
.done-card .eyebrow { color: #e8b8bd; }
.done-card .primary[aria-pressed="true"] { background: var(--sage); }
.toast { position: fixed; left: 50%; bottom: 1.5rem; transform: translate(-50%, 150%); background: var(--ink); color: white; border-radius: 999px; padding: .8rem 1.2rem; opacity: 0; transition: .3s; z-index: 5; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }

@media (max-width: 720px) {
  .studio, .detail, .archive { padding-top: 2vh; }
  .site-header { align-items: flex-start; }
  .header-actions { align-items: flex-end; flex-direction: column; gap: 0; }
  .password-toggle { padding-inline: .45rem; font-size: .72rem; }
  .idea-grid, .plan-grid, .rating-grid { grid-template-columns: 1fr; }
  .idea-grid > div { min-height: 115px; border-right: 0 !important; border-bottom: 1px solid var(--line) !important; padding: 1.4rem; }
  .idea-grid > div:last-child { border-bottom: 0 !important; }
  .roll-window { min-height: 480px; }
  .plan-card { min-height: auto; }
  .useful, .done-card { align-items: flex-start; flex-direction: column; }
  .useful .button, .done-card .button { width: 100%; }
  .date-hero { margin-bottom: 3rem; }
  .archive-card { grid-template-columns: 1fr auto; gap: .75rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
