:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, sans-serif;
  background: #f6f1e4;
  color: #1d1f1e;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 20rem;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  user-select: none;
  background-color: #f6f1e4;
  background-image: radial-gradient(rgb(29 31 30 / 16%) 0.75px, transparent 0.75px);
  background-size: 18px 18px;
}

.page {
  width: min(58rem, calc(100% - 2rem));
  margin: 0 auto;
  padding:
    clamp(2.5rem, 7vw, 5rem)
    0
    calc(2rem + env(safe-area-inset-bottom));
}

.intro {
  position: relative;
  margin-bottom: 2rem;
}

.eyebrow {
  display: inline-block;
  margin: 0 0 1rem;
  border: 2px solid #1d1f1e;
  border-radius: 999px;
  padding: 0.4rem 0.7rem;
  background: #f7c843;
  box-shadow: 3px 3px 0 #1d1f1e;
  font: 700 0.7rem/1 ui-monospace, SFMono-Regular, Consolas, monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2.6rem, 8vw, 5rem);
  font-weight: 800;
  letter-spacing: -0.065em;
  line-height: 0.95;
}

.product-name {
  color: #1d1f1e;
}

.shell-suffix {
  color: #f7c843;
  -webkit-text-stroke: 1px #1d1f1e;
  paint-order: stroke fill;
}

h1::after {
  color: #f05a28;
  content: "_";
}

.byline {
  margin: 0.75rem 0 0;
  font: 750 0.95rem/1.3 ui-monospace, SFMono-Regular, Consolas, monospace;
}

.summary {
  max-width: 42rem;
  margin: 1.25rem 0 0;
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  font-weight: 520;
  line-height: 1.6;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1.25rem;
}

.tags span {
  border: 1.5px solid #1d1f1e;
  border-radius: 0.25rem;
  padding: 0.35rem 0.55rem;
  background: #fffdf7;
  font: 650 0.72rem/1 ui-monospace, SFMono-Regular, Consolas, monospace;
}

.tags span:nth-child(2) {
  background: #ffd6c5;
}

.tags span:nth-child(3) {
  background: #d9edda;
}

.tags span:nth-child(4) {
  background: #dce8ff;
}

.tags span:nth-child(5) {
  background: #eadfff;
}

.tags span:nth-child(6) {
  background: #ead6bd;
}

.engine-note {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
  font: 0.72rem/1.45 ui-monospace, SFMono-Regular, Consolas, monospace;
}

.engine-note span {
  display: grid;
}

.engine-note strong {
  font-size: 0.78rem;
}

.profile-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: 0.85rem;
}

.profile-links a {
  border-bottom: 2px solid #1d1f1e;
  color: inherit;
  font-size: 0.82rem;
  font-weight: 800;
  text-decoration: none;
}

.contact-action {
  border: 0;
  border-bottom: 2px solid #1d1f1e;
  padding: 0;
  cursor: pointer;
  background: transparent;
  color: inherit;
  font: 800 0.82rem/1.45 ui-monospace, SFMono-Regular, Consolas, monospace;
}

.profile-links a:hover,
.profile-links a:focus-visible,
.contact-action:hover,
.contact-action:focus-visible {
  border-color: #f05a28;
  color: #f05a28;
}

.terminal {
  width: 100%;
  overflow: hidden;
  border: 3px solid #1d1f1e;
  border-radius: 0.55rem;
  background: #171918;
  box-shadow: 0 1rem 2.5rem rgb(29 31 30 / 18%);
}

.terminal-bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 3rem;
  padding: 0 0.9rem;
  border-bottom: 3px solid #1d1f1e;
  background: #f7c843;
  color: #1d1f1e;
  font: 700 0.72rem/1 ui-monospace, SFMono-Regular, Consolas, monospace;
}

.window-controls {
  display: flex;
  gap: 0.4rem;
}

.window-controls span {
  width: 0.72rem;
  height: 0.72rem;
  border: 1.5px solid #1d1f1e;
  border-radius: 50%;
  background: #fffdf7;
}

.window-controls span:first-child {
  background: #f05a28;
}

.window-controls span:nth-child(2) {
  background: #fff3a6;
}

.window-controls span:last-child {
  background: #73c991;
}

.terminal-title {
  white-space: nowrap;
}

.service-statuses {
  display: flex;
  justify-self: end;
  align-items: center;
  gap: 0.4rem;
}

.status,
.service-status {
  justify-self: end;
  border: 1.5px solid #1d1f1e;
  border-radius: 999px;
  padding: 0.3rem 0.5rem;
  background: #fffdf7;
}

.status::before,
.service-status::before {
  display: inline-block;
  width: 0.45rem;
  height: 0.45rem;
  margin-right: 0.35rem;
  border: 1px solid #1d1f1e;
  border-radius: 50%;
  background: #969b96;
  content: "";
}

.status[data-state="online"]::before,
.service-status[data-state="online"]::before {
  background: #73c991;
}

.status[data-state="unavailable"]::before,
.service-status[data-state="unavailable"]::before {
  background: #f05a28;
}

.terminal-body {
  min-height: 30rem;
  padding: clamp(1rem, 3vw, 1.5rem);
  color: #e9eee9;
  font: 0.9rem/1.65 ui-monospace, SFMono-Regular, Consolas, monospace;
}

#output {
  max-height: 55svh;
  margin: 0 0 1rem;
  overflow-y: auto;
  color: #dfe7df;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  scrollbar-color: #59615b #171918;
  user-select: text;
}

.quick-command-drawer {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.65rem;
}

.quick-command-toggle {
  min-height: 1.9rem;
  appearance: none;
  border: 1px solid #59615b;
  border-radius: 999px;
  padding: 0.25rem 0.6rem;
  cursor: pointer;
  background: #202321;
  color: #c8d0ca;
  font: 700 0.65rem/1 ui-monospace, SFMono-Regular, Consolas, monospace;
}

.quick-command-toggle::after {
  display: inline-block;
  margin-left: 0.35rem;
  content: "+";
  transition: transform 150ms ease;
}

.quick-command-toggle:hover,
.quick-command-toggle:focus-visible {
  border-color: #f7c843;
  color: #f7c843;
}

.quick-command-toggle[aria-expanded="true"]::after {
  transform: rotate(45deg);
}

.quick-commands {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.quick-commands[hidden] {
  display: none;
}

.quick-commands button,
.touch-actions button {
  min-height: 1.9rem;
  appearance: none;
  border: 1px solid #6a726c;
  border-radius: 999px;
  padding: 0.25rem 0.55rem;
  cursor: pointer;
  background: #252927;
  color: #e9eee9;
  font: 700 0.65rem/1 ui-monospace, SFMono-Regular, Consolas, monospace;
}

.quick-commands button:hover,
.quick-commands button:focus-visible,
.touch-actions button:hover,
.touch-actions button:focus-visible {
  border-color: #f7c843;
  color: #f7c843;
}

.quick-commands button:disabled,
.touch-actions button:disabled {
  cursor: wait;
  opacity: 0.5;
}

.touch-actions button {
  min-height: 2.75rem;
  border-radius: 0.3rem;
  padding: 0.45rem 0.65rem;
  font-size: 0.72rem;
}

#command-form {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 2.75rem;
  border-top: 1px dashed #535a55;
  padding-top: 1rem;
}

#command-form label {
  flex: none;
  color: #f7c843;
  font-weight: 750;
}

#command {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  padding: 0;
  cursor: text;
  user-select: text;
  background: transparent;
  color: #fffdf7;
  caret-color: #ff6a33;
  caret-animation: manual;
  font: inherit;
}

#command:focus {
  text-shadow: 0 0 0.65rem rgb(247 200 67 / 28%);
}

.touch-actions {
  display: none;
  gap: 0.4rem;
}

.request-status {
  min-height: 1.25rem;
  margin: 0.55rem 0 0;
  color: #aeb8b0;
  font: 0.72rem/1.4 ui-monospace, SFMono-Regular, Consolas, monospace;
}

.next-command {
  min-height: 2rem;
  border: 0;
  padding: 0;
  cursor: pointer;
  background: transparent;
  color: #f7c843;
  font: 700 0.72rem/1.4 ui-monospace, SFMono-Regular, Consolas, monospace;
  text-align: left;
}

.next-command:hover,
.next-command:focus-visible {
  color: #fff3a6;
  text-decoration: underline;
  text-underline-offset: 0.2rem;
}

.next-command:disabled {
  cursor: wait;
  opacity: 0.5;
}

.next-command[hidden] {
  display: none;
}

.hint {
  display: table;
  margin: 1.2rem 0 0 auto;
  border: 1.5px solid #1d1f1e;
  padding: 0.4rem 0.6rem;
  background: #fffdf7;
  box-shadow: 3px 3px 0 #1d1f1e;
  font: 700 0.7rem/1.4 ui-monospace, SFMono-Regular, Consolas, monospace;
}

.touch-hint {
  display: none;
  margin: 1rem 0 0;
  color: #59615b;
  font: 700 0.72rem/1.4 ui-monospace, SFMono-Regular, Consolas, monospace;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (max-width: 36rem) {
  .page {
    width: min(100% - 1rem, 58rem);
    padding-top: calc(1.5rem + env(safe-area-inset-top));
  }

  h1 {
    font-size: clamp(2.35rem, 13vw, 3.4rem);
    overflow-wrap: anywhere;
  }

  .summary {
    line-height: 1.5;
  }

  .terminal-bar {
    grid-template-columns: 1fr auto;
  }

  .terminal-title {
    display: none;
  }

  #output {
    max-height: 52svh;
  }

  .terminal-body {
    min-height: 25rem;
    font-size: 0.82rem;
  }

  #command {
    font-size: 1rem;
  }

  .hint {
    margin-left: 0;
  }

  .engine-note {
    align-items: start;
    flex-direction: column;
  }

  .profile-links {
    justify-content: start;
  }

}

@media (pointer: coarse) {
  .touch-actions {
    display: flex;
  }

  .quick-command-toggle,
  .quick-commands button {
    min-height: 2.75rem;
    padding: 0.55rem 0.75rem;
  }

  .hint {
    display: none;
  }

  .touch-hint {
    display: block;
  }
}

@media (max-width: 36rem) {
  .quick-commands {
    flex: 1 1 100%;
  }
}

@media (max-width: 22rem) {
  .page {
    width: calc(100% - 0.75rem);
  }

  h1 {
    font-size: 2.15rem;
  }

  .tags {
    gap: 0.4rem;
  }

  .tags span {
    font-size: 0.65rem;
  }

  .terminal-body {
    min-height: 23rem;
    padding: 0.85rem;
  }

  #status {
    display: none;
  }

  #command-form {
    gap: 0.4rem;
  }
}

@media (max-height: 35rem) and (orientation: landscape) {
  .page {
    padding-top: 1rem;
  }

  .intro {
    margin-bottom: 1rem;
  }

  .summary,
  .tags {
    margin-top: 0.7rem;
  }

  #output {
    max-height: 38svh;
  }

  .terminal-body {
    min-height: 14rem;
  }
}

@media (prefers-reduced-motion: no-preference) {
  h1::after {
    animation: blink 1.1s steps(1) infinite;
  }
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}
