/**
 * Global styles
 */

:root {
  color-scheme: light dark;
  --bg: #f6f7fb;
  --bg-accent: #e9ecf5;
  --terminal-bg: #fdfdfd;
  --terminal-border: rgba(10, 12, 16, 0.12);
  --terminal-shadow: 0 24px 60px rgba(17, 19, 25, 0.22);
  --titlebar: #eceef4;
  --titlebar-text: #4c4f5a;
  --text: #111218;
  --muted: #6b7280;
  --prompt: #1f2937;
  --accent: #111827;
  --glow: rgba(0, 0, 0, 0.08);
  --clock: #0b0d12;
  --clock-shadow: rgba(17, 24, 39, 0.12);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0b10;
    --bg-accent: #10131c;
    --terminal-bg: #11131a;
    --terminal-border: rgba(255, 255, 255, 0.08);
    --terminal-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
    --titlebar: #1a1d27;
    --titlebar-text: #cbd5f5;
    --text: #f8fafc;
    --muted: #9aa3b2;
    --prompt: #d5d9e5;
    --accent: #e5e7eb;
    --glow: rgba(59, 130, 246, 0.12);
    --clock: #e2e8f0;
    --clock-shadow: rgba(15, 23, 42, 0.6);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  padding: 0;
  margin: 0;
  min-height: 100%;
  font-family: "SF Mono", Menlo, Monaco, "Cascadia Mono", "Fira Code", monospace;
  background: radial-gradient(circle at top, var(--bg-accent), var(--bg));
  color: var(--text);
}

body {
  display: block;
  padding: 0;
}

main#main-content {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

body {
  grid-template-rows: 1fr auto;
}

.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: #000;
  color: #fff;
  padding: 8px;
  z-index: 100;
}

.skip-link:focus {
  top: 0;
}

.app {
  width: 100%;
  max-width: 1200px;
}

.terminal {
  border-radius: 28px;
  border: 1px solid var(--terminal-border);
  background: var(--terminal-bg);
  box-shadow: var(--terminal-shadow);
  overflow: hidden;
  backdrop-filter: blur(12px);
  container-type: inline-size;
}

.terminal__screen {
  --term-font: min(clamp(16px, 4.2vw, 36px), calc(100cqw / 14));
  font-size: var(--term-font);
}

.terminal__titlebar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 22px;
  background: linear-gradient(180deg, var(--titlebar), rgba(0, 0, 0, 0));
  border-bottom: 1px solid var(--terminal-border);
  color: var(--titlebar-text);
  font-size: inherit;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.terminal__title {
  font-weight: 600;
}

.terminal__spacer {
  flex: 1;
}

.traffic-lights {
  display: flex;
  gap: 8px;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2);
}

.dot--red {
  background: #ff5f57;
}

.dot--yellow {
  background: #febc2e;
}

.dot--green {
  background: #28c840;
}

.terminal__screen {
  padding: 48px clamp(24px, 6vw, 72px) 56px;
  display: grid;
  gap: 24px;
}

.prompt {
  display: flex;
  gap: 12px;
  align-items: center;
  color: var(--prompt);
  font-size: inherit;
  opacity: 0.8;
  flex-wrap: wrap;
}

.prompt__glyph {
  color: var(--accent);
}

.prompt__label {
  min-height: 1em;
}

.prompt__cursor {
  display: inline-block;
  width: 1ch;
  animation: blink 1s steps(2, start) infinite;
}

.prompt__cursor.is-hidden {
  display: none;
}

.clock {
  font-size: inherit;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--clock);
  text-shadow: 0 8px 30px var(--clock-shadow);
  display: flex;
  flex-wrap: nowrap;
  white-space: nowrap;
  align-items: flex-start;
}

.clock--hidden {
  visibility: hidden;
}

.clock__field {
  position: relative;
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: 0;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease, color 160ms ease;
  outline: none;
  display: inline-flex;
  min-width: 2ch;
  justify-content: center;
}

.clock__sep {
  display: inline-block;
  width: 1ch;
}

.clock__field::after {
  content: attr(data-label);
  position: absolute;
  left: 50%;
  top: calc(100% + 10px);
  transform: translateX(-50%) translateY(-6px);
  background: rgba(17, 24, 39, 0.92);
  color: #f8fafc;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.clock__field:hover,
.clock__field:focus {
  transform: translateY(-2px);
  box-shadow: none;
}

.clock__field:focus-visible {
  outline: 2px solid rgba(59, 130, 246, 0.8);
  outline-offset: 2px;
}

.clock__field:hover::after,
.clock__field:focus::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.clock__field:hover,
.clock__field:focus {
  background: var(--clock);
  color: var(--terminal-bg);
}

@media (prefers-color-scheme: dark) {
  .clock__field:hover,
  .clock__field:focus {
    background: var(--clock);
    color: var(--terminal-bg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .clock__field,
  .clock__field::after {
    transition: none;
  }
  .prompt__cursor {
    animation: none;
  }
}

@keyframes blink {
  0%,
  49% {
    opacity: 1;
  }
  50%,
  100% {
    opacity: 0;
  }
}

.hint {
  font-size: inherit;
  color: var(--muted);
  opacity: 0.75;
}

@media (max-width: 600px) {
  .terminal__screen {
    padding: 32px 20px 36px;
  }

  .terminal__titlebar {
    padding: 12px 16px;
    font-size: inherit;
  }
}
.site-footer {
  width: min(1000px, 100%);
  margin: 0 auto 32px;
  padding: 0 24px 24px;
  display: grid;
  gap: 24px;
  justify-items: center;
  text-align: center;
  color: var(--muted);
}

.footer-license {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  justify-content: center;
  font-size: 0.95em;
}

.footer-break {
  flex-basis: 100%;
  height: 0;
}

.footer-link {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 2px;
}

.cc-icons {
  display: inline-flex;
  gap: 8px;
  margin-left: 6px;
}

.cc-icons svg {
  width: 22px;
  height: 22px;
}

.footer-badge img {
  display: block;
  max-width: 220px;
  width: 100%;
  height: auto;
}