/* Liedon Pienvarasto. Calm Confidence (Concept 01); see docs/design/design-spec.md.
   Use the tokens below instead of raw values; add a token when a new value is needed. */

@font-face {
  font-family: Inter;
  src: url("/static/fonts/InterVariable-4.1.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --color-ink: #183440;
  --color-ink-soft: #214B46;
  --color-primary: #32766C;
  --color-action: #27665C;
  --color-action-text: #27594F;
  --color-page: #F8FAF7;
  --color-hero: #DFEBE4;
  --color-surface: #EFF4EF;
  --color-border: #E3EDE7;
  --color-subtle: #6D8C81; /* borders of form fields; 3.7:1 on white (UI components need 3:1) */
  --color-white: #FFFFFF;
  --color-highlight: #397B71;
  --color-muted: #557268;
  --color-button-soft: #E8F0EC;
  --color-error: #A3302A;
  --color-error-surface: #FBEDEB;
  --font-ui: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --content-width: 1180px;
  --narrow-width: 520px;
  --radius-button: 10px;
  --radius-panel: 16px;
  --radius-card: 14px;
  --radius-field: 9px;
  --shadow-search: 0 15px 48px #153e3521;
  --shadow-button: 0 8px 19px #00000010;
  --focus-ring: 3px solid var(--color-ink);
}

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

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--color-page);
  color: var(--color-ink);
  font-family: var(--font-ui);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

a { color: inherit; text-decoration: none; }
h1 { font-size: 30px; letter-spacing: -0.8px; line-height: 1.2; margin: 0 0 16px; }
p { margin: 0 0 16px; }

:focus-visible { outline: var(--focus-ring); outline-offset: 3px; }

.container { width: min(var(--content-width), calc(100% - 88px)); margin-inline: auto; }
.narrow { width: min(var(--narrow-width), calc(100% - 34px)); margin-inline: auto; padding: 24px 0 72px; }
.admin { padding: 24px 0 72px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -100px;
  background: var(--color-white);
  padding: 10px 14px;
  border-radius: var(--radius-button);
}
.skip-link:focus { top: 16px; }

.muted { color: var(--color-muted); }
.eyebrow { color: var(--color-muted); font-size: 11px; letter-spacing: 2.2px; font-weight: 800; margin: 0; text-transform: uppercase; }

/* Header */
.site-header { display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 94px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 22px; letter-spacing: -0.6px; }
.logo-mark { width: 29px; height: 29px; flex: none; display: grid; grid-template-columns: 1fr 1fr; gap: 3px; transform: rotate(-10deg); }
.logo-mark i { border-radius: 3px; background: var(--color-primary); }
.logo-mark i:nth-child(2) { opacity: .45; }
.logo-mark i:nth-child(3) { opacity: .7; }
.logo-mark i:nth-child(4) { opacity: .9; }
.site-nav { display: flex; align-items: center; gap: 22px; font-size: 13px; font-weight: 600; flex-wrap: wrap; justify-content: flex-end; }
.site-nav > a:not(.button-soft):hover, .site-nav .button-link:hover { text-decoration: underline; }

/* Buttons and links */
.button-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  background: var(--color-action); color: var(--color-white);
  border: 0; border-radius: var(--radius-button);
  padding: 15px 22px; font: inherit; font-size: 14px; font-weight: 750;
  box-shadow: var(--shadow-button); cursor: pointer;
}
.button-primary:hover { filter: brightness(1.05); }
.button-secondary {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--color-white); color: var(--color-action-text);
  border: 1px solid var(--color-border); border-radius: var(--radius-button);
  padding: 13px 20px; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer;
}
.button-secondary:hover { background: var(--color-surface); }
.button-soft {
  display: inline-flex; align-items: center;
  padding: 11px 18px; border-radius: 9px; font-weight: 700; font-size: 13px;
  background: var(--color-button-soft); color: var(--color-ink-soft);
}
.button-link {
  background: none; border: 0; padding: 0; font: inherit; color: var(--color-action-text);
  font-weight: 700; cursor: pointer;
}
.text-link { color: var(--color-action-text); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.inline-form { display: inline; margin: 0; }

/* Panels and forms */
.panel { background: var(--color-white); border: 1px solid var(--color-border); border-radius: var(--radius-panel); padding: 32px; }
.form { display: grid; gap: 18px; margin: 8px 0 0; }
.form-actions { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; margin-top: 4px; }
.form-footer { margin: 20px 0 0; font-size: 14px; }
.field { display: grid; gap: 6px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field label { font-size: 14px; font-weight: 700; }
.field-hint { font-size: 13px; color: var(--color-muted); margin: 0; }
.field input, .field select, .field textarea {
  font: inherit; font-size: 16px; color: var(--color-ink);
  background: var(--color-white); border: 1px solid var(--color-subtle);
  border-radius: var(--radius-field); padding: 12px 14px; width: 100%;
}
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible { outline: var(--focus-ring); outline-offset: 1px; }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--color-error); border-width: 2px; }
.field-error { color: var(--color-error); font-size: 13px; font-weight: 600; margin: 0; }

.alert { border-radius: var(--radius-field); padding: 12px 16px; margin: 0 0 16px; font-size: 14px; background: var(--color-surface); }
.alert-error { background: var(--color-error-surface); color: var(--color-error); font-weight: 600; }

.details { display: grid; grid-template-columns: max-content 1fr; gap: 6px 20px; margin: 0 0 20px; }
.details dt { font-weight: 700; }
.details dd { margin: 0; }

.field.checkbox { grid-template-columns: auto 1fr; align-items: start; column-gap: 12px; }
.field.checkbox input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--color-action); }
.field.checkbox label { font-weight: 400; line-height: 1.5; }
.field.checkbox .field-error { grid-column: 2; }
.field.radio { grid-template-columns: auto 1fr; align-items: start; column-gap: 12px; }
.field.radio input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--color-action); }
.field.radio label { font-weight: 400; line-height: 1.5; }
.field.radio .field-hint { grid-column: 2; }
.field-label { font-size: 14px; font-weight: 700; }
.fieldset { border: 0; margin: 0; padding: 0; display: grid; gap: 14px; min-width: 0; }
.fieldset legend { font-size: 16px; font-weight: 700; padding: 0; margin-bottom: 4px; }
.field-static { margin: 0; }
.notice { background: var(--color-surface); border-radius: var(--radius-field); padding: 14px 16px; font-size: 14px; }
.notice p { margin: 0 0 6px; }
.notice p:last-child { margin: 0; }
.actions { display: flex; align-items: center; gap: 26px; margin-top: 34px; }

/* Units, checkout and account */
.listing, .account { padding: 24px 0 72px; }
.account h2 { font-size: 20px; margin: 32px 0 12px; }
.unit-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.unit-card {
  display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap;
  background: var(--color-white); border: 1px solid var(--color-border); border-radius: var(--radius-card); padding: 20px 24px;
}
.unit-card h2, .unit-card h3 { margin: 0 0 4px; font-size: 20px; }
.unit-card p { margin: 0; }
.unit-card-price { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.size-filter { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin: 0 0 20px; }
.size-filter .field { min-width: min(320px, 100%); }
.summary { background: var(--color-surface); border-radius: var(--radius-field); padding: 14px 16px; }

@media print {
  .site-header, .site-footer, .skip-link, .no-print { display: none; }
  body { background: var(--color-white); }
  .panel { border: 0; padding: 0; }
}

/* Admin */
.breadcrumb { font-size: 14px; margin: 0 0 12px; }
.page-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-heading h1 { margin: 0 0 4px; }
.table-wrap { overflow-x: auto; background: var(--color-white); border: 1px solid var(--color-border); border-radius: var(--radius-panel); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--color-border); vertical-align: top; }
.table th { font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--color-muted); font-weight: 800; }
.table tbody tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; white-space: nowrap; }
.table .actions { display: flex; gap: 14px; flex-wrap: wrap; }
.row-archived td { color: var(--color-muted); }
.row-unread td { font-weight: 700; }
.admin-links { margin: 0 0 16px; font-size: 14px; }
.message-subject { font-size: 24px; overflow-wrap: anywhere; }
.field textarea { resize: vertical; line-height: 1.5; }
.reply { margin-top: 16px; }
.reply h2 { font-size: 20px; margin: 0 0 12px; }
.reply-meta { margin: 0 0 12px; font-size: 14px; }
.badge-error { background: var(--color-error-surface); color: var(--color-error); }
.message-body { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; border-top: 1px solid var(--color-border); padding-top: 16px; }
.badge { display: inline-block; margin-left: 8px; font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 999px; background: var(--color-button-soft); color: var(--color-ink-soft); vertical-align: middle; }
.status { font-weight: 700; }
.status-available { color: var(--color-action-text); }
.admin-footer-actions { display: flex; gap: 22px; margin-top: 24px; font-size: 14px; }

/* Hero */
.hero { padding: 54px 0 24px; }
.hero-grid { display: grid; grid-template-columns: 51% 49%; align-items: center; min-height: 465px; }
.hero h1 em { font-style: normal; color: var(--color-highlight); }
.hero-visual { position: relative; height: 530px; display: flex; align-items: center; justify-content: center; isolation: isolate; }
.hero-visual::before {
  content: ""; position: absolute; width: min(510px, 90%); height: 510px; left: 10%; top: 0; z-index: -1;
  background: var(--color-hero); border-radius: 49% 51% 51% 49% / 45% 45% 55% 55%;
}
.hero-art { width: 112%; max-width: 640px; height: auto; filter: drop-shadow(0 15px 20px #1d4c4220); }

/* Benefits */
.benefits { padding: 56px 0 90px; }
.benefits-grid { display: grid; grid-template-columns: 34% 1fr; gap: 55px; align-items: start; }
.benefits h2 { font-size: 24px; letter-spacing: -.8px; margin: 0 0 8px; }
.benefits .muted { font-size: 14px; line-height: 1.6; }
.feature-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.feature-card { background: var(--color-surface); border-radius: var(--radius-card); padding: 24px; }
.feature-card svg { color: var(--color-primary); margin-bottom: 13px; }
.feature-card h3 { margin: 0 0 8px; font-size: 15px; }
.feature-card p { font-size: 13px; line-height: 1.6; margin: 0; color: var(--color-muted); }
.hero h1 {
  font-size: clamp(52px, 5vw, 77px);
  line-height: 1.07;
  letter-spacing: -4px;
  margin: 18px 0 25px;
  font-weight: 750;
}
.body-copy { font-size: 17px; line-height: 1.8; max-width: 510px; margin: 0; }

/* Footer */
.site-footer { border-top: 1px solid var(--color-border); color: var(--color-muted); font-size: 14px; }
.site-footer .container { padding: 28px 0; }
.site-footer p { margin: 0 0 4px; }
.footer-brand { color: var(--color-ink); font-weight: 700; }

@media (max-width: 850px) {
  .container { width: min(calc(100% - 34px), 600px); }
  .site-header { min-height: 75px; }
  .logo { font-size: 18px; }
  .site-nav { gap: 14px; }
  .panel { padding: 22px; }
  .field-row { grid-template-columns: 1fr; }
  .hero { padding-top: 20px; }
  .hero-grid { display: flex; flex-direction: column; align-items: flex-start; min-height: 0; }
  .hero-visual { height: 320px; width: 100%; }
  .hero-visual::before { width: min(300px, 88%); height: 280px; left: 12%; }
  .hero-art { width: auto; height: 320px; max-width: 100%; }
  .hero h1 { font-size: 49px; letter-spacing: -2.5px; }
  .benefits { padding-top: 24px; }
  .benefits-grid { grid-template-columns: 1fr; gap: 20px; }
  .feature-cards { grid-template-columns: 1fr; }
  .body-copy { font-size: 15px; }
}
