/* The home page scene. Loaded after /site.css and /after-hours.css:
   it keeps the night-to-dawn page and only replaces the opening view with a
   first-person desk. You look over a laptop (the upload box is its screen)
   and out of the window at the city going to sleep. */

.room {
  --desk: 214px;
  /* Shrinks on short screens so the desk always shows above the fold */
  --laptop: clamp(480px, min(58vw, (100vh - 400px) * 1.62), 760px);
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 61px);
  overflow: hidden;
}

/* ---- The window ------------------------------------------------------------ */

.window {
  position: absolute;
  z-index: -3;
  top: 0;
  left: 0;
  right: 0;
  bottom: var(--desk);
  overflow: hidden;
}

/* A faint reflection of the room on the glass */
.window::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 240, 220, 0.035) 42%, transparent 52%);
}

/* 25vw matches the city's 4:1 drawing, so nothing is ever cropped off the top */
.window .skyline {
  bottom: 0;
  height: max(200px, 25vw);
}

/* ---- The desk -------------------------------------------------------------- */

.desk {
  position: absolute;
  z-index: -2;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--desk);
  border-top: 1px solid rgba(255, 214, 160, 0.22);
  background:
    radial-gradient(ellipse 55% 90% at 50% 0%, rgba(160, 190, 255, 0.10), transparent 70%),
    radial-gradient(ellipse 45% 120% at 12% 10%, rgba(244, 169, 60, 0.26), transparent 70%),
    repeating-linear-gradient(179deg, rgba(0, 0, 0, 0.07) 0 2px, transparent 2px 11px),
    linear-gradient(180deg, #4a2f1d 0%, #36210f 45%, #24160b 100%);
}

/* The front edge of the desk, nearest you */
.desk::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 14px;
  background: linear-gradient(180deg, #1b1007, #0e0804);
  border-top: 1px solid rgba(255, 214, 160, 0.12);
}

/* ---- Headline, up in the window ------------------------------------------ */

.room-head {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 48px;
  align-items: end;
  padding-top: 20px;
}

.room-head h1 { font-size: clamp(40px, 4.4vw, 62px); }

.room-head .lede { margin: 0; max-width: 44ch; font-size: 15px; line-height: 1.6; }

/* ---- The laptop -------------------------------------------------------------- */

.workspace {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  padding-top: 22px;
  padding-bottom: calc(var(--desk) - 112px);
}

.laptop {
  position: relative;
  width: var(--laptop);
}

/* Its shadow on the desk */
.laptop::after {
  content: "";
  position: absolute;
  z-index: -1;
  left: -4%;
  right: -4%;
  bottom: -22px;
  height: 30px;
  background: radial-gradient(closest-side, rgba(0, 0, 0, 0.55), transparent);
}

.lid {
  position: relative;
  padding: 14px 14px 18px;
  border-radius: 16px 16px 4px 4px;
  background: #15171c;
  box-shadow:
    inset 0 0 0 1px #2c3038,
    0 0 160px rgba(150, 180, 255, 0.14);
}

/* Camera */
.lid::before {
  content: "";
  position: absolute;
  top: 5px;
  left: 50%;
  width: 5px;
  height: 5px;
  margin-left: -2.5px;
  border-radius: 50%;
  background: #2f343c;
}

.base {
  position: relative;
  height: 15px;
  width: 112%;
  margin-left: -6%;
  background: linear-gradient(180deg, #d4d7dc 0%, #a6abb3 55%, #6f747c 100%);
  clip-path: polygon(0 0, 100% 0, 98% 100%, 2% 100%);
  border-radius: 0 0 10px 10px;
}

/* The notch you open the lid with */
.base::after {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 16%;
  height: 5px;
  transform: translateX(-50%);
  border-radius: 0 0 6px 6px;
  background: #8c9199;
}

.screen {
  display: flex;
  flex-direction: column;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: 3px;
  background: #f8f3e8;
  color: var(--ink);
}

.titlebar {
  position: relative;
  flex: none;
  display: flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px;
  background: #e8e0cf;
  border-bottom: 1px solid #d8cdb8;
  font-family: var(--mono);
  font-size: 11px;
  color: #6c6a63;
}

.titlebar i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #c9bfad;
}

.titlebar .file {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  max-width: 64%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.titlebar time { margin-left: auto; }

/* Never scrolls: every stage is laid out to fit, and desk.js shrinks the
   roast text if a long answer would otherwise spill over. */
.screen-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding: 14px 16px;
}

/* The upload card fills the screen instead of sitting on the page */
.screen .roaster {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: 0;
  background: transparent;
  box-shadow: none;
  transform: none;
}

.screen .dropzone {
  flex: 1;
  min-height: 170px;
  padding: 16px;
  gap: 8px;
}

.screen .dropzone strong { font-size: clamp(26px, 2.6vw, 36px); }

.screen .dropzone .icon { width: 44px; height: 44px; }

.screen .preview img { max-height: 210px; }

.screen .privacy-note { margin-top: 10px; font-size: 12px; }

/* ---- Things on the desk ---------------------------------------------------- */

.desk-items {
  position: absolute;
  z-index: 1;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--desk);
  pointer-events: none;
}

.desk-items svg { position: absolute; overflow: visible; }

/* Sizes are true to life, using the laptop (about 30cm wide) as the ruler. */
.notebook { left: calc(50% - var(--laptop) / 2 - 330px); bottom: 6px; width: 310px; }
.earbuds { left: calc(50% + var(--laptop) / 2 - 150px); bottom: 12px; width: 104px; }
.glass { left: calc(50% + var(--laptop) / 2 + 196px); bottom: 104px; width: 132px; }
.coffee { left: calc(50% + var(--laptop) / 2 + 22px); bottom: 4px; width: 224px; }

/* ---- The phone, lying screen-up on the notebook, team chat going off ------ */

.phone {
  position: absolute;
  left: calc(50% - var(--laptop) / 2 - 214px);
  bottom: 14px;
  width: 150px;
  transform-origin: 50% 100%;
  transform: perspective(900px) rotateX(42deg) rotateZ(-9deg);
}

.phone-body {
  position: relative;
  aspect-ratio: 9 / 19;
  padding: 5px;
  border-radius: 26px;
  background: linear-gradient(135deg, #6a6e76 0%, #23262b 22%, #15171b 60%, #464a52 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.12),
    6px 10px 18px rgba(0, 0, 0, 0.6),
    0 0 60px rgba(90, 150, 255, 0.16);
}

.phone.buzz .phone-body { animation: buzz 0.45s ease; }

@keyframes buzz {
  0%, 100% { transform: none; }
  20% { transform: translateX(-1.5px) rotate(-0.7deg); }
  40% { transform: translateX(1.5px) rotate(0.7deg); }
  60% { transform: translateX(-1px) rotate(-0.4deg); }
  80% { transform: translateX(1px) rotate(0.3deg); }
}

.phone-screen {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border-radius: 21px;
  background: #0b141a;
  color: #e9edef;
  font-family: var(--sans);
}

.statusbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: none;
  height: 24px;
  padding: 2px 14px 0;
  font-size: 9px;
  font-weight: 600;
}

.island {
  position: absolute;
  top: 6px;
  left: 50%;
  width: 42px;
  height: 12px;
  margin-left: -21px;
  border-radius: 8px;
  background: #000;
}

.battery {
  width: 15px;
  height: 7px;
  border: 1px solid #e9edef;
  border-radius: 2px;
  padding: 1px;
}

.battery::before {
  content: "";
  display: block;
  width: 28%;
  height: 100%;
  background: #f15c4f;
}

.chat-head {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
  padding: 5px 8px 6px;
  background: #1f2c34;
}

.chat-avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #c24428;
  font-size: 8px;
  font-weight: 700;
}

.chat-head div { min-width: 0; line-height: 1.2; }
.chat-head b { display: block; font-size: 10px; }

.chat-head small {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 7.5px;
  color: #8696a0;
}

.chat {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: flex-end;
  gap: 5px;
  margin: 0;
  padding: 8px 7px 10px;
  overflow: hidden;
  list-style: none;
}

.msg {
  align-self: flex-start;
  max-width: 94%;
  padding: 4px 7px 3px;
  border-radius: 0 8px 8px 8px;
  background: #1f2c34;
  font-size: 10px;
  line-height: 1.3;
}

.msg b { display: block; font-size: 8.5px; font-weight: 600; }
.msg time { display: block; text-align: right; font-size: 6.5px; color: #8696a0; }

.from-sm b { color: #53bdeb; }
.from-m b { color: #e26ab6; }
.from-p b { color: #f4a93c; }

.phone.is-live .msg:not(.in) { display: none; }
.phone.is-live .msg.in:last-child { animation: arrive 0.35s ease; }

@keyframes arrive {
  from { opacity: 0; transform: translateY(8px) scale(0.96); }
  to { opacity: 1; transform: none; }
}

.steam path { animation: steam 4.5s ease-in-out infinite; }
.steam path:nth-child(2) { animation-delay: 1.6s; }

@keyframes steam {
  0% { opacity: 0; transform: translateY(6px); }
  40% { opacity: 0.55; }
  100% { opacity: 0; transform: translateY(-14px); }
}

/* ---- Smaller screens --------------------------------------------------------- */

@media (max-width: 1240px) {
  .glass { display: none; }
}

@media (max-width: 1100px) {
  .notebook { left: -40px; width: 260px; }
  .phone { width: 128px; left: calc(50% - var(--laptop) / 2 - 170px); }
  .coffee { width: 190px; }
}

@media (max-width: 860px) {
  .room {
    --desk: 140px;
    --laptop: calc(100vw - 48px);
  }

  .room-head {
    grid-template-columns: 1fr;
    gap: 18px;
    padding-top: 32px;
  }

  .workspace { padding-top: 56px; padding-bottom: 72px; }

  .screen { aspect-ratio: auto; height: 440px; }

  .titlebar time { display: none; }

  .notebook, .phone { display: none; }

  .earbuds { left: 18px; bottom: 14px; width: 84px; }

  .coffee { left: auto; right: 4px; bottom: 2px; width: 150px; }
}

@media (prefers-reduced-motion: reduce) {
  .steam path { animation: none; opacity: 0.35; }
}

/* ---- The paste box: the one thing on this page we want people to do ----- */

.screen .dropzone {
  position: relative;
  border: 2px dashed var(--red-pen);
  background: rgba(196, 43, 28, 0.035);
}

.screen .dropzone:hover,
.screen .dropzone:focus-visible,
.screen .dropzone.is-dragging { background: rgba(196, 43, 28, 0.08); }

/* A slow pulse around the box so the eye lands on it */
.screen .dropzone::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 3px;
  box-shadow: 0 0 0 0 rgba(196, 43, 28, 0.35);
  animation: invite 2.6s ease-out infinite;
  pointer-events: none;
}

@keyframes invite {
  0% { box-shadow: 0 0 0 0 rgba(196, 43, 28, 0.35); }
  70%, 100% { box-shadow: 0 0 0 10px rgba(196, 43, 28, 0); }
}

.screen .dropzone .icon { background: var(--red-pen); color: #fff; }

/* Handwritten pointer beside the laptop */
.pointer {
  position: absolute;
  z-index: 3;
  top: 20%;
  right: -190px;
  width: 170px;
  color: var(--glow);
  font-family: var(--hand);
  font-size: 30px;
  font-weight: 700;
  line-height: 0.95;
  transform: rotate(-4deg);
  text-shadow: 0 2px 12px rgba(10, 17, 29, 0.9);
  pointer-events: none;
}

.pointer svg {
  width: 110px;
  margin: 4px 0 0 -30px;
  filter: drop-shadow(0 2px 6px rgba(10, 17, 29, 0.9));
}

/* The add-in button is the page's second job, so it gets the brightest colour */
.topbar .btn-dark,
.topbar .btn-dark:hover {
  background: var(--glow);
  border-color: var(--glow);
  color: var(--ink);
  font-weight: 700;
  box-shadow: 0 0 24px rgba(244, 169, 60, 0.35);
}

.topbar .btn-dark:hover { background: #ffbe58; border-color: #ffbe58; }

@media (max-width: 1240px) {
  .pointer { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .screen .dropzone::after { animation: none; }
}

/* Touch screens have no keyboard shortcut, so "Choose a file" does the job */

/* ---- The pop-out --------------------------------------------------------------
   On the desk the screen only ever shows the paste box. As soon as a slide is
   added, desk.js pops the screen out to fill the window and it becomes a mini
   PowerPoint: the slide on a grey canvas on the left, and on the right a panel
   styled like the add-in's own task pane. */

/* On the laptop, the panel's pieces simply flow in place */
.pane, .pane-card { display: contents; }
.pane-bar { display: none; }

body.screen-open { overflow: hidden; }
body.screen-open .room { z-index: 50; }

/* Inset from the window edges so the website stays visible, dimmed, behind it */
.screen.is-open {
  position: fixed;
  inset: clamp(12px, 4vh, 44px) clamp(12px, 4vw, 64px);
  z-index: 100;
  height: auto;
  aspect-ratio: auto;
  border-radius: 10px;
  box-shadow: 0 0 0 100vmax rgba(5, 9, 16, 0.55), 0 30px 80px rgba(0, 0, 0, 0.6);
}

.screen.is-open .screen-body { padding: 0; }

.screen.is-open .roaster {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(340px, 30vw, 440px);
  height: 100%;
  min-height: 0;
  font-size: 14px;
}

.screen.is-open .preview {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: clamp(20px, 4vw, 56px);
  border: 0;
  border-radius: 0;
  background: #e4e4e4;
}

.screen.is-open .preview.is-roasting::after { display: none; }
.screen.is-open .preview.is-roasting img { filter: none; }

.screen.is-open .preview img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12), 0 12px 40px rgba(0, 0, 0, 0.12);
}

/* The add-in's task pane, rebuilt. Mirrors src/taskpane/styles/global.css:
   navy night, cream printed-page sheets, serif heading, red-pen roast notes,
   a smouldering header corner and a hot-coal roast button. */
.screen.is-open .pane {
  --pane-paper: #f8f3e8;
  --pane-rule: #ded5c4;
  --pane-ink-soft: #46535c;
  --ember-deep: #7a2412;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
  overflow-y: auto;
  padding: 0 16px 18px;
  border-left: 1px solid #000;
  background: linear-gradient(180deg, var(--night) 0%, var(--night-up) 100%);
  color: var(--cream);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  color-scheme: dark;
}

/* The panel scrolls; its pieces never squash to fit */
.screen.is-open .pane > * { flex-shrink: 0; }

.screen.is-open .pane::-webkit-scrollbar { width: 6px; }
.screen.is-open .pane::-webkit-scrollbar-thumb { background: rgba(242, 234, 217, 0.22); border-radius: 3px; }
.screen.is-open .pane::-webkit-scrollbar-thumb:hover { background: var(--glow); }

/* Header, with the smouldering corner */
.screen.is-open .pane-bar {
  position: sticky; /* keeps the close button in reach while the roast scrolls */
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 -16px;
  padding: 14px 12px 16px 16px;
  overflow: hidden;
  border-bottom: 1px solid rgba(242, 234, 217, 0.12);
  background: var(--night);
}

.screen.is-open .pane-bar::before {
  content: "";
  position: absolute;
  right: -40px;
  bottom: -50px;
  width: 190px;
  height: 120px;
  background: radial-gradient(closest-side, rgba(244, 169, 60, 0.55), rgba(194, 68, 40, 0.35) 45%, rgba(194, 68, 40, 0) 100%);
  animation: pane-flicker 3.2s ease-in-out infinite;
  pointer-events: none;
}

.screen.is-open .pane-bar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: linear-gradient(90deg, rgba(194, 68, 40, 0) 35%, var(--ember) 75%, var(--glow));
}

.pane-bar > * { position: relative; }

.pane-logo { width: 30px; height: 30px; flex: none; }

.pane-brand { flex: 1; min-width: 0; }

.pane-brand b {
  display: block;
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 400;
  line-height: 1;
}

.pane-brand span {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  color: var(--cream-soft);
}

.pane-close {
  display: grid;
  place-items: center;
  flex: none;
  align-self: flex-start;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--cream);
  cursor: pointer;
}

.pane-close:hover { background: rgba(242, 234, 217, 0.1); }
.pane-close:focus-visible { outline: 2px solid var(--glow); outline-offset: 1px; }
.pane-close svg { width: 14px; height: 14px; }

@keyframes pane-flicker {
  0%, 100% { opacity: 0.85; }
  40% { opacity: 1; }
  60% { opacity: 0.7; }
}

.screen.is-open .pane-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.screen.is-open .pane-card:has(> [hidden] + [hidden]) { display: none; }

/* Roasting: the logo's flame flickering on a printed page, then the line */
.screen.is-open .status {
  display: grid;
  gap: 4px;
  margin: 0;
  text-align: center;
  color: var(--cream);
  font-size: 15px;
}

.screen.is-open .status[hidden] { display: none; }

.pane-fire {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
  margin-bottom: 10px;
  overflow: hidden;
  border-radius: 2px;
  background: var(--pane-paper);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5), 0 0 60px rgba(244, 169, 60, 0.12);
}

.pane-fire::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 4%;
  width: 70%;
  height: 80%;
  transform: translateX(-50%);
  background: radial-gradient(ellipse 50% 50% at 50% 70%, rgba(244, 169, 60, 0.45), rgba(194, 68, 40, 0.12) 55%, rgba(194, 68, 40, 0) 75%);
  animation: pane-glow 1.8s ease-in-out infinite alternate;
}

.pane-fire svg {
  position: relative;
  width: 96px;
  height: 120px;
  max-height: 80%;
  overflow: visible;
}

.pane-fire path { transform-box: fill-box; transform-origin: 50% 100%; }
.pane-fire .fire-outer { animation: pane-flame-outer 1.3s ease-in-out infinite alternate; }
.pane-fire .fire-inner { animation: pane-flame-inner 0.9s ease-in-out infinite alternate; }

@keyframes pane-flame-outer {
  0%   { transform: scale(1, 1) skewX(0deg); }
  30%  { transform: scale(0.96, 1.06) skewX(-3deg); }
  60%  { transform: scale(1.03, 0.95) skewX(2deg); }
  100% { transform: scale(0.98, 1.04) skewX(-1deg); }
}

@keyframes pane-flame-inner {
  0%   { transform: scale(1, 1) skewX(0deg); opacity: 1; }
  40%  { transform: scale(0.92, 1.12) skewX(4deg); opacity: 0.85; }
  100% { transform: scale(1.05, 0.92) skewX(-3deg); opacity: 1; }
}

@keyframes pane-glow { from { opacity: 0.6; } to { opacity: 1; } }

.status-sub { font-size: 13px; color: var(--cream-soft); }

/* The roast button: a hot coal with heat rising off it */
.screen.is-open .roaster-actions {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 6px 0 0;
}

.screen.is-open .roaster-actions[hidden] { display: none; }

.screen.is-open .roaster-actions::before {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  top: -26px;
  height: 40px;
  background: radial-gradient(ellipse 50% 60% at 50% 100%, rgba(244, 169, 60, 0.5), rgba(194, 68, 40, 0) 70%);
  filter: blur(4px);
  pointer-events: none;
  animation: pane-flicker 2.6s ease-in-out infinite;
}

/* No coal glow when it's only the "Roast another slide" button */
.screen.is-open .roaster-actions:has(#roast-btn[hidden])::before { display: none; }

.screen.is-open #roast-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 0;
  border-radius: 4px;
  background: radial-gradient(ellipse 80% 140% at 50% 120%, var(--glow) 0%, var(--ember) 55%, var(--ember-deep) 100%);
  box-shadow: none;
  color: #fff;
  font: 600 16px/1 var(--sans);
}

.screen.is-open #roast-btn[hidden] { display: none; }
.screen.is-open #roast-btn:hover { filter: brightness(1.08); }
.screen.is-open #roast-btn:focus-visible { outline: 2px solid var(--glow); outline-offset: 2px; }
.screen.is-open #roast-btn svg { width: 18px; height: 18px; flex: none; }

.screen.is-open #reset-btn {
  width: 100%;
  border: 1px solid rgba(242, 234, 217, 0.22);
  border-radius: 4px;
  background: transparent;
  color: var(--cream);
  font-size: 14px;
}

.screen.is-open #reset-btn:hover { border-color: var(--cream); }

.screen.is-open .error {
  margin: 0;
  padding: 10px 12px;
  border-radius: 2px;
  font-size: 13px;
}

/* Results: the red-pen pass on a printed draft */
.screen.is-open .results { display: flex; flex-direction: column; gap: 14px; margin: 0; }
.screen.is-open .results[hidden] { display: none; }

.results-sheet {
  padding: 14px;
  border-radius: 2px;
  background: var(--pane-paper);
  color: var(--ink);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5), 0 0 60px rgba(244, 169, 60, 0.12);
  transform: rotate(-0.5deg);
}

.screen.is-open .results-head {
  display: block;
  margin: 0 0 4px;
  font-family: var(--hand);
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
  color: var(--red-pen);
}

.screen.is-open .roast-list { display: block; }

.screen.is-open .roast {
  padding: 12px 0;
  border: 0;
  border-bottom: 1px solid var(--pane-rule);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.screen.is-open .roast:last-child { border-bottom: 0; padding-bottom: 2px; }

.screen.is-open .roast p { font-size: 13.5px; line-height: 1.5; color: var(--ink); }

.screen.is-open .roast .fix {
  margin-top: 8px;
  padding-left: 10px;
  border-left: 2px solid var(--red-pen);
  color: var(--pane-ink-soft);
  font-size: 13px;
  font-style: normal;
}

.screen.is-open .roast .fix b {
  font-family: var(--hand);
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  color: var(--red-pen);
}

.screen.is-open .summary {
  margin: 4px 0 0;
  padding: 12px 0 2px;
  border-top: 1px solid var(--pane-rule);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-size: 13.5px;
  line-height: 1.5;
}

.screen.is-open .summary[hidden] { display: none; }

.screen.is-open .summary b {
  font-family: var(--hand);
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  color: var(--red-pen);
}

.screen.is-open .upsell {
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid rgba(244, 169, 60, 0.4);
  border-radius: 2px;
  background: rgba(244, 169, 60, 0.08);
  color: var(--cream);
  font-size: 13.5px;
}

.screen.is-open .upsell .btn {
  border-radius: 4px;
  background: var(--glow);
  color: var(--ink);
  font-weight: 700;
}

.screen.is-open .upsell .btn:hover { background: #ffbe58; }

.screen.is-open .privacy-note { margin: 0; font-size: 12px; color: var(--cream-soft); }
.screen.is-open .privacy-note a { color: var(--glow); }

@media (prefers-reduced-motion: reduce) {
  .screen.is-open .pane *,
  .screen.is-open .pane *::before,
  .screen.is-open .pane *::after,
  .screen.is-open .pane-bar::before { animation: none !important; }
}

/* The roast starts by itself, so while it runs there are no buttons (or glow) */
.screen .roaster[data-stage="roasting"] .roaster-actions { display: none; }

/* Phones: slide on top, panel underneath, and the whole thing scrolls */
@media (max-width: 860px) {
  .screen.is-open { overflow-y: auto; }
  .screen.is-open .screen-body { flex: none; overflow: visible; }
  .screen.is-open .roaster { display: flex; flex-direction: column; height: auto; }
  .screen.is-open .preview { flex: none; max-height: 42vh; padding: 16px; }
  .screen.is-open .preview img { max-height: calc(42vh - 32px); }
  .screen.is-open .pane { overflow: visible; border-left: 0; }
}

/* ---- The laptop screen: a blank slide waiting for yours ------------------------
   It looks like PowerPoint with a new, empty slide, so there's nothing to learn:
   the title placeholder says "Paste your slide here". Overrides the earlier
   paste-box styling. */

.screen .screen-body { padding: 0; }

.screen .roaster { position: relative; }

.screen .dropzone {
  flex: 1;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #e4e4e4;
}

.screen .dropzone::after { display: none; }

.screen .dropzone:hover,
.screen .dropzone:focus-visible,
.screen .dropzone.is-dragging { background: #e4e4e4; }

.ph {
  border: 1.5px dashed #bdbdbd;
  border-radius: 2px;
  text-align: center;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.for-touch { display: none; }

@media (hover: none) {
  .for-keyboard { display: none; }
  .for-touch { display: inline; }
}

/* Hover, focus and drag: the placeholders light up like PowerPoint's do */

.screen .dropzone:hover .ph,
.screen .dropzone:focus-visible .ph { border-color: var(--red-pen); }

.screen .dropzone.is-dragging .ph { border-color: var(--red-pen); color: var(--red-pen); }

/* The privacy line sits quietly on the canvas under the slide */
.screen .roaster[data-stage="empty"] .privacy-note {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 3%;
  margin: 0;
  text-align: center;
  font-size: 11px;
  color: #7a7a7a;
  pointer-events: none;
}

.screen .roaster[data-stage="empty"] .privacy-note a { pointer-events: auto; }

/* The roast starts by itself, so the button only shows if it needs a retry */
.screen .roaster[data-stage="roasting"] #roast-btn,
.screen .roaster[data-stage="roasting"] #reset-btn { display: none; }

/* ---- The laptop screen: a plain start screen ---------------------------------
   One obvious button, paste as the shortcut, help for anyone who hasn't taken a
   screenshot before, and an example for anyone who just wants to see it work.
   Overrides the earlier paste-box and blank-slide styling. */

.screen .dropzone.start {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 24px 28px 40px;
  background: #f8f3e8;
  cursor: default;
  font-family: var(--sans);
}

.screen .dropzone.start:hover,
.screen .dropzone.start:focus-visible { background: #f8f3e8; }

.start-title {
  margin: 0 0 18px;
  color: var(--ink);
  font-size: clamp(28px, 3vw, 42px);
  line-height: 1.05;
}

.upload-btn {
  gap: 10px;
  padding: 16px 30px;
  border-radius: 8px;
  font-size: clamp(16px, 1.4vw, 19px);
  box-shadow: 0 3px 0 var(--ember-dark), 0 10px 24px rgba(194, 68, 40, 0.25);
}

.upload-btn svg { width: 20px; height: 20px; }

.start kbd {
  padding: 2px 7px;
  border: 1px solid #cfc5b2;
  border-bottom-width: 2px;
  border-radius: 4px;
  background: #fff;
  font: 600 0.9em/1 var(--sans);
  color: var(--ink);
}

/* Dragging a file over the page turns the whole screen into the target */
.drop-hint {
  position: absolute;
  inset: 10px;
  display: grid;
  place-items: center;
  border: 2.5px dashed var(--red-pen);
  border-radius: 6px;
  background: rgba(248, 243, 232, 0.94);
  color: var(--red-pen);
  font-family: var(--serif);
  font-size: clamp(24px, 2.6vw, 34px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.screen .dropzone.start.is-dragging .drop-hint { opacity: 1; }

/* Touch screens: no keyboard shortcuts, so just the button and the example */
@media (hover: none) {
  .start .for-keyboard { display: none; }
  .start .for-touch { display: inline; }
}

/* One typeface inside the laptop: it's an app screen, not the page */
.start-title {
  font-family: var(--sans);
  font-weight: 600;
  font-size: clamp(24px, 2.4vw, 32px);
  letter-spacing: -0.02em;
}

/* The privacy line lives in the roast panel, not on the start screen */
.screen .roaster[data-stage="empty"] .privacy-note { display: none; }

/* ---- Paste is the main way in, so it leads ------------------------------------ */

.paste-keys {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
}

.start .key {
  display: grid;
  place-items: center;
  min-width: 64px;
  height: 58px;
  padding: 0 18px;
  border: 1px solid #d3c8b3;
  border-radius: 10px;
  background: linear-gradient(180deg, #ffffff, #f1ebde);
  box-shadow: 0 5px 0 #cfc3ac, 0 8px 16px rgba(23, 36, 46, 0.12);
  font: 700 clamp(18px, 1.7vw, 23px)/1 var(--sans);
  color: var(--ink);
  animation: keypress 4s ease-in-out infinite;
}

.start .key-v { min-width: 58px; color: var(--red-pen); }

/* The two keys dip together now and then, like someone pressing them */
@keyframes keypress {
  0%, 82%, 100% { transform: translateY(0); box-shadow: 0 5px 0 #cfc3ac, 0 8px 16px rgba(23, 36, 46, 0.12); }
  87%, 91% { transform: translateY(4px); box-shadow: 0 1px 0 #cfc3ac, 0 3px 6px rgba(23, 36, 46, 0.1); }
}

.plus { color: #8b8578; font: 600 22px var(--sans); }

.paste-label {
  margin: 18px 0 0;
  color: var(--ink);
  font-size: clamp(15px, 1.3vw, 18px);
  font-weight: 600;
}

.start-or {
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(260px, 60%);
  margin: 18px 0 14px;
  color: #9a9384;
  font-size: 13px;
}

.start-or::before,
.start-or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #ddd3c1;
}

/* With a keyboard, upload is the quieter second option */
.upload-btn {
  padding: 11px 22px;
  border: 1.5px solid #cdbfa6;
  background: #fff;
  color: var(--ink);
  font-size: 15px;
  box-shadow: none;
}

.upload-btn:hover { background: #fff; border-color: var(--ink-soft); }

.start-title { margin-bottom: 22px; }

/* Phones have no paste shortcut, so upload goes back to being the big button */
@media (hover: none) {
  .upload-btn {
    padding: 16px 30px;
    border: 0;
    background: var(--ember);
    color: #fff;
    font-size: 17px;
    box-shadow: 0 3px 0 var(--ember-dark), 0 10px 24px rgba(194, 68, 40, 0.25);
  }
}

@media (prefers-reduced-motion: reduce) {
  .start .key { animation: none; }
}

/* ---- Start screen sizing -----------------------------------------------------
   Everything is sized in cqw (1% of the laptop screen's width), so the title,
   keys and button keep the same proportions on any size of laptop, with a
   floor so phones stay readable. */

.screen { container-type: inline-size; }

.screen .dropzone.start { padding: 4cqw 5cqw; }

.start .start-title {
  margin: 2cqw 0 4.4cqw;
  font-size: max(22px, 5.6cqw);
}

.start .paste-keys { gap: 2.2cqw; margin: 0; }

.start .key {
  min-width: max(56px, 12.5cqw);
  height: max(50px, 11cqw);
  padding: 0 3cqw;
  border-radius: max(8px, 1.7cqw);
  font-size: max(18px, 4.3cqw);
}

.start .key-v { min-width: max(50px, 11cqw); }

.start .plus { font-size: max(18px, 3.6cqw); }

.start .paste-label {
  margin: 3.6cqw 0 0;
  font-size: max(15px, 3cqw);
}

.start .start-or {
  width: min(300px, 46cqw);
  margin: 3.4cqw 0 3cqw;
  font-size: max(12px, 2.1cqw);
}

.start .upload-btn {
  gap: 1.4cqw;
  padding: max(10px, 1.9cqw) max(20px, 4cqw);
  font-size: max(14px, 2.6cqw);
}

.start .upload-btn svg { width: max(16px, 3cqw); height: max(16px, 3cqw); }

@media (hover: none) {
  .start .upload-btn { padding: 16px 30px; font-size: 17px; }
}

/* "No slide handy?": a quiet text link under the upload button */
.sample-btn {
  margin-top: max(10px, 2.4cqw);
  padding: 4px 6px;
  border: 0;
  background: none;
  color: #7a7263;
  font: inherit;
  font-size: max(13px, 2cqw);
  text-decoration: underline;
  text-decoration-color: #cdbfa6;
  text-underline-offset: 3px;
  cursor: pointer;
}

.sample-btn:hover { color: var(--ember); text-decoration-color: currentColor; }

.sample-btn:focus-visible { outline: 2px solid var(--ember); outline-offset: 2px; border-radius: 4px; }

/* ---- Phones: keep the home page in proportion ----------------------------------
   Last in the file so it wins over the desktop rules above. */

@media (max-width: 860px) {
  /* A landscape laptop screen, not a tall empty tablet */
  .screen { aspect-ratio: 4 / 3; height: auto; }
  .workspace { padding-top: 36px; }

  /* Small screen with a keyboard: drop the "or" line so the sample link fits */
  .start .start-or { display: none; }
  .start .upload-btn { margin-top: 14px; }
  .sample-btn { margin-top: 4px; }
}
