:root {
  --color-1: oklch(0.5 0.12 290);
  --color-2: oklch(0.55 0.13 292);
  --color-3: oklch(0.6 0.14 295);
  --color-4: oklch(0.65 0.15 298);
  --color-5: oklch(0.68 0.14 300);
  --color-6: oklch(0.72 0.12 302);
  --color-7: oklch(0.75 0.1 305);
  --color-8: oklch(0.8 0.08 308);

  --textcolor: var(--color-1);
  --bgcolor: oklch(0.98 0.015 305);
  --highlight: var(--color-4);
  --muted: oklch(0.5 0.12 290 / .68);
  --wash: oklch(0.8 0.08 308 / .16);
  --rule: oklch(0.5 0.12 290 / .1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  font-size: 18px;
  font-family: system-ui, sans-serif;
  line-height: 1.4;
  color: var(--textcolor);
  background: var(--bgcolor);
  position: relative;
  max-width: 64em;
  min-height: 100vh;
  margin: 0 auto;
}

header {
  padding: 5vw 5vw 0 5vw;
  display: flex;
  flex-wrap: wrap;
  position: absolute;
  width: 100%;
  z-index: 2;
}

header h1 {
  font-size: 1em;
  font-weight: 700;
  flex: 1;
  white-space: nowrap;
  padding: 0 5vw .5em 0;
}

nav a:not(:last-of-type) {
  margin-right: 1.5vw;
}

main {
  padding: 5vw 5vw 8vw 5vw;
  min-height: 100vh;
  width: 100%;
}

section {
  scroll-margin-top: 5vw;
}

section + section {
  margin-top: 1.6em;
}

a {
  text-decoration: none;
  color: var(--highlight);
  text-underline-offset: .18em;
  transition-property: color, text-decoration-color;
  transition-duration: 160ms;
  transition-timing-function: cubic-bezier(0.2, 0, 0, 1);
}

a:hover,
a:focus-visible {
  text-decoration: underline;
  text-decoration-thickness: 1px;
}

main > h1,
section > h1 {
  font-size: 1em;
  margin: 0 0 1em 0;
  text-wrap: balance;
}

h2,
h3,
h4 {
  font-size: 1em;
  font-weight: 600;
  margin: 1.6em 0 .6em 0;
  text-wrap: balance;
}

p,
ul,
ol,
article,
form,
.result-panel {
  max-width: 60ch;
  margin-bottom: .6em;
  text-wrap: pretty;
}

ul,
ol {
  padding-left: 2ch;
}

li {
  margin-bottom: .2em;
}

b,
strong {
  font-weight: 600;
}

small,
.muted {
  font-size: .85em;
  color: var(--muted);
}

hr {
  height: 1px;
  border: 0;
  background: currentColor;
  opacity: .1;
  margin: 1.2em 0;
}

.field-label {
  display: inline-block;
  margin: 0 0 .45em 0;
  font-weight: 600;
}

textarea,
input[type="url"] {
  font-size: .9em;
  color: inherit;
  line-height: inherit;
  padding: .75em 1em;
  margin: .2em 0 1em 0;
  position: relative;
  display: block;
  width: 100%;
  border: 0;
  border-radius: 12px;
  background: var(--wash);
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, .08),
    0 1px 2px rgba(0, 0, 0, .04),
    0 12px 32px oklch(0.5 0.12 290 / .06);
  opacity: .9;
  transition-property: box-shadow, opacity, background-color;
  transition-duration: 180ms;
  transition-timing-function: cubic-bezier(0.2, 0, 0, 1);
}

textarea {
  font-family: ui-monospace, SF Mono, Menlo, Monaco, Andale Mono, monospace;
  min-height: 18em;
  resize: vertical;
  white-space: pre-wrap;
}

input[type="url"] {
  font: inherit;
  min-height: 44px;
}

textarea:focus-visible,
input[type="url"]:focus-visible {
  outline: 0;
  box-shadow:
    inset 0 0 0 1px var(--highlight),
    0 0 0 4px oklch(0.65 0.15 298 / .14),
    0 1px 2px rgba(0, 0, 0, .04),
    0 14px 36px oklch(0.5 0.12 290 / .08);
  opacity: 1;
}

button {
  appearance: none;
  border: 0;
  border-radius: 12px;
  min-height: 40px;
  padding: .55em 1em;
  font: inherit;
  color: var(--bgcolor);
  background: var(--highlight);
  box-shadow:
    0 1px 1px rgba(0, 0, 0, .08),
    0 8px 18px oklch(0.5 0.12 290 / .16);
  cursor: pointer;
  transform: translateZ(0);
  transition-property: transform, filter, box-shadow, opacity;
  transition-duration: 160ms;
  transition-timing-function: cubic-bezier(0.2, 0, 0, 1);
}

button:hover,
button:focus-visible {
  filter: brightness(.96);
  box-shadow:
    0 1px 1px rgba(0, 0, 0, .08),
    0 10px 22px oklch(0.5 0.12 290 / .18);
}

button:active:not(:disabled) {
  transform: scale(.96);
}

button:focus-visible {
  outline: 0;
  box-shadow:
    0 0 0 4px oklch(0.65 0.15 298 / .18),
    0 1px 1px rgba(0, 0, 0, .08),
    0 10px 22px oklch(0.5 0.12 290 / .18);
}

button:disabled {
  cursor: wait;
  opacity: .62;
  transform: none;
}

#text-help:not([hidden]),
#url-status:not([hidden]) {
  display: block;
  max-width: 60ch;
  margin: -.5em 0 .9em 0;
  color: var(--highlight);
}

#url-help {
  margin-top: -.5em;
}

.result-panel:not([hidden]) {
  display: block;
  margin-top: 1.2em;
  padding: 1em 1.1em;
  border-radius: 16px;
  background: oklch(1 0 0 / .38);
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, .06),
    0 1px 2px rgba(0, 0, 0, .04),
    0 16px 40px oklch(0.5 0.12 290 / .08);
  animation: result-enter 260ms cubic-bezier(0.2, 0, 0, 1);
}

.result-panel h2 {
  margin-top: 0;
}

.result-panel .score-value {
  font-variant-numeric: tabular-nums;
}

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

footer {
  padding: 0 5vw 5vw 5vw;
}

footer p {
  color: var(--muted);
}

@media only screen and (max-width: 680px) {
  body {
    font-size: 16px;
  }
}

@media only screen and (max-width: 540px) {
  nav {
    width: 100%;
  }

  nav a:not(:last-of-type) {
    margin-right: 3vw;
  }
}
