:root {
  color-scheme: dark;
  --night: #100f12;
  --panel: #18161b;
  --panel-light: #211e25;
  --ink: #f4eee7;
  --muted: #b9aeb8;
  --green: #79b86b;
  --green-dark: #3f7548;
  --pink: #ef739e;
  --yellow: #f0c75e;
  --accent: #f08b6f;
  --line: #514852;
  --focus: #8fc5ff;
  font-family: Consolas, "Courier New", monospace;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-width: 320px; }

body {
  min-width: 320px;
  min-height: 100dvh;
  margin: 0;
  background: var(--night);
  color: var(--ink);
}

button { font: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; }

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

.skip-link {
  position: fixed;
  z-index: 20;
  top: 10px;
  left: 10px;
  transform: translateY(-160%);
  padding: 10px 14px;
  background: var(--ink);
  color: var(--night);
}

.skip-link:focus { transform: translateY(0); }

main {
  display: grid;
  min-height: 100dvh;
  place-items: center;
  padding: clamp(12px, 3vw, 42px);
}

.terminal {
  width: min(1180px, 100%);
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.48);
}

.terminal-bar,
.terminal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-width: 0;
  padding: 13px clamp(14px, 2.5vw, 28px);
  background: var(--panel-light);
}

.terminal-bar { border-bottom: 1px solid var(--line); }
.terminal-footer { border-top: 1px solid var(--line); }

.file-name {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 5px;
}

.prompt-mark { color: var(--green); font-weight: 700; }

h1 {
  overflow: hidden;
  margin: 0;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compile-status {
  flex: 0 0 auto;
  color: var(--green);
  font-size: 0.74rem;
}

.compile-status::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 7px;
  border-radius: 50%;
  background: currentColor;
}

.terminal-output {
  position: relative;
  min-height: clamp(560px, 72vh, 760px);
  padding: clamp(20px, 3vw, 38px);
  background: linear-gradient(rgba(255,255,255,0.018) 1px, transparent 1px) 0 0 / 100% 4px, var(--panel);
}

.command-line {
  position: relative;
  z-index: 2;
  color: var(--muted);
  font-size: clamp(0.74rem, 1.2vw, 0.9rem);
  white-space: nowrap;
}

.prompt { color: var(--green); }
.path { color: var(--focus); }
.command { color: var(--ink); }

.cursor {
  display: inline-block;
  width: 0.55em;
  height: 1.05em;
  margin-left: 3px;
  background: var(--ink);
  vertical-align: -0.16em;
}

.art-frame {
  display: grid;
  min-height: 500px;
  place-items: end center;
  padding-top: clamp(24px, 4vh, 50px);
}

.bouquet-art {
  width: max-content;
  max-width: 100%;
  margin: 0;
  color: var(--ink);
  font-family: Consolas, "Courier New", monospace;
  font-size: clamp(6px, 1.3vw, 15px);
  font-weight: 700;
  line-height: 1.03;
  letter-spacing: 0;
  white-space: pre;
  user-select: none;
}

.cell {
  display: inline-block;
  min-width: 0.6em;
  opacity: 1;
  transform-origin: 50% 100%;
}

.cell.green { color: var(--green); }
.cell.green-dark { color: var(--green-dark); }
.cell.pink { color: var(--pink); }
.cell.yellow { color: var(--yellow); }
.cell.accent { color: var(--accent); }
.cell.ink { color: var(--ink); }

.bouquet-art.growing .cell {
  animation: grow-cell 520ms cubic-bezier(0.16, 0.74, 0.22, 1) both;
  animation-delay: var(--delay);
}

.dedication {
  position: absolute;
  right: clamp(18px, 4vw, 58px);
  bottom: clamp(22px, 4vw, 46px);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  max-width: 300px;
  padding: 14px 17px;
  border: 1px solid var(--line);
  background: rgba(16, 15, 18, 0.9);
}

.dedication p {
  margin: 0;
  color: var(--muted);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(0.9rem, 1.5vw, 1.08rem);
  font-style: italic;
  line-height: 1.45;
}

.comment-mark { color: var(--green); font-weight: 700; }

.terminal-footer p {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.5;
}

.controls { display: flex; flex: 0 0 auto; gap: 9px; }

.quiet-button,
.run-button {
  min-height: 44px;
  border-radius: 3px;
  padding: 9px 14px;
  font-weight: 700;
  transition: background-color 140ms ease, color 140ms ease, transform 80ms ease;
}

.quiet-button { border: 1px solid var(--green); background: transparent; color: var(--green); }
.quiet-button:hover:not(:disabled) { background: var(--green); color: var(--night); }
.run-button { border: 1px solid var(--accent); background: var(--accent); color: var(--night); }
.run-button span { margin-right: 5px; font-size: 0.75em; }
.run-button:hover:not(:disabled) { background: #ffad8f; border-color: #ffad8f; }
.quiet-button:active:not(:disabled), .run-button:active:not(:disabled) { transform: translateY(2px); }
.quiet-button:disabled, .run-button:disabled { border-color: #827985; background: transparent; color: #a39aa5; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

@keyframes grow-cell {
  from { opacity: 0; transform: translateY(7px) scale(0.72); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (prefers-reduced-motion: no-preference) {
  .cursor { animation: blink 900ms steps(1) 4; }
  @keyframes blink { 50% { opacity: 0; } }
}

@media (prefers-reduced-motion: reduce) {
  .bouquet-art.growing .cell { animation: none; }
}

@media (max-width: 720px) {
  main { align-items: start; padding: 0; }
  .terminal { min-height: 100dvh; border: 0; border-radius: 0; box-shadow: none; }
  .terminal-output { min-height: 650px; padding-inline: 10px; }
  .art-frame { min-height: 500px; overflow: hidden; }
  .bouquet-art { font-size: clamp(5px, 1.45vw, 9px); }
  .dedication { right: 14px; bottom: 16px; max-width: 245px; }
  .terminal-footer { align-items: stretch; flex-direction: column; }
  .controls { display: grid; grid-template-columns: 1fr 1fr; }
}

@media (max-width: 390px) {
  .compile-status { font-size: 0; }
  .compile-status::before { margin-right: 0; }
  .terminal-output { min-height: 610px; }
  .art-frame { min-height: 465px; }
  .dedication { max-width: 220px; }
  .dedication p { font-size: 0.86rem; }
  .terminal-footer p { text-align: center; }
}

