@font-face {
  font-family: "Better VCR";
  src: url("fonts/BetterVCR-25.09.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --blue: #001eff;
  --white: #ffffff;
  --max-width: 1040px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100%;
  margin: 0;
  background: var(--blue);
  color: var(--white);
  font-family: "Better VCR", "Courier New", Courier, monospace;
  font-size: 24px;
  line-height: 1.35;
  letter-spacing: 0;
  font-weight: 400;
  -webkit-font-smoothing: none;
  text-rendering: geometricPrecision;
}

button,
input {
  font: inherit;
}

a {
  color: inherit;
  text-underline-offset: 0.15em;
}

.page-shell {
  width: min(100%, calc(var(--max-width) + 48px));
  margin: 0 auto;
  padding: 54px 40px 80px;
}

.hero {
  padding: 0 0 56px;
}

h1 {
  max-width: 720px;
  margin: 0 0 56px;
  font-size: 24px;
  font-weight: 400;
  line-height: 1.35;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.intro {
  max-width: 980px;
  margin: 0;
  font-size: 24px;
  line-height: 1.35;
  text-transform: uppercase;
}

.highlight,
.section-label span {
  display: inline;
  padding: 0 0.18em;
  background: var(--white);
  color: var(--blue);
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.ascii-divider {
  width: 100%;
  margin: 34px 0 56px;
  color: var(--white);
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
}

.lookup-section,
.result-section {
  max-width: 980px;
}

.section-label {
  margin: 0 0 24px;
  font-size: 24px;
  font-weight: 400;
  text-transform: uppercase;
}

.lookup-form,
.progress-section {
  display: grid;
  gap: 18px;
}

.lookup-form[hidden],
.progress-section[hidden] {
  display: none;
}

.field {
  display: grid;
  gap: 2px;
}

label {
  text-transform: uppercase;
}

input {
  width: 100%;
  min-height: 50px;
  border: 2px solid var(--white);
  border-radius: 0;
  background: var(--blue);
  color: var(--white);
  padding: 7px 14px;
  outline: none;
  caret-color: var(--white);
}

input::placeholder {
  color: var(--white);
  opacity: 0.55;
}

.masked-input {
  position: relative;
}

.masked-input input {
  position: relative;
  z-index: 1;
  background: transparent;
}

.input-mask {
  position: absolute;
  top: 50%;
  left: 16px;
  z-index: 0;
  color: var(--white);
  opacity: 0.55;
  pointer-events: none;
  transform: translateY(-50%);
  white-space: pre;
}

input:focus {
  background: var(--white);
  color: var(--blue);
}

input:focus::placeholder {
  color: var(--blue);
  opacity: 0.75;
}

.masked-input:focus-within .input-mask {
  color: var(--blue);
  opacity: 0.75;
  z-index: 2;
}

.masked-input:focus-within input {
  background: var(--white);
}

.time-field {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: stretch;
}

.meridiem-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.meridiem-button {
  min-width: 48px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--white);
  padding: 6px 0 0;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
  transform-origin: center;
  transition: transform 140ms linear;
}

.meridiem-button[aria-pressed="true"] {
  background: var(--white);
  color: var(--blue);
}

.meridiem-button:hover,
.meridiem-button:focus-visible {
  outline: none;
}

.meridiem-button:hover,
.meridiem-button:focus-visible {
  transform: scaleY(-1);
}

input[aria-invalid="true"] {
  border-style: dashed;
}

.error-message {
  min-height: 1.1em;
  margin: 0;
  font-size: 24px;
  text-transform: uppercase;
}

.submit-button,
.action-button {
  justify-self: start;
  margin-top: 4px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--white);
  padding: 0;
  text-transform: uppercase;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
  transform-origin: center;
  transition: transform 140ms linear;
}

.submit-button:hover,
.submit-button:focus-visible,
.action-button:hover,
.action-button:focus-visible {
  color: var(--white);
  text-decoration: underline;
  outline: none;
  transform: scaleY(-1);
}

.submit-button:disabled,
.action-button:disabled {
  cursor: wait;
  text-decoration: none;
}

.progress-section p {
  margin: 0;
  text-transform: uppercase;
}

.progress-track {
  width: 100%;
  height: 58px;
  border: 2px solid var(--white);
  border-radius: 0;
  overflow: hidden;
}

.progress-bar {
  width: 0%;
  height: 100%;
  background: var(--white);
  transition: width 180ms linear;
}

.result-section {
  margin-top: 56px;
}

.result-divider {
  margin-bottom: 42px;
}

.result-section p {
  margin: 0 0 18px;
  text-transform: uppercase;
}

.weather-summary {
  margin: 0 0 30px;
}

.weather-summary[hidden] {
  display: none;
}

.weather-summary h3 {
  margin: 0 0 42px;
  font-size: 24px;
  font-weight: 400;
  text-transform: none;
}

.weather-summary p {
  margin: 0;
  text-transform: none;
}

.weather-summary p:nth-of-type(3) {
  margin-bottom: 18px;
}

.weather-summary .maritime-line {
  margin-top: 36px;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 36px;
}

::selection {
  background: var(--white);
  color: var(--blue);
}

@media (max-width: 640px) {
  body {
    font-size: 18px;
  }

  .page-shell {
    padding: 30px 20px 54px;
  }

  .hero {
    padding: 0 0 40px;
  }

  h1,
  .intro,
  .section-label,
  .error-message,
  .weather-summary h3 {
    font-size: 18px;
  }

  input {
    min-height: 46px;
  }

  .time-field {
    grid-template-columns: 1fr;
  }

  .submit-button,
  .action-button {
    width: 100%;
    padding: 8px;
  }

}
