:root {
  color-scheme: light;
  --paper: #fbfbf7;
  --mist: #ecfff4;
  --ice: #e9fbff;
  --ink: #101411;
  --muted: #59615d;
  --faint: #d8ddd8;
  --line: #151a17;
  --mint: #99f3cd;
  --sea: #69d8d8;
  --sky: #9ddcff;
  --lemon: #eaff8f;
  --rose: #ffb4ac;
  --warning: #fb6f74;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--paper);
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(202, 255, 220, 0.34), transparent 26%),
    linear-gradient(180deg, #ffffff 0%, #fbfbf7 48%, #f6fff8 100%);
  color: var(--ink);
  font-family: Avenir Next, Avenir, Montserrat, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

.page {
  min-height: 100vh;
}

.hero {
  width: min(1560px, calc(100vw - 48px));
  min-height: min(780px, 82vh);
  margin: 32px auto 0;
  padding: 30px;
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr;
  border: 2px solid var(--line);
  border-radius: 28px;
  background:
    linear-gradient(135deg, rgba(236, 255, 244, 0.96) 0%, rgba(238, 252, 255, 0.96) 58%, rgba(255, 253, 232, 0.9) 100%);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(var(--faint) 1px, transparent 1px),
    linear-gradient(90deg, var(--faint) 1px, transparent 1px);
  background-size: 88px 88px;
  opacity: 0.38;
  mask-image: linear-gradient(120deg, transparent 0%, rgba(0, 0, 0, 0.75) 42%, transparent 100%);
}

.topbar,
.hero-inner,
.workspace {
  position: relative;
  z-index: 1;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  color: var(--ink);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background:
    radial-gradient(circle at 72% 24%, rgba(255, 255, 255, 0.68), transparent 28%),
    linear-gradient(145deg, rgba(234, 255, 143, 0.82), rgba(153, 243, 205, 0.66));
  box-shadow: 4px 4px 0 rgba(105, 216, 216, 0.18);
  display: grid;
  place-items: center;
  position: relative;
  flex: 0 0 auto;
}

.brand-play,
.brand-caption {
  position: absolute;
  display: block;
  background: var(--line);
}

.brand-play {
  left: 15px;
  top: 8px;
  width: 12px;
  height: 13px;
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}

.brand-caption {
  left: 12px;
  right: 12px;
  height: 3px;
  border-radius: 999px;
}

.caption-one {
  bottom: 12px;
}

.caption-two {
  bottom: 7px;
  right: 20px;
}

.brand-wordmark {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
}

.brand strong {
  font-size: clamp(1.08rem, 1.65vw, 1.48rem);
  line-height: 1;
  font-weight: 620;
  letter-spacing: 0;
}

.brand strong:last-child {
  color: #3f4a43;
  font-weight: 430;
}

.runtime {
  min-height: 46px;
  border: 2px solid var(--line);
  border-radius: 10px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 650;
  white-space: nowrap;
}

.runtime-dot {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: var(--mint);
  border: 1px solid var(--line);
}

.runtime-hosted .runtime-dot {
  background: var(--rose);
}

.runtime-tunnel .runtime-dot {
  background: var(--sea);
}

.hero-inner {
  align-self: center;
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(320px, 0.72fr);
  grid-template-areas:
    "copy art"
    "form art"
    "note art";
  column-gap: clamp(28px, 6vw, 110px);
  row-gap: 32px;
  padding: clamp(56px, 8vw, 116px) clamp(20px, 5vw, 112px) clamp(28px, 5vw, 64px);
}

.hero-copy {
  grid-area: copy;
  max-width: 820px;
}

.kicker,
.result-label {
  margin: 0 0 24px;
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.92rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.kicker span,
.result-label span {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 12px;
  border-radius: 2px;
  background: var(--line);
  vertical-align: -1px;
}

h1,
h2,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  max-width: 760px;
  color: var(--ink);
  font-size: clamp(4rem, 7vw, 7.6rem);
  line-height: 0.98;
  font-weight: 330;
  letter-spacing: 0;
}

.subhead {
  margin: 28px 0 0;
  max-width: 690px;
  color: var(--ink);
  font-size: clamp(1.28rem, 2.2vw, 2rem);
  line-height: 1.35;
  font-weight: 360;
}

.hero-art {
  grid-area: art;
  min-height: clamp(440px, 54vw, 620px);
  position: relative;
  align-self: center;
  border: 2px solid var(--line);
  border-radius: 24px;
  background:
    linear-gradient(var(--faint) 1px, transparent 1px),
    linear-gradient(90deg, var(--faint) 1px, transparent 1px),
    linear-gradient(160deg, rgba(255, 255, 255, 0.44), rgba(205, 252, 240, 0.4));
  background-size: 64px 64px, 64px 64px, auto;
  overflow: hidden;
}

.video-card,
.markdown-card {
  position: absolute;
  border: 2px solid var(--line);
  background: rgba(255, 255, 255, 0.74);
  box-shadow: 18px 20px 0 rgba(105, 216, 216, 0.18);
}

.video-card {
  left: 8%;
  top: 28%;
  width: 50%;
  min-width: 210px;
  max-width: 360px;
  aspect-ratio: 16 / 9;
  border-radius: 18px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(157, 220, 255, 0.62), rgba(153, 243, 205, 0.5)),
    rgba(255, 255, 255, 0.68);
}

.video-topline {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 24px;
  border-bottom: 2px solid rgba(21, 26, 23, 0.16);
  background: rgba(255, 255, 255, 0.44);
}

.play-disc {
  position: absolute;
  left: 50%;
  top: 48%;
  width: 74px;
  height: 74px;
  border: 2px solid var(--line);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: rgba(255, 255, 255, 0.74);
  display: grid;
  place-items: center;
}

.play-disc span {
  display: block;
  width: 24px;
  height: 28px;
  margin-left: 5px;
  background: var(--line);
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}

.caption-bar {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 18px;
  display: grid;
  gap: 7px;
}

.caption-bar span,
.caption-flow span,
.markdown-line {
  display: block;
  height: 8px;
  border-radius: 999px;
  background: var(--line);
}

.caption-bar span {
  background: rgba(16, 20, 17, 0.72);
}

.caption-bar span:last-child {
  width: 68%;
}

.caption-flow {
  position: absolute;
  left: 45%;
  right: 24%;
  top: 40%;
  display: grid;
  gap: 16px;
}

.caption-flow span {
  height: 14px;
  background: rgba(105, 216, 216, 0.82);
  box-shadow: 12px 12px 0 rgba(234, 255, 143, 0.28);
}

.caption-flow span:nth-child(2) {
  width: 74%;
  margin-left: 18%;
  background: rgba(157, 220, 255, 0.84);
}

.caption-flow span:nth-child(3) {
  width: 88%;
  background: rgba(153, 243, 205, 0.84);
}

.markdown-card {
  right: 7%;
  top: 52%;
  bottom: auto;
  width: 36%;
  min-width: 180px;
  max-width: 290px;
  min-height: 220px;
  border-radius: 16px;
  padding: 26px 22px;
  display: grid;
  align-content: start;
  gap: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(234, 255, 143, 0.34)),
    rgba(255, 255, 255, 0.74);
  box-shadow: 18px 20px 0 rgba(153, 243, 205, 0.28);
}

.markdown-card::before {
  content: "#";
  position: absolute;
  right: 18px;
  top: 14px;
  color: rgba(21, 26, 23, 0.13);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 5rem;
  font-weight: 800;
  line-height: 1;
}

.markdown-badge {
  width: max-content;
  border: 2px solid var(--line);
  border-radius: 8px;
  padding: 6px 10px;
  background: var(--lemon);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.markdown-line {
  position: relative;
  z-index: 1;
  height: 10px;
  background: rgba(21, 26, 23, 0.72);
}

.line-long {
  width: 92%;
}

.line-short {
  width: 56%;
}

.search-form {
  grid-area: form;
  width: 100%;
  max-width: 880px;
}

.search-form label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
}

input {
  min-width: 0;
  min-height: 70px;
  border: 2px solid var(--line);
  border-radius: 14px 0 0 14px;
  padding: 0 24px;
  background: rgba(255, 255, 255, 0.66);
  color: var(--ink);
  font-size: clamp(1rem, 1.6vw, 1.28rem);
  outline: none;
}

input::placeholder {
  color: #7f8783;
}

input:focus {
  background: #ffffff;
  box-shadow: inset 0 0 0 3px rgba(153, 243, 205, 0.62);
}

button {
  min-height: 54px;
  border: 2px solid var(--line);
  border-radius: 12px;
  padding: 0 24px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.96rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  text-align: center;
  white-space: nowrap;
  transition: background 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.search-row button {
  min-height: 70px;
  margin-left: -2px;
  border-radius: 0 14px 14px 0;
  background: #ffffff;
}

button:hover {
  background: var(--lemon);
  transform: translateY(-1px);
  box-shadow: 0 12px 30px rgba(52, 95, 78, 0.12);
}

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

.runtime-note {
  grid-area: note;
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 10px 14px;
  color: var(--muted);
  font-size: 1rem;
}

.runtime-note > div {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.runtime-note strong {
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.92rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.proxy-note {
  border: 1.5px solid var(--line);
  border-radius: 9px;
  padding: 7px 10px;
  background: rgba(255, 255, 255, 0.56);
}

.proxy-note span {
  color: var(--ink);
}

.proxy-none {
  background: rgba(255, 180, 172, 0.26);
}

.proxy-webshare,
.proxy-generic,
.relay-note {
  background: rgba(153, 243, 205, 0.32);
}

.workspace {
  width: min(1180px, calc(100vw - 48px));
  margin: 28px auto 0;
  padding-bottom: 72px;
}

.empty-state,
.result-panel,
.notice {
  border: 2px solid var(--faint);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.78);
}

.empty-state {
  min-height: 170px;
  padding: 34px 42px;
  display: flex;
  align-items: center;
}

.empty-state strong {
  display: block;
  font-size: clamp(1.7rem, 3vw, 3rem);
  font-weight: 360;
  line-height: 1.08;
}

.empty-state p,
.notice p,
.result-heading p {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.notice {
  margin-bottom: 20px;
  padding: 26px 30px;
  border-color: rgba(251, 111, 116, 0.48);
  background: #fff8f6;
}

.notice strong {
  color: #a63739;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.result-panel {
  overflow: hidden;
}

.result-heading {
  padding: 34px 38px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: start;
  border-bottom: 2px solid var(--faint);
}

.result-heading h2 {
  margin: 0;
  max-width: 780px;
  font-size: clamp(2rem, 4vw, 4.5rem);
  line-height: 1.03;
  font-weight: 340;
  letter-spacing: 0;
}

.result-heading code {
  color: #39745d;
  overflow-wrap: anywhere;
}

.result-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.ghost {
  background: #f8fbf8;
}

textarea {
  width: 100%;
  min-height: 480px;
  border: 0;
  padding: 34px 38px;
  resize: vertical;
  background:
    linear-gradient(var(--faint) 1px, transparent 1px),
    linear-gradient(90deg, var(--faint) 1px, transparent 1px),
    linear-gradient(180deg, rgba(251, 255, 252, 0.92), rgba(239, 252, 255, 0.78));
  background-size: 52px 52px, 52px 52px, auto;
  color: var(--ink);
  font: 0.95rem/1.66 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

@media (max-width: 1020px) {
  .hero-inner {
    grid-template-columns: 1fr;
    grid-template-areas:
      "copy"
      "art"
      "form"
      "note";
    padding: 52px 12px 26px;
  }

  .hero-art {
    min-height: 320px;
    align-self: stretch;
  }

  .video-card {
    left: 7%;
    top: 18%;
    width: 54%;
    max-width: none;
  }

  .caption-flow {
    left: 47%;
    right: 29%;
    top: 34%;
  }

  .markdown-card {
    top: auto;
    right: 5%;
    bottom: 12%;
    width: 38%;
    max-width: none;
    min-height: 180px;
  }
}

@media (max-width: 720px) {
  .hero,
  .workspace {
    width: min(100vw - 24px, 1180px);
  }

  .hero {
    min-height: auto;
    margin-top: 12px;
    padding: 14px;
    border-radius: 20px;
  }

  .topbar {
    align-items: flex-start;
  }

  .brand {
    min-height: 40px;
    gap: 9px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 12px;
  }

  .brand-play {
    left: 13px;
    top: 7px;
    width: 10px;
    height: 11px;
  }

  .brand-caption {
    left: 10px;
    right: 10px;
  }

  .caption-one {
    bottom: 10px;
  }

  .caption-two {
    bottom: 6px;
    right: 17px;
  }

  .brand strong {
    font-size: 0.98rem;
  }

  .runtime {
    min-height: 40px;
    padding: 0 12px;
    font-size: 0.8rem;
  }

  .hero-inner {
    row-gap: 24px;
    padding-top: 44px;
  }

  .kicker,
  .result-label {
    margin-bottom: 18px;
    font-size: 0.78rem;
  }

  h1 {
    font-size: clamp(3.2rem, 14vw, 5.4rem);
    overflow-wrap: normal;
  }

  .subhead {
    font-size: 1.16rem;
  }

  .hero-art {
    min-height: 220px;
  }

  .video-card {
    left: 7%;
    top: 18%;
    width: 54%;
    min-width: 0;
    max-width: none;
    border-radius: 14px;
  }

  .video-topline {
    height: 18px;
  }

  .play-disc {
    width: 46px;
    height: 46px;
  }

  .play-disc span {
    width: 15px;
    height: 18px;
  }

  .caption-bar {
    left: 12px;
    right: 12px;
    bottom: 11px;
    gap: 5px;
  }

  .caption-bar span,
  .caption-flow span {
    height: 6px;
  }

  .caption-flow {
    left: 47%;
    right: 29%;
    top: 34%;
    gap: 9px;
  }

  .markdown-card {
    top: auto;
    right: 5%;
    bottom: 12%;
    width: 38%;
    min-width: 0;
    max-width: none;
    min-height: 138px;
    padding: 16px 12px;
    gap: 10px;
    border-radius: 12px;
    box-shadow: 10px 12px 0 rgba(153, 243, 205, 0.24);
  }

  .markdown-card::before {
    right: 10px;
    top: 8px;
    font-size: 3.1rem;
  }

  .markdown-badge {
    padding: 4px 7px;
    font-size: 0.68rem;
  }

  .markdown-line {
    height: 7px;
  }

  .search-row {
    grid-template-columns: 1fr;
  }

  input,
  .search-row button {
    min-height: 62px;
    margin-left: 0;
    border-radius: 12px;
  }

  .search-row button {
    margin-top: -2px;
  }

  .runtime-note {
    display: grid;
    gap: 4px;
  }

  .runtime-note > div {
    display: grid;
    gap: 4px;
  }

  .workspace {
    margin-top: 16px;
    padding-bottom: 44px;
  }

  .empty-state,
  .notice {
    padding: 26px 22px;
  }

  .result-heading {
    grid-template-columns: 1fr;
    padding: 26px 22px;
  }

  .result-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .result-actions button {
    width: 100%;
    padding: 0 12px;
  }

  textarea {
    min-height: 390px;
    padding: 22px;
    font-size: 0.84rem;
  }
}

@media (max-width: 430px) {
  .brand strong:last-child {
    display: none;
  }

  .runtime span:last-child {
    max-width: 70px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
