/* R-53 OÜ — static site. Dark palette only; no web fonts, no animation. */

:root {
  color-scheme: dark;
  --navy: #091b2c;
  --surface: #142c41;
  --slate: #30516d;
  --cyan: #6dd1e9;
  --text: #edf6ff;
  --muted: #b0c5d8;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "DejaVu Sans Mono", Menlo, Consolas, monospace;
  --max: 72rem;
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--navy);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-wrap: break-word;
}

main {
  flex: 1 0 auto;
}

header,
main,
footer,
.hero-grid,
.cards,
.stack,
.about-grid,
.bar,
nav {
  min-width: 0;
  max-width: 100%;
}

.hero-grid > *,
.cards > li,
.stack > li {
  min-width: 0;
}

:focus:not(:focus-visible) {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

main:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: -4px;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: 1rem;
  z-index: 20;
  padding: 0.55rem 0.9rem;
  background: var(--cyan);
  color: var(--navy);
  font-weight: 700;
  text-decoration: none;
  transform: translateY(-200%);
}

.skip-link:focus,
.skip-link:focus-visible {
  transform: translateY(0);
}

a.skip-link:visited {
  color: var(--navy);
}

img {
  max-width: 100%;
  height: auto;
}

.wrap {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: 1rem;
}

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

.bar {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  padding-block: 0.9rem;
}

.wordmark,
.wordmark:visited {
  font-family: var(--mono);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--text);
  text-decoration: none;
}

.wordmark .dash {
  color: var(--cyan);
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.1rem;
}

nav a,
nav a:visited {
  color: var(--cyan);
  text-decoration: none;
  padding-block: 0.35rem;
  line-height: 1.3;
}

nav a:hover,
nav a:focus-visible {
  text-decoration: underline;
  text-underline-offset: 0.22em;
}

h1,
h2,
h3 {
  font-weight: 650;
  line-height: 1.2;
  text-wrap: balance;
}

h1 {
  margin: 0 0 1rem;
  font-size: clamp(1.85rem, 1.25rem + 2.4vw, 3.15rem);
  letter-spacing: -0.02em;
}

h2 {
  margin: 0 0 1.25rem;
  font-size: clamp(1.4rem, 1.15rem + 1vw, 1.85rem);
}

h3 {
  margin: 0.35rem 0 0.55rem;
  font-size: 1.125rem;
}

p {
  margin: 0 0 1rem;
}

.eyebrow,
.label,
.updated {
  font-family: var(--mono);
}

.eyebrow {
  margin: 0 0 0.85rem;
  color: var(--cyan);
  font-size: 0.875rem;
}

.label {
  margin: 0;
  color: var(--cyan);
  font-size: 0.8125rem;
}

.lead {
  max-width: 40rem;
  margin: 0;
  font-size: 1.0625rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.button,
.button:visited {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.55rem 1rem;
  border: 1px solid var(--cyan);
  background: var(--cyan);
  color: var(--navy);
  font-weight: 650;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.button.secondary,
.button.secondary:visited {
  background: transparent;
  color: var(--text);
}

.button:hover {
  background: var(--text);
  border-color: var(--text);
  color: var(--navy);
}

.button.secondary:hover {
  background: var(--cyan);
  border-color: var(--cyan);
  color: var(--navy);
}

.hero {
  padding-block: 1.75rem 2.25rem;
}

.hero-grid {
  display: grid;
  gap: 1.5rem;
  align-items: center;
}

.hero-visual {
  position: relative;
}

.hero-visual picture {
  display: block;
}

.hero-visual img {
  display: block;
  width: 100%;
  height: 11.5rem;
  object-fit: cover;
  object-position: right center;
  background: var(--navy);
}

.hero-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, var(--navy) 0%, rgba(9, 27, 44, 0) 36%);
}

.band {
  padding-bottom: 3rem;
}

.cards,
.stack {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
}

.card {
  margin: 0;
  padding: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--slate);
}

.card p:last-child {
  margin-bottom: 0;
}

.points {
  margin: 0.85rem 0 0;
  padding-left: 1.15rem;
}

.points li {
  margin: 0.45rem 0;
  padding-left: 0.2rem;
}

.points li::marker {
  color: var(--cyan);
}

.refs {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}

.refs a,
.prose a,
.legal a {
  overflow-wrap: anywhere;
}

.legal a[href^="mailto:"],
.prose a[href^="mailto:"],
.contact-line a[href^="mailto:"] {
  white-space: nowrap;
}

a {
  color: var(--cyan);
  text-underline-offset: 0.18em;
}

a:visited {
  color: var(--cyan);
}

.about-grid {
  display: grid;
  gap: 1.25rem;
  align-items: start;
}

.portrait {
  width: 12rem;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--slate);
  background: var(--surface);
}

.about-grid p:last-child {
  margin-bottom: 0;
}

.about-grid > div,
#contact p {
  max-width: 42rem;
}

.stack .card > h3,
.stack .card > p,
.stack .card > .points {
  max-width: 70ch;
}

.contact-line a {
  font-family: var(--mono);
}

.page {
  padding-block: 2.25rem 3.5rem;
}

.prose {
  max-width: 42rem;
}

.page h1 {
  margin-bottom: 0.6rem;
}

.updated {
  margin: 0 0 0.5rem;
  color: var(--muted);
  font-size: 0.875rem;
}

.prose h2 {
  margin: 2rem 0 0.55rem;
  font-size: 1.25rem;
}

.prose section:last-child p:last-child {
  margin-bottom: 0;
}

.site-footer {
  border-top: 1px solid var(--slate);
  padding-block: 1.35rem 2rem;
}

.legal {
  margin: 0;
  color: var(--muted);
  font-size: 0.9375rem;
  line-height: 1.6;
}

.legal .nowrap {
  white-space: nowrap;
}

::selection {
  background: #30516d;
  color: #edf6ff;
}

@media (min-width: 768px) {
  .hero {
    padding-block: 2.25rem 3rem;
  }

  .hero-grid {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
    gap: 1.75rem;
  }

  .hero-copy {
    padding-block: 0.5rem;
  }

  .hero-visual {
    align-self: stretch;
    min-height: 16rem;
  }

  .hero-visual picture {
    position: absolute;
    inset: 0;
    height: 100%;
  }

  .hero-visual img {
    width: 100%;
    height: 100%;
    max-height: none;
    object-fit: cover;
    object-position: right center;
  }

  .hero-visual::after {
    background: linear-gradient(180deg, var(--navy) 0%, rgba(9, 27, 44, 0) 14%, rgba(9, 27, 44, 0) 86%, var(--navy) 100%), linear-gradient(90deg, var(--navy) 0%, rgba(9, 27, 44, 0.55) 18%, rgba(9, 27, 44, 0) 46%);
  }

  .band {
    padding-bottom: 4.5rem;
  }

  .cards,
  .stack {
    grid-template-columns: 1fr 1fr;
  }

  .stack > li:first-child {
    grid-column: 1 / -1;
  }

  .card {
    padding: 1.5rem 1.6rem;
  }

  .about-grid {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 2rem;
  }

  .portrait {
    width: 16rem;
  }

  .nowrap {
    white-space: nowrap;
  }
}

@media (min-width: 768px) and (max-width: 1099.98px) {
  .cards > li:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }

  /* Four cards on two tracks: the last one would sit in a half-width cell. */
  .stack > li:last-child:nth-child(even) {
    grid-column: 1 / -1;
  }
}

@media (min-width: 1100px) {
  .cards,
  .stack {
    grid-template-columns: 1fr 1fr 1fr;
  }

  .stack > li:first-child .points {
    max-width: min(100%, calc(140ch + 2rem));
    columns: 2;
    column-gap: 2rem;
  }

  .stack > li:first-child .points li {
    break-inside: avoid;
    /* Bottom-only spacing so both columns start on the same line. */
    margin: 0 0 0.9rem;
  }
}

@media (forced-colors: active) {
  :focus-visible {
    outline: 2px solid CanvasText;
  }
}
