:root {
  --paper: #fbf7ec;
  --ink: #f7ead0;
  --muted: #d8c199;
  --gold: #c79a41;
  --gold-soft: rgba(220, 169, 78, 0.32);
  --velvet: #4b071b;
  --panel: rgba(20, 14, 10, 0.76);
  --panel-strong: rgba(14, 9, 6, 0.9);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: #0d0907;
  color: var(--ink);
  font-family: Inter, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

body {
  min-height: 100vh;
  margin: 0;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(245, 213, 139, 0.42);
  outline-offset: 4px;
}

.cushion-room {
  position: relative;
  display: grid;
  grid-template-columns: minmax(17rem, 22.5rem) minmax(10rem, 1fr) minmax(15rem, 21rem);
  gap: clamp(0.75rem, 3vw, 2rem);
  align-items: stretch;
  min-height: 100vh;
  padding: clamp(0.85rem, 2.2vw, 1.9rem);
  overflow: hidden;
}

.room-image,
.room-shade {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
}

.room-image {
  object-fit: contain;
  object-position: center;
  filter: saturate(0.96) contrast(1.04);
  background: #070504;
}

.room-shade {
  background:
    radial-gradient(circle at 50% 52%, rgba(0, 0, 0, 0) 0 23rem, rgba(0, 0, 0, 0.18) 45rem),
    linear-gradient(90deg, rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0.08) 34%, rgba(0, 0, 0, 0.08) 66%, rgba(0, 0, 0, 0.68)),
    linear-gradient(180deg, rgba(0, 0, 0, 0.18), rgba(0, 0, 0, 0.08) 42%, rgba(0, 0, 0, 0.56));
  pointer-events: none;
}

.privilege-card,
.certificate,
.return-nav {
  position: relative;
  z-index: 1;
}

.return-nav {
  grid-column: 3;
  justify-self: end;
  align-self: start;
  display: grid;
  gap: 0.48rem;
  justify-items: end;
}

.return-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.15rem;
  padding: 0.45rem 0.72rem;
  border: 1px solid rgba(222, 178, 91, 0.34);
  border-radius: 999px;
  background: rgba(14, 9, 6, 0.48);
  color: #dec99f;
  font: 700 0.62rem/1 Inter, Arial, sans-serif;
  letter-spacing: 0.12em;
  text-decoration: none;
  text-transform: uppercase;
  backdrop-filter: blur(5px);
}

.return-nav a:hover {
  background: rgba(255, 246, 224, 0.08);
}

.privilege-card {
  grid-column: 1;
  align-self: start;
  width: min(100%, 22.5rem);
  margin-top: clamp(0.35rem, 2vh, 1.2rem);
  border: 1px solid rgba(222, 178, 91, 0.4);
  border-radius: 6px;
  background:
    linear-gradient(180deg, rgba(255, 246, 224, 0.06), rgba(255, 246, 224, 0)),
    rgba(19, 13, 9, 0.68);
  box-shadow: 0 18px 52px rgba(0, 0, 0, 0.34);
  padding: clamp(0.9rem, 1.7vw, 1.18rem);
  backdrop-filter: blur(6px);
}

.eyebrow,
.timer-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2,
.timer {
  font-family: "Cormorant Garamond", Georgia, serif;
}

h1 {
  margin: 0.24rem 0 0.58rem;
  color: #fff3d6;
  font-size: clamp(1.92rem, 3vw, 2.58rem);
  font-weight: 700;
  letter-spacing: 0.035em;
  line-height: 0.92;
  text-transform: uppercase;
}

.decree {
  max-width: 20rem;
  margin: 0 0 0.78rem;
  color: #eadbbf;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(0.96rem, 1.25vw, 1.08rem);
  line-height: 1.24;
}

.timer-panel {
  border-top: 1px solid var(--gold-soft);
  border-bottom: 1px solid var(--gold-soft);
  padding: 0.62rem 0 0.7rem;
}

.timer {
  margin: 0.08rem 0 0.55rem;
  color: #fff8e8;
  font-size: clamp(2.3rem, 4vw, 3.15rem);
  font-weight: 600;
  letter-spacing: 0.06em;
  line-height: 0.9;
}

.progress {
  height: 0.36rem;
  overflow: hidden;
  border: 1px solid rgba(217, 174, 91, 0.55);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.42);
}

.progress span {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #8e1234, #d9a951);
  transform-origin: left;
}

.ceremony-button {
  width: 100%;
  min-height: 2.62rem;
  margin-top: 0.82rem;
  border: 1px solid rgba(255, 226, 166, 0.72);
  border-radius: 4px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0)),
    var(--velvet);
  color: #fff4d8;
  cursor: pointer;
  font: 700 0.78rem/1 Inter, Arial, sans-serif;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.ceremony-button:hover {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0)),
    #5d0821;
}

.ceremony-button[disabled] {
  cursor: default;
  opacity: 0.76;
}

.status {
  min-height: 2.1rem;
  margin: 0.72rem 0 0;
  color: #dcc8a5;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 0.95rem;
  line-height: 1.22;
}

.completion-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.55rem;
  margin-top: 0.78rem;
}

.completion-actions[hidden] {
  display: none;
}

.secondary-button,
.return-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.4rem;
  border-radius: 4px;
  font: 700 0.72rem/1 Inter, Arial, sans-serif;
  letter-spacing: 0.12em;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
}

.secondary-button {
  border: 1px solid rgba(255, 226, 166, 0.52);
  background: rgba(255, 246, 224, 0.08);
  color: #fff4d8;
  cursor: pointer;
}

.secondary-button:hover {
  background: rgba(255, 246, 224, 0.14);
}

.return-link {
  border: 1px solid rgba(222, 178, 91, 0.42);
  color: #dec99f;
}

.return-link:hover {
  background: rgba(255, 246, 224, 0.08);
}

.certificate {
  grid-column: 3;
  align-self: end;
  margin-bottom: clamp(0.35rem, 2vh, 1.2rem);
  border: 1px solid rgba(222, 178, 91, 0.36);
  border-radius: 6px;
  background:
    linear-gradient(180deg, rgba(255, 246, 224, 0.05), rgba(255, 246, 224, 0)),
    rgba(14, 9, 6, 0.58);
  padding: 0.95rem;
  backdrop-filter: blur(6px);
  transition:
    border-color 180ms ease,
    background 180ms ease,
    transform 180ms ease;
}

.certificate[hidden] {
  display: none;
}

.certificate-heading {
  display: flex;
  gap: 0.75rem;
  align-items: start;
  justify-content: space-between;
}

.certificate h2 {
  margin: 0 0 0.48rem;
  color: #fff1cf;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.055em;
  line-height: 1.03;
  text-transform: uppercase;
}

.scholarship-toggle {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 0.45rem;
  align-items: center;
  min-height: 1.8rem;
  border: 1px solid rgba(222, 178, 91, 0.34);
  border-radius: 999px;
  background: rgba(255, 246, 224, 0.05);
  color: var(--muted);
  cursor: pointer;
  font: 700 0.55rem/1 Inter, Arial, sans-serif;
  letter-spacing: 0.1em;
  padding: 0.4rem 0.58rem;
  text-transform: uppercase;
}

.scholarship-toggle:hover {
  background: rgba(255, 246, 224, 0.12);
}

#scholarship-content[hidden] {
  display: none;
}

.certificate #cushion-fact {
  min-height: 5.8rem;
  margin: 0;
  color: #d7c4a2;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 0.98rem;
  line-height: 1.24;
}

.fact-controls {
  display: flex;
  gap: 0.55rem;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.78rem;
}

.fact-controls button {
  display: inline-grid;
  place-items: center;
  width: 2.15rem;
  height: 2.15rem;
  border: 1px solid rgba(222, 178, 91, 0.45);
  border-radius: 50%;
  background: rgba(255, 246, 224, 0.06);
  color: #f3dfb4;
  cursor: pointer;
  font: 700 1rem/1 Inter, Arial, sans-serif;
}

.fact-controls button:hover {
  background: rgba(255, 246, 224, 0.14);
}

@media (max-width: 860px) {
  .cushion-room {
    grid-template-columns: 1fr;
    align-items: end;
  }

  .room-image {
    object-fit: cover;
  }

  .privilege-card,
  .certificate,
  .return-nav {
    grid-column: 1;
  }

  .return-nav {
    grid-row: 1;
    grid-template-columns: repeat(2, auto);
    justify-content: space-between;
    justify-items: stretch;
    justify-self: stretch;
  }

  .certificate {
    grid-row: 2;
    align-self: start;
    max-width: 25rem;
    margin: 2.8rem 0 0;
  }

  .privilege-card {
    grid-row: 3;
    margin: 0;
  }
}

@media (max-width: 520px) {
  .cushion-room {
    display: grid;
    grid-template-rows: auto auto minmax(18rem, 44svh) auto;
    gap: 0.65rem;
    align-items: stretch;
    min-height: 100svh;
    padding: 0.75rem;
    overflow: visible;
    background: #070504;
  }

  .room-image {
    position: relative;
    inset: auto;
    z-index: 0;
    grid-column: 1;
    grid-row: 3;
    width: calc(100% + 1.5rem);
    height: 100%;
    margin-left: -0.75rem;
    object-fit: cover;
    object-position: center 57%;
    border-top: 1px solid rgba(222, 178, 91, 0.24);
    border-bottom: 1px solid rgba(222, 178, 91, 0.24);
  }

  .room-shade {
    position: absolute;
    background:
      linear-gradient(180deg, rgba(0, 0, 0, 0.12), transparent 38%, rgba(0, 0, 0, 0.18));
  }

  .certificate {
    grid-row: 2;
    align-self: stretch;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0.72rem;
    background: rgba(14, 9, 6, 0.92);
    backdrop-filter: none;
  }

  .certificate h2 {
    margin: 0;
    font-size: 0.9rem;
  }

  .certificate-heading {
    align-items: center;
  }

  .certificate #cushion-fact {
    min-height: 0;
    max-width: none;
    margin-top: 0.55rem;
    font-size: 0.9rem;
    line-height: 1.18;
  }

  .scholarship-toggle {
    min-height: 1.85rem;
  }

  .fact-controls {
    margin-top: 0.5rem;
  }

  .fact-controls button {
    width: 1.9rem;
    height: 1.9rem;
  }

  .privilege-card {
    grid-row: 4;
    align-self: stretch;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0.72rem;
    background: rgba(19, 13, 9, 0.94);
    backdrop-filter: none;
  }

  .privilege-card .eyebrow,
  .decree {
    display: none;
  }

  .privilege-card h1 {
    margin: 0 0 0.5rem;
    font-size: 1.45rem;
    line-height: 1;
  }

  .timer-panel {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.25rem 0.75rem;
    align-items: end;
    padding: 0.48rem 0;
  }

  .timer {
    grid-column: 2;
    grid-row: 1;
    margin: 0;
    font-size: 2rem;
  }

  .progress {
    grid-column: 1 / -1;
  }

  .ceremony-button {
    min-height: 2.35rem;
    margin-top: 0.58rem;
    font-size: 0.68rem;
  }

  .status {
    min-height: 0;
    margin-top: 0.48rem;
    font-size: 0.86rem;
  }

  .return-nav {
    grid-row: 1;
    gap: 0.35rem;
  }

  .return-nav a {
    min-height: 1.95rem;
    padding: 0.4rem 0.55rem;
    font-size: 0.54rem;
  }
}
