:root {
  color-scheme: light;
  --paper: #f4efe5;
  --ink: #161411;
  --muted: #777067;
  --line: rgba(22, 20, 17, 0.18);
  --line-strong: rgba(22, 20, 17, 0.38);
  --orange: #f48120;
  --orange-dark: #cd5f00;
  --white: #fffdf8;
  --serif: "Iowan Old Style", "Baskerville", "Times New Roman", serif;
  --sans: "Avenir Next", "Avenir", "Helvetica Neue", sans-serif;
  --mono: "SFMono-Regular", "SF Mono", "Cascadia Code", "Roboto Mono", monospace;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--paper);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 84% 12%, rgba(244, 129, 32, 0.1), transparent 24rem),
    var(--paper);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.signal-grid {
  position: fixed;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.32), transparent 68%);
  opacity: 0.42;
}

.site-header,
footer {
  display: flex;
  width: min(1180px, calc(100% - 48px));
  margin-inline: auto;
  align-items: center;
  justify-content: space-between;
}

.site-header {
  height: 96px;
  border-bottom: 1px solid var(--line);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: inherit;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-decoration: none;
}

.wordmark-mark {
  position: relative;
  width: 18px;
  height: 18px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
}

.wordmark-mark::after {
  position: absolute;
  width: 7px;
  height: 7px;
  right: -2px;
  bottom: -2px;
  border: 2px solid var(--paper);
  border-radius: 50%;
  background: var(--orange);
  content: "";
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 0 5px rgba(244, 129, 32, 0.13);
  animation: pulse 2.4s ease-out infinite;
}

main {
  display: grid;
  min-height: calc(100vh - 174px);
  place-items: center;
  padding: 80px 24px 96px;
}

.hero {
  width: min(840px, 100%);
}

.eyebrow,
.result-kicker {
  margin: 0 0 16px;
  color: var(--orange-dark);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

h1 {
  max-width: 840px;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(58px, 7vw, 92px);
  font-weight: 400;
  letter-spacing: -0.055em;
  line-height: 0.92;
}

.lede {
  max-width: 570px;
  margin: 30px 0 58px;
  color: var(--muted);
  font-size: clamp(16px, 2vw, 19px);
  line-height: 1.7;
}

.lede span {
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.84em;
}

.converter > label {
  display: block;
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 650;
}

.input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  border-bottom: 2px solid var(--ink);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.input-row:focus-within {
  border-color: var(--orange-dark);
  box-shadow: 0 7px 0 -5px rgba(244, 129, 32, 0.25);
}

#source-url {
  min-width: 0;
  border: 0;
  outline: 0;
  padding: 19px 0 17px;
  color: var(--ink);
  background: transparent;
  font-family: var(--mono);
  font-size: clamp(14px, 1.8vw, 17px);
}

#source-url::placeholder {
  color: #958e84;
  opacity: 1;
}

.convert-button {
  display: inline-flex;
  min-width: 148px;
  border: 0;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 0 22px;
  color: #1b1108;
  background: var(--orange);
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  transition: background 160ms ease, transform 160ms ease;
}

.convert-button:hover {
  background: #ff942f;
}

.convert-button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.convert-button:active {
  transform: translateY(1px);
}

.convert-button svg,
.open-link svg,
.copy-button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.form-meta {
  display: flex;
  min-height: 41px;
  align-items: start;
  justify-content: space-between;
  gap: 24px;
  padding-top: 11px;
}

.form-meta p {
  margin: 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  line-height: 1.5;
}

.form-message {
  color: #aa2f20 !important;
  text-align: right;
}

.result-panel {
  margin-top: 38px;
  border: 1px solid var(--line-strong);
  padding: clamp(24px, 4vw, 38px);
  background: rgba(255, 253, 248, 0.72);
  box-shadow: 14px 14px 0 rgba(22, 20, 17, 0.07);
}

.result-panel:not([hidden]) {
  animation: result-in 340ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.result-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 24px;
}

.result-heading h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(30px, 5vw, 45px);
  font-weight: 400;
  letter-spacing: -0.035em;
  line-height: 1;
}

.result-kicker {
  margin-bottom: 9px;
}

.result-check {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border: 1px solid var(--orange-dark);
  border-radius: 50%;
  color: var(--orange-dark);
  font-family: var(--mono);
  place-items: center;
}

.result-url {
  margin: 32px 0 26px;
  border-block: 1px solid var(--line);
  padding: 19px 0;
  overflow-wrap: anywhere;
}

#result-output {
  font-family: var(--mono);
  font-size: clamp(13px, 1.8vw, 16px);
  line-height: 1.65;
}

.result-proof {
  display: grid;
  margin: 0 0 27px;
  padding: 0;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  list-style: none;
}

.result-proof li {
  border-left: 1px solid var(--line);
  padding-left: 14px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.result-proof span {
  display: block;
  margin-bottom: 4px;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 22px;
  letter-spacing: -0.02em;
}

.result-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.copy-button,
.open-link {
  display: inline-flex;
  border: 0;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.copy-button {
  padding: 0;
}

.open-link {
  padding: 8px 0;
  border-bottom: 1px solid currentColor;
}

.copy-button:hover,
.open-link:hover {
  color: var(--orange-dark);
}

.wordmark:focus-visible,
.convert-button:focus-visible,
.copy-button:focus-visible,
.open-link:focus-visible {
  outline: 3px solid rgba(244, 129, 32, 0.45);
  outline-offset: 4px;
}

footer {
  height: 78px;
  border-top: 1px solid var(--line);
}

footer p {
  margin: 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(244, 129, 32, 0.3);
  }
  60%,
  100% {
    box-shadow: 0 0 0 8px rgba(244, 129, 32, 0);
  }
}

@keyframes result-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 640px) {
  .site-header,
  footer {
    width: calc(100% - 32px);
  }

  .site-header {
    height: 76px;
  }

  main {
    min-height: calc(100vh - 138px);
    padding: 56px 16px 68px;
  }

  h1 {
    font-size: clamp(54px, 20vw, 78px);
  }

  .lede {
    margin: 25px 0 42px;
  }

  .input-row {
    grid-template-columns: 1fr;
    border: 0;
  }

  #source-url {
    border-bottom: 2px solid var(--ink);
    padding: 17px 0 15px;
  }

  .convert-button {
    min-height: 52px;
    margin-top: 14px;
  }

  .form-meta {
    display: block;
  }

  .form-message {
    margin-top: 4px !important;
    text-align: left;
  }

  .result-panel {
    box-shadow: 8px 8px 0 rgba(22, 20, 17, 0.07);
  }

  .result-proof {
    gap: 10px;
  }

  .result-proof li {
    padding-left: 9px;
    font-size: 9px;
  }

  footer p:first-child {
    display: none;
  }
}

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