@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("fonts/space-grotesk-latin-wght-normal.woff2") format("woff2");
}

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url("fonts/jetbrains-mono-latin-wght-normal.woff2") format("woff2");
}

:root {
  --ink: #12181B;
  --paper: #F7F5F0;
  --pine: #3E6B5C;
  --copper: #C97A4A;
  --copper-light: #D8916A;
  --muted: #8A9A93;
  --surface: #172124;
  --line: rgb(138 154 147 / 0.22);
  --text-soft: rgb(247 245 240 / 0.74);
  --sans: "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: dark;
}

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

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background-color: var(--ink);
  background-image:
    radial-gradient(ellipse 75% 55% at 100% 0%, rgb(62 107 92 / 0.3), transparent 70%),
    radial-gradient(circle at 1px 1px, rgb(247 245 240 / 0.05) 1px, transparent 0);
  background-size: auto, 28px 28px;
  color: var(--paper);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--copper);
  color: var(--ink);
}

.container {
  width: min(100% - 2.5rem, 46rem);
  margin-inline: auto;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Ylätunniste */

.site-header {
  padding-top: clamp(1.5rem, 4vw, 2.5rem);
}

.lockup {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
}

.mark {
  width: 2.5rem;
  height: 2.5rem;
  flex: none;
}

.wordmark {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.01em;
}

.oy {
  font-weight: 400;
  color: var(--copper);
}

/* Pääosio */

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-block: clamp(3rem, 9vh, 5rem);
}

.kicker {
  margin: 0 0 1.25rem;
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--muted);
}

h1 {
  margin: 0;
  font-size: clamp(2.75rem, 10vw, 5.25rem);
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

h1 .dot {
  color: var(--copper);
}

.lead {
  max-width: 32rem;
  margin: 1.5rem 0 0;
  font-size: clamp(1.0625rem, 2.5vw, 1.25rem);
  color: var(--text-soft);
  text-wrap: pretty;
}

/* Yhteystietokortti */

.card {
  margin-top: clamp(2.5rem, 7vw, 4rem);
  padding: clamp(1.25rem, 4vw, 2rem);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.label {
  margin: 0 0 0.75rem;
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.label:focus {
  outline: none;
}

.intro {
  margin: 0 0 1.5rem;
  color: var(--text-soft);
}

.gate-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
}

.challenge {
  min-width: 0;
  font-family: var(--mono);
  font-size: clamp(1.375rem, 5vw, 1.75rem);
  font-weight: 500;
  cursor: text;
}

.challenge code {
  font: inherit;
}

.challenge .eq {
  color: var(--muted);
}

.field {
  flex: 1 1 15rem;
  min-width: 0;
  display: flex;
  gap: 0.5rem;
}

.field input {
  flex: 1;
  min-width: 0;
  padding: 0.7rem 0.9rem;
  font: 500 1.125rem/1.2 var(--mono);
  color: var(--paper);
  background: var(--ink);
  border: 1px solid var(--line);
  border-radius: 10px;
  caret-color: var(--copper);
}

.field input::placeholder {
  color: var(--muted);
  opacity: 0.8;
}

.field input:focus-visible {
  outline: 2px solid var(--copper);
  outline-offset: 2px;
}

.field input[aria-invalid="true"] {
  border-color: var(--copper);
}

.field button {
  padding: 0.7rem 1.25rem;
  font: 600 1rem/1.2 var(--sans);
  color: var(--ink);
  background: var(--copper);
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  transition: background-color 0.15s;
}

.field button:hover {
  background: var(--copper-light);
}

.field button:focus-visible {
  outline: 2px solid var(--paper);
  outline-offset: 2px;
}

.field button:disabled {
  cursor: progress;
  opacity: 0.7;
}

.status {
  margin: 0.75rem 0 0;
  font-family: var(--mono);
  font-size: 0.875rem;
  color: var(--muted);
}

.status:empty {
  margin: 0;
}

.status.error {
  color: var(--copper);
}

.contacts {
  display: grid;
  grid-template-columns: max-content 1fr;
  align-items: baseline;
  gap: 0.9rem 2rem;
  margin: 0;
  animation: reveal 0.45s ease-out;
}

.contacts dt {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.contacts dd {
  margin: 0;
  font-size: clamp(1.0625rem, 3vw, 1.25rem);
  overflow-wrap: anywhere;
}

.contacts a {
  color: inherit;
  text-decoration: underline 1px var(--copper);
  text-underline-offset: 0.22em;
}

.contacts a:hover {
  color: var(--copper);
}

.contacts a:focus-visible {
  outline: 2px solid var(--copper);
  outline-offset: 3px;
  border-radius: 2px;
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

/* Alatunniste */

.site-footer {
  padding-block: 1.5rem 2rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
}

@media (max-width: 30rem) {
  .contacts {
    grid-template-columns: 1fr;
    gap: 0.15rem;
  }

  .contacts dd + dt {
    margin-top: 0.9rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
