/*
 * Ridgebrook Oy — one stylesheet for the whole site.
 * Colours mirror the Juomapeli app theme (src/theme.ts) so the company site
 * and the product read as one thing.
 */

:root {
  --bg: #12101a;
  --surface: #1d1a28;
  --surface-raised: #282336;
  --border: #3a3348;
  --text: #f4f1fa;
  --text-muted: #9b93b0;
  --accent: #c451f6;
  --danger: #e4526a;
  --success: #3ecf8e;

  --measure: 68ch;
  --page: 1040px;
  --radius: 14px;
  --radius-lg: 22px;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* Reduced motion is a genuine accessibility requirement, not a nicety. */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* ---------------------------------------------------------------- layout */

.wrap {
  width: 100%;
  max-width: var(--page);
  margin: 0 auto;
  padding: 0 24px;
}

main {
  display: block;
}

section {
  padding: 56px 0;
}

section + section {
  border-top: 1px solid var(--border);
}

/* Legal and support pages: a single readable column. */
.prose {
  max-width: var(--measure);
}

.prose h2 {
  margin-top: 44px;
}

.prose h3 {
  margin-top: 30px;
}

.prose ul,
.prose ol {
  padding-left: 22px;
}

.prose li {
  margin: 8px 0;
}

/* ------------------------------------------------------------ typography */

h1,
h2,
h3 {
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin: 0 0 16px;
  font-weight: 650;
}

h1 {
  font-size: clamp(2rem, 5vw, 2.85rem);
}

h2 {
  font-size: clamp(1.4rem, 3vw, 1.75rem);
}

h3 {
  font-size: 1.13rem;
  color: var(--text);
}

p {
  margin: 0 0 16px;
}

.lede {
  font-size: 1.16rem;
  color: var(--text-muted);
  max-width: var(--measure);
}

.eyebrow {
  display: block;
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}

.muted {
  color: var(--text-muted);
}

small,
.small {
  font-size: 0.88rem;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--text);
}

/* Visible keyboard focus on every interactive element. */
a:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* --------------------------------------------------------------- header */

.skip {
  position: absolute;
  left: -9999px;
}

.skip:focus {
  position: fixed;
  left: 16px;
  top: 16px;
  z-index: 10;
  background: var(--accent);
  color: #fff;
  padding: 10px 16px;
  border-radius: 8px;
  text-decoration: none;
}

.site-header {
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: rgba(18, 16, 26, 0.9);
  backdrop-filter: saturate(160%) blur(12px);
  z-index: 5;
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding-top: 16px;
  padding-bottom: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-weight: 650;
  font-size: 1.06rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.brand svg {
  display: block;
  flex: none;
}

.nav {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  font-size: 0.94rem;
}

.nav a {
  color: var(--text-muted);
  text-decoration: none;
}

.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--text);
}

/* ----------------------------------------------------------------- hero */

.hero {
  padding: 84px 0 68px;
}

.hero h1 {
  max-width: 20ch;
}

/* ---------------------------------------------------------------- cards */

.grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(255px, 1fr));
  margin-top: 32px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px;
}

.card h3 {
  margin-bottom: 8px;
}

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

.card--link {
  text-decoration: none;
  color: inherit;
  display: block;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.card--link:hover {
  border-color: var(--accent);
  background: var(--surface-raised);
  color: inherit;
}

/* --------------------------------------------------------------- pieces */

.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  padding: 13px 26px;
  border-radius: var(--radius);
}

.btn:hover {
  filter: brightness(1.12);
  color: #fff;
}

.btn--ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn--ghost:hover {
  border-color: var(--accent);
  filter: none;
  color: var(--text);
}

.btn-row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 28px;
}

.pill {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 5px 13px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.notice {
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin: 28px 0;
}

.notice--age {
  border-left-color: var(--danger);
}

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

/* Company facts block — this is what Apple's verification team reads. */
.facts {
  margin: 0;
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 10px 26px;
  font-size: 0.97rem;
}

.facts dt {
  color: var(--text-muted);
}

.facts dd {
  margin: 0;
}

@media (max-width: 520px) {
  .facts {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .facts dd {
    margin-bottom: 12px;
  }
}

/* Anything still holding a placeholder shouts, so it cannot ship unnoticed. */
.todo {
  background: rgba(228, 82, 106, 0.16);
  border-bottom: 2px dotted var(--danger);
  color: var(--danger);
  font-weight: 600;
  padding: 0 4px;
}

details {
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
}

summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
}

summary::-webkit-details-marker {
  display: none;
}

summary::before {
  content: "+";
  display: inline-block;
  width: 1.2em;
  color: var(--accent);
  font-weight: 700;
}

details[open] > summary::before {
  content: "\2212";
}

details > *:not(summary) {
  max-width: var(--measure);
}

details p:first-of-type {
  margin-top: 12px;
}

/* --------------------------------------------------------------- footer */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 44px 0;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.site-footer .cols {
  display: flex;
  justify-content: space-between;
  gap: 28px;
  flex-wrap: wrap;
}

.site-footer a {
  color: var(--text-muted);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--text);
}

.site-footer nav {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
}

.site-footer .legalname {
  color: var(--text);
  font-weight: 600;
}
