:root {
  --ink: #20231f;
  --ink-soft: #5f625b;
  --ink-faint: #8c8b82;
  --paper: #f2eee5;
  --paper-deep: #e8e1d4;
  --wall: #d9d2c4;
  --wall-deep: #cbc2b2;
  --cream: #faf7f0;
  --forest: #263a31;
  --forest-light: #3e5b49;
  --rust: #a64c33;
  --rust-dark: #843726;
  --gold: #b48a52;
  --line: rgba(36, 38, 32, 0.16);
  --shadow: 0 18px 45px rgba(52, 43, 31, 0.20), 0 4px 12px rgba(52, 43, 31, 0.15);
  --serif: "STSong", "Songti SC", "SimSun", Georgia, serif;
  --sans: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--forest);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--sans);
  background: var(--wall);
  -webkit-font-smoothing: antialiased;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -3;
  content: "";
  background:
    radial-gradient(circle at 17% 15%, rgba(255, 255, 255, 0.65), transparent 26%),
    radial-gradient(circle at 82% 35%, rgba(104, 92, 70, 0.12), transparent 30%),
    linear-gradient(115deg, transparent 0 46%, rgba(91, 80, 62, 0.035) 46.2% 46.5%, transparent 46.7%),
    var(--wall);
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  opacity: 0.22;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.88' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.16'/%3E%3C/svg%3E");
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

button,
label[for] {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--rust);
  outline-offset: 3px;
}

.hidden {
  display: none !important;
}

.eyebrow {
  margin: 0;
  color: inherit;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.19em;
  line-height: 1.5;
  text-transform: uppercase;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: inherit;
  text-decoration: none;
}

.brand-seal {
  display: grid;
  width: 39px;
  height: 43px;
  place-items: center;
  color: #f8f2e8;
  background: var(--rust);
  border-radius: 2px 2px 8px 2px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.17);
  font-family: var(--serif);
  font-size: 23px;
  line-height: 1;
  transform: rotate(-2deg);
}

.brand strong {
  display: block;
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.15em;
  line-height: 1.2;
}

.brand small {
  display: block;
  margin-top: 3px;
  font-family: Georgia, serif;
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.22em;
}

.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  align-content: center;
  justify-items: center;
  color: #ded7c8;
  background: #26352d;
  transition: opacity 0.4s ease, visibility 0.4s;
}

.loading-screen.done {
  visibility: hidden;
  opacity: 0;
}

.loading-screen p {
  margin: 16px 0 0;
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: 0.2em;
}

.loading-mark {
  display: flex;
  align-items: flex-end;
  gap: 5px;
  height: 30px;
}

.loading-mark span {
  display: block;
  width: 7px;
  height: 22px;
  background: #d9c7a7;
  animation: loading-pulse 0.9s ease-in-out infinite alternate;
}

.loading-mark span:nth-child(2) {
  height: 30px;
  animation-delay: 0.18s;
}

.loading-mark span:nth-child(3) {
  height: 17px;
  animation-delay: 0.34s;
}

@keyframes loading-pulse {
  to { transform: translateY(-8px); opacity: 0.5; }
}

/* Authentication */
.auth-view {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(0, 1.12fr) minmax(400px, 0.88fr);
  background: #e3ddd1;
}

.auth-story {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  padding: 46px clamp(40px, 6vw, 92px) 36px;
  color: #eae4d8;
  background:
    linear-gradient(180deg, rgba(15, 28, 21, 0.13), rgba(15, 28, 21, 0.55)),
    radial-gradient(circle at 60% 24%, rgba(144, 163, 132, 0.28), transparent 33%),
    #26352d;
}

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

.auth-story::before {
  inset: 0;
  opacity: 0.18;
  background-image:
    linear-gradient(90deg, transparent 49.85%, rgba(247, 237, 214, 0.2) 50%, transparent 50.15%),
    linear-gradient(0deg, transparent 49.85%, rgba(247, 237, 214, 0.1) 50%, transparent 50.15%);
  background-size: 180px 180px;
}

.auth-story::after {
  right: -12vw;
  bottom: -35vh;
  width: 55vw;
  height: 80vh;
  border: 1px solid rgba(227, 211, 178, 0.14);
  border-radius: 50%;
}

.brand-large {
  position: relative;
  z-index: 2;
}

.brand-large .brand-seal {
  width: 45px;
  height: 50px;
  font-size: 27px;
}

.brand-large strong {
  font-size: 24px;
}

.story-copy {
  position: relative;
  z-index: 2;
  max-width: 740px;
  margin-top: clamp(75px, 15vh, 160px);
}

.story-copy .eyebrow {
  color: #b7b9a7;
}

.story-copy h1 {
  margin: 22px 0 26px;
  font-family: var(--serif);
  font-size: clamp(50px, 6vw, 88px);
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 1.08;
}

.story-copy h1 em {
  color: #d7b98b;
  font-weight: 400;
  font-style: normal;
}

.story-intro {
  max-width: 460px;
  margin: 0;
  color: #bdbdb0;
  font-family: var(--serif);
  font-size: 15px;
  letter-spacing: 0.04em;
  line-height: 1.9;
}

.story-footnote {
  position: absolute;
  z-index: 2;
  bottom: 34px;
  left: clamp(40px, 6vw, 92px);
  margin: 0;
  color: #818f83;
  font-size: 10px;
  letter-spacing: 0.13em;
}

.mini-gallery {
  position: absolute;
  right: 5.5vw;
  bottom: 8vh;
  z-index: 2;
  width: min(37vw, 480px);
  height: 330px;
  opacity: 0.88;
}

.mini-frame {
  position: absolute;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.42);
}

.mini-frame::after {
  position: absolute;
  inset: 7px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  content: "";
}

.mini-photo {
  width: 100%;
  height: 100%;
}

.mini-oak {
  right: 3%;
  bottom: 10%;
  width: 47%;
  height: 71%;
  padding: 11px;
  background: #8d693f;
  transform: rotate(4.5deg);
}

.mini-noir {
  left: 10%;
  bottom: 0;
  width: 39%;
  height: 54%;
  padding: 8px;
  background: #1b1a18;
  transform: rotate(-6deg);
}

.mini-brass {
  right: 31%;
  top: 3%;
  width: 31%;
  height: 44%;
  padding: 6px;
  background: #a9854a;
  transform: rotate(1.7deg);
}

.sunset {
  background:
    radial-gradient(circle at 67% 24%, #f3c795 0 5%, transparent 5.5%),
    linear-gradient(165deg, transparent 55%, #6b3c2b 55.5%),
    linear-gradient(180deg, #c58769 0%, #d6a073 46%, #654a3d 100%);
}

.street {
  background:
    linear-gradient(90deg, transparent 14%, rgba(236, 219, 176, 0.8) 14.5% 17%, transparent 17.5%),
    linear-gradient(165deg, transparent 62%, #8d8b79 62.5%),
    linear-gradient(180deg, #515f59, #b7a987 56%, #514d44);
}

.leaves {
  background:
    radial-gradient(ellipse at 30% 45%, #293a2b 0 10%, transparent 11%),
    radial-gradient(ellipse at 65% 65%, #394b33 0 17%, transparent 18%),
    radial-gradient(ellipse at 82% 30%, #75815e 0 12%, transparent 13%),
    linear-gradient(145deg, #a3a082, #5a654d);
}

.mini-nail {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #aa936c;
  box-shadow: 0 1px 2px #111;
}

.nail-one { right: 41%; bottom: 80%; }
.nail-two { left: 21%; bottom: 55%; }
.nail-three { right: 15%; top: 48%; }

.auth-panel {
  position: relative;
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px clamp(26px, 5vw, 78px);
  background:
    linear-gradient(90deg, rgba(82, 65, 41, 0.045) 1px, transparent 1px),
    var(--paper);
  background-size: 34px 100%;
}

.auth-card {
  width: min(100%, 385px);
}

.mobile-brand {
  display: none;
}

.auth-card h2 {
  margin: 10px 0 8px;
  font-family: var(--serif);
  font-size: clamp(35px, 4vw, 45px);
  font-weight: 500;
  letter-spacing: 0.03em;
  line-height: 1.15;
}

.auth-subtitle {
  margin: 0 0 30px;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.7;
}

.field {
  display: block;
  margin-top: 19px;
}

.field > span {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 8px;
  color: #4f514a;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.field > span small {
  color: var(--ink-faint);
  font-size: 10px;
  font-weight: 400;
}

.field input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  color: var(--ink);
  border: 1px solid rgba(47, 48, 42, 0.22);
  border-radius: 2px;
  outline: none;
  background: rgba(255, 255, 255, 0.44);
  font-size: 14px;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.field input::placeholder {
  color: #a4a196;
}

.field input:focus {
  border-color: var(--forest-light);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 0 0 3px rgba(62, 91, 73, 0.08);
}

.field > small {
  display: block;
  margin-top: 7px;
  color: var(--ink-faint);
  font-size: 10px;
  line-height: 1.5;
}

.field .age-hint.valid {
  color: var(--forest-light);
}

.field .age-hint.invalid {
  color: var(--rust);
}

.primary-button,
.secondary-button,
.danger-button {
  display: inline-flex;
  min-height: 49px;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 0 20px;
  border: 0;
  border-radius: 2px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.05em;
  transition: transform 0.2s, background 0.2s, opacity 0.2s;
}

.primary-button {
  width: 100%;
  margin-top: 26px;
  color: #f8f2e7;
  background: var(--forest);
  box-shadow: 0 8px 20px rgba(38, 58, 49, 0.17);
}

.primary-button:hover:not(:disabled) {
  background: #172b21;
  transform: translateY(-1px);
}

.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.47;
}

.primary-button.compact {
  width: auto;
  min-height: 43px;
  margin-top: 0;
  padding: 0 18px;
}

.button-arrow {
  font-size: 18px;
  line-height: 1;
}

.secondary-button {
  color: var(--ink);
  border: 1px solid rgba(40, 43, 37, 0.24);
  background: transparent;
}

.secondary-button:hover {
  background: rgba(38, 58, 49, 0.06);
}

.danger-button {
  color: #fff7f0;
  background: var(--rust);
}

.danger-button:hover:not(:disabled) {
  background: var(--rust-dark);
}

.danger-button:disabled {
  cursor: not-allowed;
  opacity: 0.46;
}

.auth-links {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 20px;
}

.text-button {
  padding: 0;
  color: var(--ink-soft);
  border: 0;
  cursor: pointer;
  background: transparent;
  font-size: 11px;
  text-align: left;
  text-decoration: underline;
  text-decoration-color: rgba(95, 98, 91, 0.35);
  text-underline-offset: 3px;
}

.text-button:hover {
  color: var(--rust);
}

.form-message {
  display: none;
  margin-bottom: 20px;
  padding: 11px 13px;
  color: var(--rust-dark);
  border-left: 3px solid var(--rust);
  background: rgba(166, 76, 51, 0.075);
  font-size: 12px;
  line-height: 1.6;
}

.form-message.visible {
  display: block;
}

.form-message.success {
  color: var(--forest);
  border-color: var(--forest-light);
  background: rgba(62, 91, 73, 0.08);
}

.auth-legal {
  position: absolute;
  bottom: 27px;
  max-width: 360px;
  margin: 0;
  color: #929086;
  font-family: var(--serif);
  font-size: 10px;
  letter-spacing: 0.05em;
  text-align: center;
}

/* Wall header */
.wall-view {
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% 0, rgba(255, 255, 255, 0.52), transparent 40%),
    var(--wall);
}

.site-header {
  position: relative;
  z-index: 10;
  display: grid;
  height: 78px;
  padding: 0 clamp(22px, 4vw, 58px);
  align-items: center;
  grid-template-columns: 1fr auto 1fr;
  border-bottom: 1px solid rgba(45, 46, 40, 0.12);
  background: rgba(226, 220, 208, 0.88);
  backdrop-filter: blur(12px);
}

.header-center {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #66675f;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.11em;
}

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #727f5e;
  box-shadow: 0 0 0 4px rgba(113, 126, 91, 0.13);
  animation: live-pulse 2.6s ease-in-out infinite;
}

@keyframes live-pulse {
  50% { box-shadow: 0 0 0 7px rgba(113, 126, 91, 0.04); }
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
}

.hang-button {
  display: inline-flex;
  height: 38px;
  align-items: center;
  gap: 9px;
  padding: 0 16px;
  color: #f5f0e5;
  border: 0;
  border-radius: 2px;
  cursor: pointer;
  background: var(--forest);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  transition: background 0.2s, transform 0.2s;
}

.hang-button:hover {
  background: #172b21;
  transform: translateY(-1px);
}

.hang-button .plus {
  font-family: Georgia, serif;
  font-size: 19px;
  font-weight: 400;
}

.profile-menu {
  position: relative;
}

.profile-button {
  display: flex;
  height: 42px;
  align-items: center;
  gap: 8px;
  padding: 3px 5px 3px 3px;
  border: 0;
  border-radius: 24px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.37);
}

.profile-initial {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: #f3eee3;
  border-radius: 50%;
  background: var(--rust);
  font-family: var(--serif);
  font-size: 15px;
}

.profile-name {
  max-width: 80px;
  overflow: hidden;
  font-size: 11px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chevron {
  margin: -3px 5px 0 0;
  color: #7c7b73;
  font-size: 13px;
}

.profile-dropdown {
  position: absolute;
  top: calc(100% + 9px);
  right: 0;
  width: 220px;
  padding: 13px;
  border: 1px solid rgba(46, 47, 42, 0.12);
  border-radius: 3px;
  background: var(--cream);
  box-shadow: 0 15px 35px rgba(44, 38, 29, 0.16);
}

.profile-dropdown p {
  margin: 2px 3px 12px;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.6;
}

.profile-dropdown button {
  width: 100%;
  padding: 9px 10px;
  color: var(--rust);
  border: 0;
  border-top: 1px solid var(--line);
  cursor: pointer;
  background: transparent;
  font-size: 11px;
  text-align: left;
}

.profile-dropdown #guide-button {
  color: var(--forest);
  border-top: 0;
}

.wall-intro {
  max-width: 1480px;
  margin: 0 auto;
  padding: clamp(45px, 7vw, 94px) clamp(26px, 7vw, 104px) 42px;
}

.intro-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding-bottom: 15px;
  color: #65655d;
  border-bottom: 1px solid rgba(45, 46, 40, 0.18);
}

.intro-note {
  margin: 0;
  color: #77766e;
  font-family: var(--serif);
  font-size: 11px;
  font-style: italic;
  letter-spacing: 0.04em;
}

.intro-heading {
  display: grid;
  align-items: end;
  gap: clamp(30px, 6vw, 100px);
  grid-template-columns: minmax(0, 1.45fr) minmax(260px, 0.55fr);
  padding-top: 31px;
}

.intro-heading h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(42px, 5.7vw, 80px);
  font-weight: 400;
  letter-spacing: 0.015em;
  line-height: 1.06;
}

.intro-heading h1 em {
  color: var(--rust);
  font-style: normal;
}

.intro-heading > p {
  max-width: 390px;
  margin: 0 0 5px;
  color: #64655e;
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: 0.03em;
  line-height: 1.9;
}

.wall-stats {
  display: flex;
  max-width: 640px;
  align-items: center;
  gap: 0;
  margin-top: 39px;
}

.wall-stats > div {
  display: flex;
  min-width: 115px;
  align-items: baseline;
  gap: 7px;
  padding: 0 22px;
  border-right: 1px solid rgba(48, 49, 43, 0.16);
}

.wall-stats > div:first-child {
  padding-left: 0;
}

.wall-stats strong {
  font-family: Georgia, var(--serif);
  font-size: 22px;
  font-weight: 400;
}

.wall-stats span {
  color: #77766d;
  font-size: 9px;
  letter-spacing: 0.05em;
}

.stats-action {
  padding: 8px 0 8px 22px;
  color: var(--rust);
  border: 0;
  cursor: pointer;
  background: transparent;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.stats-action span {
  display: inline-block;
  margin-left: 3px;
  color: var(--rust);
  font-size: 14px;
  transition: transform 0.2s;
}

.stats-action:hover span {
  transform: translate(2px, -2px);
}

/* Gallery */
.wall-section {
  position: relative;
  max-width: 1540px;
  min-height: 520px;
  margin: 0 auto;
  padding: 6px clamp(24px, 5vw, 78px) 100px;
}

.wall-section::before {
  position: absolute;
  top: -18px;
  right: 6vw;
  left: 6vw;
  height: 1px;
  content: "";
  background: linear-gradient(90deg, transparent, rgba(49, 49, 43, 0.14) 14%, rgba(49, 49, 43, 0.14) 86%, transparent);
}

.photo-wall {
  column-count: 4;
  column-gap: clamp(20px, 2.4vw, 38px);
}

.photo-card {
  position: relative;
  display: inline-block;
  width: 100%;
  margin: 0 0 clamp(45px, 5vw, 73px);
  vertical-align: top;
  break-inside: avoid;
  transform: rotate(var(--tilt, 0deg));
  animation: photo-arrive 0.65s both cubic-bezier(0.22, 0.8, 0.24, 1);
}

@keyframes photo-arrive {
  from { opacity: 0; transform: translateY(24px) rotate(var(--tilt, 0deg)); }
}

.photo-card.leaving {
  animation: photo-leave 0.42s both ease-in;
}

@keyframes photo-leave {
  to { opacity: 0; transform: translateY(16px) rotate(3deg) scale(0.97); }
}

.hanging-line {
  position: absolute;
  top: -28px;
  right: 4%;
  left: 4%;
  z-index: -1;
  height: 64px;
  pointer-events: none;
}

.wall-nail {
  position: absolute;
  top: 0;
  left: calc(50% - 3px);
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #d0ba93, #5f5140 72%);
  box-shadow: 0 2px 3px rgba(35, 29, 23, 0.45);
}

.wire {
  position: absolute;
  top: 4px;
  width: 51%;
  height: 28px;
  border-top: 1px solid rgba(76, 65, 52, 0.62);
}

.wire-left {
  right: 50%;
  transform: rotate(9deg);
  transform-origin: right top;
}

.wire-right {
  left: 50%;
  transform: rotate(-9deg);
  transform-origin: left top;
}

.framed-photo {
  position: relative;
  width: 100%;
  padding: clamp(10px, 1.2vw, 16px);
  color: inherit;
  border: 0;
  font: inherit;
  background: #8a663e;
  box-shadow:
    0 20px 40px rgba(59, 48, 35, 0.24),
    0 5px 12px rgba(59, 48, 35, 0.18),
    inset 0 0 0 1px rgba(255, 255, 255, 0.18);
  transition: transform 0.35s cubic-bezier(0.22, 0.8, 0.24, 1), box-shadow 0.35s;
  cursor: zoom-in;
}

.matting {
  position: relative;
  width: 100%;
  min-height: 120px;
  padding: clamp(7px, 0.9vw, 12px);
  overflow: hidden;
  background: #e9e2d4;
  box-shadow:
    inset 0 0 0 1px rgba(70, 52, 33, 0.2),
    0 0 11px rgba(54, 39, 24, 0.18);
}

.matting img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 610px;
  object-fit: cover;
  background: #c6c0b5;
  box-shadow: 0 1px 5px rgba(26, 21, 18, 0.22);
}

.frame-glint {
  position: absolute;
  inset: 4px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  pointer-events: none;
}

.photo-card:hover .framed-photo {
  transform: translateY(-4px);
  box-shadow:
    0 26px 48px rgba(59, 48, 35, 0.28),
    0 7px 15px rgba(59, 48, 35, 0.20),
    inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.zoom-cue {
  position: absolute;
  right: 18px;
  bottom: 18px;
  z-index: 2;
  padding: 6px 9px;
  color: #faf6ec;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 2px;
  opacity: 0.72;
  background: rgba(24, 30, 26, 0.77);
  font-size: 9px;
  letter-spacing: 0.08em;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 0.2s, transform 0.2s;
}

.framed-photo:hover .zoom-cue,
.framed-photo:focus-visible .zoom-cue {
  opacity: 1;
  transform: translateY(0);
}

/* Frame themes */
.frame-oak .framed-photo,
.preview-frame.frame-oak {
  background:
    repeating-linear-gradient(88deg, transparent 0 15px, rgba(49, 28, 11, 0.09) 16px, transparent 17px),
    linear-gradient(135deg, #a27a4d, #77522d 44%, #90693f 68%, #6e4928);
}

.frame-noir .framed-photo,
.preview-frame.frame-noir {
  background:
    repeating-linear-gradient(175deg, transparent 0 17px, rgba(255, 255, 255, 0.025) 18px, transparent 19px),
    linear-gradient(130deg, #242422, #0e0e0d 54%, #1c1b19);
}

.frame-noir .matting,
.preview-frame.frame-noir .matting {
  background: #d7d2c8;
}

.frame-porcelain .framed-photo,
.preview-frame.frame-porcelain {
  background: linear-gradient(135deg, #f4f0e6, #ddd5c6 58%, #f2eee5);
  box-shadow:
    0 20px 40px rgba(59, 48, 35, 0.18),
    0 5px 12px rgba(59, 48, 35, 0.13),
    inset 0 0 0 1px rgba(112, 102, 82, 0.22);
}

.frame-porcelain .matting,
.preview-frame.frame-porcelain .matting {
  padding: clamp(14px, 1.6vw, 22px);
  background: #fbf8f1;
}

.frame-brass .framed-photo,
.preview-frame.frame-brass {
  background:
    repeating-linear-gradient(115deg, transparent 0 12px, rgba(255, 237, 187, 0.12) 13px, transparent 15px),
    linear-gradient(130deg, #c4a260, #8c6a36 47%, #b28e50 78%, #795a2e);
}

.frame-brass .frame-glint,
.preview-frame.frame-brass .frame-glint {
  border-color: rgba(255, 240, 189, 0.35);
}

.frame-linen .framed-photo,
.preview-frame.frame-linen {
  background:
    repeating-linear-gradient(0deg, transparent 0 3px, rgba(255, 255, 255, 0.07) 4px, transparent 5px),
    repeating-linear-gradient(90deg, transparent 0 3px, rgba(42, 40, 32, 0.035) 4px, transparent 5px),
    #8d8b80;
}

.frame-linen .matting,
.preview-frame.frame-linen .matting {
  background: #d8d1c3;
}

.photo-info {
  padding: 16px 5px 0;
}

.photo-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 13px;
}

.caption {
  margin: 0;
  overflow-wrap: anywhere;
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.025em;
  line-height: 1.45;
}

.caption.empty-caption {
  color: #808078;
  font-size: 12px;
  font-style: italic;
  font-weight: 400;
}

.byline {
  flex: 0 0 auto;
  margin: 0;
  color: #78776e;
  font-size: 9px;
  letter-spacing: 0.04em;
}

.photo-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
}

.vote-group {
  display: flex;
  align-items: center;
  gap: 2px;
}

.vote-button {
  display: inline-flex;
  min-width: 48px;
  height: 34px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0 8px;
  color: #6a6a61;
  border: 1px solid rgba(45, 45, 40, 0.15);
  cursor: pointer;
  background: rgba(250, 247, 240, 0.28);
  font-size: 10px;
  transition: background 0.18s, color 0.18s, transform 0.18s;
}

.vote-button:first-child {
  border-radius: 18px 0 0 18px;
}

.vote-button:last-child {
  border-left: 0;
  border-radius: 0 18px 18px 0;
}

.vote-button:hover {
  color: var(--rust);
  background: rgba(250, 247, 240, 0.67);
}

.vote-button:active {
  transform: scale(0.92);
}

.vote-icon {
  font-size: 12px;
  line-height: 1;
}

.dislike-button {
  color: #7e7c71;
}

.dislike-button .vote-icon {
  display: inline-block;
  transform: rotate(180deg);
}

.vote-count.pulse {
  animation: count-pulse 0.35s ease;
}

@keyframes count-pulse {
  40% { transform: scale(1.4); color: var(--rust); }
}

.download-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.action-button {
  height: 34px;
  padding: 0 8px;
  color: #62625a;
  border: 0;
  cursor: pointer;
  background: transparent;
  font-size: 9px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.action-button:hover {
  color: var(--rust);
}

.imprint-action {
  color: var(--forest);
  font-weight: 600;
}

.imprint-action span {
  font-size: 14px;
}

.unmount-action {
  padding-left: 8px;
  border-left: 1px solid rgba(45, 45, 40, 0.15);
}

.unmount-action.ready::after {
  display: inline-block;
  width: 4px;
  height: 4px;
  margin: -1px 0 0 4px;
  border-radius: 50%;
  content: "";
  background: #70835f;
  vertical-align: middle;
}

.empty-wall {
  display: grid;
  justify-items: center;
  padding: 52px 20px 100px;
  text-align: center;
}

.empty-frames {
  position: relative;
  width: 220px;
  height: 135px;
  margin-bottom: 35px;
}

.empty-frame {
  position: absolute;
  display: block;
  border: 9px solid;
  box-shadow: 0 13px 25px rgba(54, 46, 35, 0.17);
}

.empty-a {
  top: 26px;
  left: 38px;
  width: 96px;
  height: 94px;
  border-color: #8a663e;
  background: #d1c7b6;
  transform: rotate(-7deg);
}

.empty-b {
  top: 2px;
  left: 94px;
  width: 82px;
  height: 106px;
  border-color: #22221f;
  background: #b4ac9f;
  transform: rotate(4deg);
}

.empty-c {
  top: 43px;
  left: 122px;
  width: 77px;
  height: 66px;
  border-color: #b6a15d;
  background: #d9c9af;
  transform: rotate(9deg);
}

.empty-wall .eyebrow {
  color: #79796f;
}

.empty-wall h2 {
  margin: 9px 0 12px;
  font-family: var(--serif);
  font-size: clamp(28px, 4vw, 43px);
  font-weight: 400;
}

.empty-wall > p:not(.eyebrow) {
  max-width: 390px;
  margin: 0 0 22px;
  color: #77766e;
  font-family: var(--serif);
  font-size: 12px;
  line-height: 1.8;
}

.site-footer {
  display: grid;
  max-width: 1400px;
  margin: 0 auto;
  padding: 35px clamp(26px, 7vw, 100px) 42px;
  align-items: center;
  gap: 22px;
  grid-template-columns: 1fr auto auto;
  color: #6b6b62;
  border-top: 1px solid rgba(47, 48, 42, 0.15);
  font-size: 9px;
  letter-spacing: 0.04em;
}

.footer-brand {
  color: #41433d;
}

.footer-brand .brand-seal {
  width: 31px;
  height: 35px;
  font-size: 18px;
}

.footer-brand strong {
  font-size: 15px;
}

.footer-brand small {
  letter-spacing: 0.1em;
}

.site-footer p {
  margin: 0;
}

.footer-year {
  font-family: Georgia, serif;
  letter-spacing: 0.12em;
}

/* Modals */
dialog.modal {
  width: min(950px, calc(100vw - 34px));
  max-height: calc(100vh - 38px);
  padding: 0;
  color: var(--ink);
  border: 0;
  border-radius: 3px;
  background: var(--cream);
  box-shadow: 0 32px 90px rgba(30, 26, 21, 0.4);
}

dialog.modal::backdrop {
  background: rgba(22, 29, 24, 0.69);
  backdrop-filter: blur(5px);
}

dialog.modal[open] {
  animation: modal-in 0.28s both ease-out;
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(14px) scale(0.99); }
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 27px 31px 22px;
  border-bottom: 1px solid var(--line);
}

.modal-head .eyebrow {
  color: var(--rust);
}

.modal-head h2 {
  margin: 6px 0 0;
  font-family: var(--serif);
  font-size: clamp(25px, 3vw, 35px);
  font-weight: 500;
  letter-spacing: 0.025em;
}

.icon-button {
  display: grid;
  width: 33px;
  height: 33px;
  flex: 0 0 auto;
  place-items: center;
  padding: 0;
  color: #77756c;
  border: 1px solid rgba(47, 48, 42, 0.14);
  border-radius: 50%;
  cursor: pointer;
  background: transparent;
  font-family: Georgia, serif;
  font-size: 22px;
  line-height: 1;
}

.icon-button:hover {
  color: var(--rust);
  border-color: rgba(166, 76, 51, 0.35);
}

.upload-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.92fr) minmax(300px, 1.08fr);
}

.upload-preview-column {
  display: flex;
  min-height: 460px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background:
    radial-gradient(ellipse at center, rgba(255, 255, 255, 0.2), transparent 65%),
    #d6cfc2;
  border-right: 1px solid rgba(46, 47, 41, 0.12);
}

.file-drop {
  display: flex;
  width: 100%;
  min-height: 360px;
  align-items: center;
  justify-content: center;
  color: #5a5a52;
  border: 1px dashed rgba(68, 68, 58, 0.34);
  cursor: pointer;
  background: rgba(255, 255, 255, 0.17);
  transition: border-color 0.2s, background 0.2s;
}

.file-drop:hover,
.file-drop.dragging {
  border-color: var(--rust);
  background: rgba(255, 250, 241, 0.35);
}

.file-placeholder {
  display: grid;
  justify-items: center;
  padding: 25px;
  text-align: center;
}

.upload-icon {
  display: grid;
  width: 43px;
  height: 43px;
  margin-bottom: 14px;
  place-items: center;
  color: #f2ecdf;
  border-radius: 50%;
  background: var(--forest);
  font-family: Georgia, serif;
  font-size: 25px;
}

.file-placeholder strong {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 500;
}

.file-placeholder small {
  margin-top: 7px;
  color: #79776e;
  font-size: 10px;
}

.file-placeholder em {
  margin-top: 23px;
  color: #929086;
  font-size: 9px;
  font-style: normal;
  letter-spacing: 0.05em;
}

.preview-wrap {
  display: flex;
  width: 100%;
  padding: 17px;
  align-items: center;
  flex-direction: column;
}

.preview-frame {
  max-height: 300px;
  padding: 13px;
  box-shadow: 0 17px 32px rgba(44, 37, 28, 0.25);
  transition: background 0.2s;
}

.preview-frame .matting {
  padding: 8px;
}

.preview-frame img {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 235px;
}

.change-file {
  margin-top: 17px;
  color: #67665d;
  font-size: 10px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.file-name {
  max-width: 100%;
  margin: 10px 0 0;
  overflow: hidden;
  color: #75736a;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-options {
  padding: 27px 31px;
}

.upload-options > .field {
  margin-top: 0;
}

.frame-picker {
  margin: 25px 0 0;
  padding: 0;
  border: 0;
}

.frame-picker legend {
  margin-bottom: 10px;
  color: #4f514a;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.frame-options {
  display: grid;
  gap: 7px;
  grid-template-columns: 1fr 1fr;
}

.frame-option {
  position: relative;
  display: flex;
  min-height: 57px;
  align-items: center;
  gap: 11px;
  padding: 8px 10px;
  border: 1px solid rgba(46, 47, 41, 0.15);
  cursor: pointer;
  background: rgba(255, 255, 255, 0.18);
  transition: border-color 0.18s, background 0.18s;
}

.frame-option:last-child {
  grid-column: 1 / -1;
}

.frame-option:hover {
  border-color: rgba(46, 47, 41, 0.35);
}

.frame-option.selected {
  border-color: var(--forest-light);
  background: rgba(71, 96, 77, 0.055);
  box-shadow: inset 0 0 0 1px var(--forest-light);
}

.frame-option input {
  position: absolute;
  opacity: 0;
}

.frame-option > span:last-child {
  min-width: 0;
}

.frame-option strong {
  display: block;
  font-size: 10px;
  font-weight: 600;
}

.frame-option small {
  display: block;
  margin-top: 2px;
  color: #858279;
  font-size: 8px;
}

.frame-swatch {
  display: block;
  width: 30px;
  height: 35px;
  flex: 0 0 auto;
  padding: 4px;
  box-shadow: 0 3px 8px rgba(38, 31, 24, 0.25);
}

.frame-swatch::after {
  display: block;
  width: 100%;
  height: 100%;
  content: "";
  background: #d7cfc1;
}

.swatch-oak { background: linear-gradient(135deg, #a27a4d, #6e4928); }
.swatch-noir { background: linear-gradient(135deg, #292927, #0d0d0c); }
.swatch-porcelain { background: linear-gradient(135deg, #faf6ec, #cfc5b5); }
.swatch-brass { background: linear-gradient(135deg, #c9a865, #80602f); }
.swatch-linen { background: #8e8c82; }

.upload-promise {
  display: flex;
  gap: 10px;
  margin: 24px 0 0;
  padding-top: 17px;
  color: #76756c;
  border-top: 1px solid var(--line);
  font-family: var(--serif);
  font-size: 10px;
  line-height: 1.7;
}

.upload-promise span {
  color: var(--rust);
  font-family: Georgia, serif;
  font-size: 19px;
  line-height: 1.2;
}

.modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 17px 31px;
  border-top: 1px solid var(--line);
}

.modal-actions .secondary-button {
  min-height: 43px;
  font-size: 11px;
}

.remove-modal,
.confirm-download-modal {
  width: min(530px, calc(100vw - 34px));
}

.remove-preview {
  display: none;
}

.remove-copy {
  margin: 24px 31px 0;
  color: #5e5e56;
  font-family: var(--serif);
  font-size: 13px;
  line-height: 1.9;
}

.preservation-note {
  margin: 19px 31px 25px;
  padding: 12px 14px;
  color: #6e6b60;
  border-left: 2px solid #aa9064;
  background: rgba(174, 148, 100, 0.08);
  font-size: 10px;
  line-height: 1.7;
}

.destructive-note {
  color: #7c3425;
  border-left-color: var(--rust);
  background: rgba(166, 76, 51, 0.075);
  line-height: 1.75;
}

.destructive-note strong {
  display: block;
  margin-bottom: 3px;
  font-size: 11px;
  letter-spacing: 0.04em;
}

.confirm-download-modal .modal-actions {
  margin-top: 24px;
}

.imprint-steps {
  display: grid;
  gap: 8px;
  margin: 19px 31px 0;
}

.imprint-steps span {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  color: #63635b;
  border: 1px solid rgba(48, 49, 43, 0.12);
  font-size: 10px;
}

.imprint-steps b {
  color: var(--rust);
  font-family: Georgia, serif;
  font-size: 13px;
  font-weight: 400;
}

/* Large photo viewer */
.lightbox-modal {
  width: min(1120px, calc(100vw - 38px));
  max-height: calc(100vh - 34px);
  overflow: hidden;
  color: #e9e4d9;
  background: #1c241f;
}

.lightbox-modal[open] {
  display: grid;
  height: min(790px, calc(100vh - 34px));
  grid-template-rows: minmax(0, 1fr) auto;
}

.lightbox-modal::backdrop {
  background: rgba(11, 16, 12, 0.9);
}

.lightbox-fallback[open] {
  position: fixed;
  inset: 0;
  z-index: 130;
  display: grid;
  margin: auto;
}

.lightbox-fallback::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  background: rgba(11, 16, 12, 0.9);
}

body.dialog-open {
  overflow: hidden;
}

.lightbox-close {
  position: absolute;
  top: 17px;
  right: 17px;
  z-index: 4;
  color: #eee8db;
  border-color: rgba(255, 255, 255, 0.23);
  background: rgba(21, 28, 23, 0.46);
}

.lightbox-stage {
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 54px 52px 34px;
  overflow: auto;
  overscroll-behavior: contain;
  background:
    radial-gradient(ellipse at 50% 35%, rgba(150, 144, 123, 0.2), transparent 63%),
    #202922;
}

.lightbox-frame {
  width: auto;
  max-width: 100%;
  flex: 0 0 auto;
}

.lightbox-frame .framed-photo {
  display: inline-block;
  width: auto;
  max-width: 100%;
  cursor: default;
}

.lightbox-frame img {
  cursor: zoom-in;
}

.lightbox-frame.zoomed {
  max-width: none;
}

.lightbox-frame.zoomed .framed-photo {
  max-width: none;
}

.lightbox-frame.zoomed img {
  width: auto;
  max-width: none;
  max-height: none;
  cursor: zoom-out;
}

.lightbox-frame .framed-photo:hover {
  transform: none;
}

.lightbox-frame .matting {
  width: auto;
  padding: clamp(8px, 1vw, 15px);
}

.lightbox-frame img {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 64vh;
  object-fit: contain;
}

.lightbox-frame .zoom-cue {
  display: none;
}

.lightbox-info {
  display: flex;
  min-height: 96px;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  padding: 18px clamp(22px, 4vw, 48px);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  background: #18201b;
}

.lightbox-caption {
  margin: 0;
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: 0.03em;
}

.lightbox-caption.empty-caption {
  color: #b1afa7;
  font-size: 15px;
  font-style: italic;
}

.lightbox-byline {
  margin: 5px 0 0;
  color: #93998f;
  font-size: 9px;
  letter-spacing: 0.08em;
}

.lightbox-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

.lightbox-actions .lightbox-zoom {
  color: #d9c9a8;
}

.lightbox-actions .secondary-button {
  min-height: 43px;
  color: #e4dfd3;
  border-color: rgba(255, 255, 255, 0.22);
  font-size: 10px;
}

.lightbox-actions .secondary-button:hover {
  background: rgba(255, 255, 255, 0.07);
}

.lightbox-actions .primary-button {
  color: #f8f2e7;
  background: var(--rust);
}

.lightbox-actions .primary-button:hover {
  background: var(--rust-dark);
}

/* First-time guide */
.onboarding-modal {
  width: min(780px, calc(100vw - 34px));
  overflow: hidden;
  background: #f8f3e9;
}

.onboarding-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 5;
}

.onboarding-shell {
  display: grid;
  min-height: 410px;
  padding: 54px 54px 32px;
  align-items: center;
  gap: 9px 46px;
  grid-template-columns: 245px minmax(0, 1fr);
}

.guide-visual {
  position: relative;
  width: 245px;
  height: 300px;
  overflow: hidden;
  grid-row: 1 / span 4;
  border-radius: 2px;
  background:
    linear-gradient(135deg, transparent 49.7%, rgba(238, 224, 196, 0.09) 50%, transparent 50.3%),
    #2b3a31;
  box-shadow: 0 18px 38px rgba(45, 39, 31, 0.18);
}

.guide-visual::before {
  position: absolute;
  inset: 0;
  content: "";
  opacity: 0.2;
  background-image: radial-gradient(rgba(255, 246, 226, 0.5) 0.7px, transparent 0.8px);
  background-size: 8px 8px;
}

.onboarding-shell .eyebrow {
  align-self: end;
  color: var(--rust);
}

.onboarding-shell h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(30px, 3.4vw, 42px);
  font-weight: 500;
  letter-spacing: 0.025em;
  line-height: 1.2;
}

.guide-copy {
  margin: 5px 0 10px;
  color: #636159;
  font-family: var(--serif);
  font-size: 13px;
  line-height: 1.9;
}

.guide-points {
  display: grid;
  gap: 8px;
}

.guide-points span {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #55564f;
  font-size: 10px;
}

.guide-points b {
  display: grid;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  place-items: center;
  color: #f6f1e6;
  border-radius: 50%;
  background: var(--forest-light);
  font-size: 8px;
}

.onboarding-actions {
  display: flex;
  min-height: 70px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 13px 28px 13px 54px;
  border-top: 1px solid var(--line);
}

.guide-navigation {
  display: flex;
  align-items: center;
  gap: 9px;
}

.guide-navigation .secondary-button {
  min-width: 78px;
  min-height: 40px;
  font-size: 10px;
}

.guide-navigation .primary-button {
  min-width: 110px;
  min-height: 40px;
  font-size: 10px;
}

.guide-navigation .primary-button:disabled,
.guide-navigation .secondary-button:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}

.guide-dots {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-right: 5px;
}

.guide-dots span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #c2bdb2;
  transition: width 0.2s, background 0.2s;
}

.guide-dots span.active {
  width: 18px;
  border-radius: 5px;
  background: var(--rust);
}

.guide-frame {
  position: absolute;
  display: block;
  box-shadow: 0 12px 20px rgba(0, 0, 0, 0.34);
}

.guide-frame::after {
  position: absolute;
  inset: 6px;
  content: "";
  background: #d5cbb8;
}

.guide-frame-a {
  top: 53px;
  left: 31px;
  width: 111px;
  height: 139px;
  border: 9px solid #916b40;
  transform: rotate(-6deg);
}

.guide-frame-b {
  top: 82px;
  right: 24px;
  width: 91px;
  height: 114px;
  border: 8px solid #171816;
  transform: rotate(5deg);
}

.guide-frame-c {
  bottom: 30px;
  left: 82px;
  width: 94px;
  height: 69px;
  border: 7px solid #b08d50;
  transform: rotate(2deg);
}

.guide-wall-line {
  position: absolute;
  top: 30px;
  right: 22px;
  left: 22px;
  height: 1px;
  background: rgba(232, 219, 191, 0.3);
}

.guide-photo {
  position: absolute;
  top: 62px;
  left: 56px;
  display: block;
  width: 138px;
  height: 165px;
  padding: 9px;
  background: #957047;
  box-shadow: 0 15px 25px rgba(0, 0, 0, 0.38);
  transform: rotate(-3deg);
}

.guide-photo i {
  display: block;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(circle at 66% 30%, #efd0a2 0 11%, transparent 12%),
    linear-gradient(150deg, transparent 55%, #545f4c 56%),
    linear-gradient(160deg, #a96851, #d2a27c);
}

.guide-magnifier {
  position: absolute;
  right: 31px;
  bottom: 43px;
  width: 68px;
  height: 68px;
  border: 8px solid #e5dccb;
  border-radius: 50%;
  background: rgba(216, 226, 211, 0.1);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.36);
}

.guide-magnifier::after {
  position: absolute;
  right: -29px;
  bottom: -19px;
  width: 9px;
  height: 47px;
  content: "";
  border-radius: 4px;
  background: #c9b893;
  transform: rotate(-45deg);
  transform-origin: top;
}

.guide-sheet {
  position: absolute;
  display: block;
  width: 123px;
  height: 158px;
  border: 7px solid #966e40;
  background: #ded4c1;
  box-shadow: 0 15px 28px rgba(0, 0, 0, 0.36);
}

.guide-sheet-back {
  top: 70px;
  left: 39px;
  transform: rotate(-8deg);
  opacity: 0.65;
}

.guide-sheet-front {
  top: 53px;
  left: 67px;
  transform: rotate(4deg);
}

.guide-sheet-front i {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(145deg, #75523d, #d7a777 55%, #5d6251);
}

.guide-download {
  position: absolute;
  right: 23px;
  bottom: 60px;
  display: grid;
  width: 43px;
  height: 43px;
  place-items: center;
  color: #2b3a31;
  border-radius: 50%;
  background: #ede3cf;
  font-family: Georgia, serif;
  font-size: 25px;
  box-shadow: 0 7px 16px rgba(0, 0, 0, 0.31);
}

.guide-remove-frame {
  position: absolute;
  top: 60px;
  left: 54px;
  display: block;
  width: 139px;
  height: 159px;
  border: 10px solid #8e6b43;
  background: #d2c5af;
  box-shadow: 0 15px 28px rgba(0, 0, 0, 0.36);
  transform: rotate(-2deg);
}

.guide-remove-mark {
  position: absolute;
  top: 72px;
  left: 113px;
  display: grid;
  width: 91px;
  height: 91px;
  place-items: center;
  color: #f8eee0;
  border: 5px solid #db9b89;
  border-radius: 50%;
  background: rgba(151, 52, 33, 0.88);
  font-family: Georgia, serif;
  font-size: 56px;
  line-height: 1;
  transform: rotate(7deg);
}

.guide-remove-caption {
  position: absolute;
  right: 0;
  bottom: 26px;
  left: 0;
  color: #e5cfbf;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-align: center;
}

.toast-region {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 120;
  display: grid;
  width: min(360px, calc(100vw - 44px));
  gap: 8px;
  pointer-events: none;
}

.toast {
  padding: 13px 15px;
  color: #faf6ec;
  border-left: 3px solid #c4ad82;
  background: rgba(31, 45, 37, 0.96);
  box-shadow: 0 14px 35px rgba(23, 22, 18, 0.25);
  font-size: 11px;
  line-height: 1.55;
  animation: toast-in 0.28s both ease-out;
}

.toast.error {
  border-color: #df8b70;
  background: rgba(112, 44, 29, 0.97);
}

.toast.leaving {
  animation: toast-out 0.25s both ease-in;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(9px); }
}

@keyframes toast-out {
  to { opacity: 0; transform: translateY(7px); }
}

@media (max-width: 1180px) {
  .photo-wall { column-count: 3; }
  .mini-gallery { opacity: 0.55; }
  .story-copy { margin-top: 110px; }
}

@media (max-width: 930px) {
  .auth-view { grid-template-columns: 1fr 420px; }
  .auth-story { padding-inline: 35px; }
  .story-copy h1 { font-size: 48px; }
  .mini-gallery { right: -50px; width: 320px; opacity: 0.34; }
  .site-header { grid-template-columns: 1fr auto; }
  .header-center { display: none; }
  .intro-heading { grid-template-columns: 1fr; }
  .intro-heading > p { margin-top: -10px; }
  .photo-wall { column-count: 2; }
  .upload-layout { grid-template-columns: 1fr; }
  .upload-preview-column {
    min-height: 310px;
    border-right: 0;
    border-bottom: 1px solid rgba(46, 47, 41, 0.12);
  }
  .file-drop { min-height: 245px; }
  dialog.modal { overflow-y: auto; }
}

@media (max-width: 720px) {
  .auth-view { display: block; background: var(--paper); }
  .auth-story {
    min-height: 320px;
    padding: 25px 24px 35px;
  }
  .story-copy { margin-top: 43px; }
  .story-copy h1 { margin: 12px 0 15px; font-size: 39px; line-height: 1.1; }
  .story-copy h1 br:nth-child(2) { display: none; }
  .story-copy h1 br:nth-child(3) { display: none; }
  .story-intro { max-width: 85%; font-size: 12px; line-height: 1.7; }
  .story-footnote { display: none; }
  .brand-large .brand-seal { width: 35px; height: 39px; font-size: 21px; }
  .brand-large strong { font-size: 19px; }
  .mini-gallery { right: -20px; bottom: -40px; width: 270px; height: 235px; opacity: 0.25; }
  .auth-panel {
    min-height: auto;
    padding: 38px 24px 65px;
    background: var(--paper);
  }
  .auth-card h2 { font-size: 34px; }
  .auth-legal { display: none; }
  .site-header {
    height: 66px;
    padding: 0 17px;
  }
  .site-header .brand-seal { width: 32px; height: 36px; font-size: 19px; }
  .site-header .brand strong { font-size: 16px; }
  .site-header .brand small { display: none; }
  .header-actions { gap: 8px; }
  .hang-button { width: 38px; padding: 0; justify-content: center; font-size: 0; }
  .hang-button .plus { font-size: 22px; }
  .profile-name, .chevron { display: none; }
  .profile-button { padding: 2px; }
  .wall-intro { padding: 38px 20px 27px; }
  .intro-topline { align-items: flex-start; }
  .intro-note { display: none; }
  .intro-heading { padding-top: 24px; gap: 21px; }
  .intro-heading h1 { font-size: clamp(39px, 12vw, 54px); }
  .intro-heading > p { font-family: var(--sans); font-size: 11px; line-height: 1.8; }
  .wall-stats { flex-wrap: wrap; margin-top: 25px; }
  .wall-stats > div { min-width: auto; padding: 0 12px; }
  .wall-stats > div:first-child { padding-left: 0; }
  .wall-stats strong { font-size: 18px; }
  .wall-stats span { display: none; }
  .stats-action { padding: 8px 0 8px 13px; }
  .wall-section { padding: 4px 17px 65px; }
  .photo-wall { column-count: 1; width: min(100%, 480px); margin: 0 auto; }
  .photo-card { margin-bottom: 49px; }
  .framed-photo { padding: 13px; }
  .matting { padding: 9px; }
  .matting img { max-height: none; }
  .photo-actions { align-items: flex-start; flex-direction: column; gap: 5px; }
  .download-actions { align-self: flex-end; }
  .site-footer {
    grid-template-columns: 1fr;
    padding: 30px 20px;
  }
  .site-footer > p:nth-child(2) { line-height: 1.7; }
  .zoom-cue { opacity: 0.88; transform: none; }
  .modal-head { padding: 20px 19px 17px; }
  .modal-head h2 { font-size: 24px; }
  .upload-preview-column { min-height: 300px; padding: 19px; }
  .file-drop { min-height: 240px; }
  .upload-options { padding: 20px 19px 23px; }
  .frame-options { gap: 6px; }
  .frame-option { gap: 8px; padding: 7px; }
  .frame-option:last-child { grid-column: auto; }
  .modal-actions { padding: 14px 19px; }
  .modal-actions button { flex: 1; padding-inline: 10px; }
  .remove-copy { margin-inline: 19px; }
  .preservation-note { margin-inline: 19px; }
  .imprint-steps { margin-inline: 19px; }
  .toast-region { right: 15px; bottom: 15px; width: calc(100vw - 30px); }
  .lightbox-modal {
    max-width: 100vw;
    border-radius: 0;
  }
  dialog.lightbox-modal {
    inset: 0;
    width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
  }
  .lightbox-stage {
    min-height: 0;
    padding: 44px 8px 14px;
  }
  .lightbox-frame .framed-photo { padding: 8px; }
  .lightbox-frame .matting { padding: 4px; }
  .lightbox-frame img { max-height: 62vh; }
  .lightbox-info {
    min-height: 94px;
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
    padding: 13px 17px 17px;
  }
  .lightbox-caption { font-size: 17px; }
  .lightbox-actions { width: 100%; }
  .lightbox-actions { flex-wrap: wrap; }
  .lightbox-actions button { flex: 1; }
  .onboarding-modal { width: calc(100vw - 24px); max-height: calc(100vh - 24px); }
  .onboarding-close { top: 10px; right: 10px; }
  .onboarding-shell {
    min-height: auto;
    padding: 42px 23px 22px;
    gap: 7px;
    grid-template-columns: 1fr;
  }
  .guide-visual {
    width: 100%;
    height: 168px;
    grid-row: auto;
    margin-bottom: 8px;
  }
  .guide-visual .guide-frame,
  .guide-visual .guide-photo,
  .guide-visual .guide-sheet,
  .guide-visual .guide-remove-frame,
  .guide-visual .guide-remove-mark {
    transform: scale(0.66);
    transform-origin: top left;
  }
  .guide-frame-a { top: -2px; left: 25px; }
  .guide-frame-b { top: 17px; right: auto; left: 139px; }
  .guide-frame-c { bottom: auto; top: 82px; left: 76px; }
  .guide-photo { top: 0; left: 58px; }
  .guide-magnifier { right: 55px; bottom: 1px; }
  .guide-sheet-back { top: 5px; left: 53px; }
  .guide-sheet-front { top: -4px; left: 83px; }
  .guide-download { right: 45px; bottom: 5px; }
  .guide-remove-frame { top: -7px; left: 50px; }
  .guide-remove-mark { top: 0; left: 96px; }
  .guide-remove-caption { bottom: 4px; }
  .onboarding-shell h2 { font-size: 28px; }
  .guide-copy { font-size: 11px; line-height: 1.76; }
  .guide-points { gap: 5px; }
  .onboarding-actions {
    padding: 11px 18px;
    align-items: flex-start;
    flex-direction: column-reverse;
    gap: 12px;
  }
  .guide-navigation { width: 100%; }
  .guide-navigation .secondary-button { min-width: 72px; }
  .guide-navigation .primary-button { flex: 1; }
}

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