/* ==========================================================================
   Alko Intelligence — site styles
   ========================================================================== */

:root {
  --bg:        oklch(0.98 0.006 85);
  --surface:   oklch(0.99 0.004 85);
  --ink:       oklch(0.22 0.01 60);
  --ink-soft:  oklch(0.42 0.01 60);
  --muted:     oklch(0.45 0.01 60);
  --faint:     oklch(0.55 0.01 60);
  --accent:    oklch(0.5 0.14 40);
  --brand:     oklch(0.5 0.18 5);
  --line:      oklch(0.9 0.01 70);
  --line-soft: oklch(0.92 0.01 70);
  --field:     oklch(0.8 0.02 60);

  --serif: 'Newsreader', Georgia, serif;
  --sans:  'Work Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --gutter: 48px;
  --radius: 6px;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: oklch(0.32 0.01 60); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent); }
img { display: block; max-width: 100%; }

/* <picture> only carries the WebP <source>s — keep it out of the layout tree so
   the <img> stays the grid/flex item its parent expects. The <source> must be
   explicitly hidden: with the wrapper at display:contents it would otherwise
   generate its own box and take a grid cell, pushing the image off its row.
   Hiding it does not affect <picture> source selection, which runs on the DOM. */
picture { display: contents; }
picture > source { display: none; }
::selection { background: oklch(0.86 0.07 45); }

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

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Keep #contact / #solutions clear of the sticky header when jumped to. */
[id] { scroll-margin-top: 96px; }

.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;
}

/* --------------------------------------------------------------------------
   Layout helpers
   -------------------------------------------------------------------------- */

.wrap      { max-width: 1120px; margin: 0 auto; padding-inline: 32px; }
.wrap--narrow { max-width: 900px; margin: 0 auto; padding-inline: 32px; }
.bleed     { margin-inline: var(--gutter); }

.section-head { text-align: center; }
.eyebrow {
  font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent); font-weight: 600; margin-bottom: 18px;
}
.section-head h2 {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(28px, 3.6vw, 44px); line-height: 1.15; margin: 0;
}
.section-head p {
  font-size: 15px; color: var(--muted); max-width: 640px;
  margin: 20px auto 0; line-height: 1.6;
}

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

.logo {
  font-family: var(--sans); font-weight: 700; letter-spacing: -0.01em;
  color: var(--ink); white-space: nowrap;
}
.logo span { color: var(--brand); }
.logo:hover { color: var(--ink); }

/* Home: centred logo, no nav — the three cards are the only navigation. */
.masthead {
  display: flex; align-items: center; justify-content: center;
  padding: 40px 32px 0;
}
.masthead .logo { font-size: 22px; }

/* Sub-pages: sticky bar with nav */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 20px 32px;
  background: oklch(0.98 0.006 85 / 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar .logo { font-size: 19px; flex-shrink: 0; }

.btn-dark {
  display: inline-block; font-size: 14px; font-weight: 500;
  padding: 11px 18px; background: var(--ink); color: var(--bg);
  border-radius: 2px; white-space: nowrap; flex-shrink: 0;
  transition: background 0.2s;
}
.btn-dark:hover { background: oklch(0.32 0.02 45); color: var(--bg); }

/* --------------------------------------------------------------------------
   Home
   -------------------------------------------------------------------------- */

.home { display: flex; flex-direction: column; min-height: 100vh; }

.home-hero {
  text-align: center; max-width: 720px; margin: 0 auto;
  padding: 90px 32px 70px;
}
.home-hero h1 {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(36px, 5vw, 58px); line-height: 1.1;
  margin: 0 0 22px; animation: fadeUp 0.7s ease-out;
}
.home-hero p {
  font-size: 17px; line-height: 1.6; color: var(--ink-soft); margin: 0;
}

.cards {
  max-width: 1120px; margin: 0 auto; padding: 0 32px 120px;
  flex: 1; width: 100%;
}
.cards__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }

.card {
  display: block; position: relative; overflow: hidden;
  border-radius: 16px; aspect-ratio: 3 / 4;
  box-shadow: 0 16px 40px oklch(0.2 0 0 / 0.12);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.card:hover { transform: translateY(-6px); box-shadow: 0 24px 56px oklch(0.2 0 0 / 0.2); }
.card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.card::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, oklch(0.15 0.01 60 / 0.05) 40%, oklch(0.1 0.01 60 / 0.75) 100%);
}
.card__body { position: absolute; left: 28px; right: 28px; bottom: 28px; z-index: 1; }
.card__kicker {
  font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase;
  color: oklch(0.9 0.03 60); font-weight: 600; margin-bottom: 10px;
}
.card__body h2 {
  font-family: var(--serif); font-weight: 500; font-size: 24px;
  line-height: 1.2; color: oklch(0.99 0.004 85); margin: 0;
}

/* --------------------------------------------------------------------------
   Sub-page hero
   -------------------------------------------------------------------------- */

.hero {
  position: relative; margin: 24px var(--gutter) 0;
  height: 88vh; min-height: 620px;
  border-radius: var(--radius); overflow: hidden;
}
.hero > picture > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, oklch(0.15 0.01 60 / 0.15) 0%, oklch(0.1 0.01 60 / 0.55) 100%);
}
.hero__tag {
  position: absolute; top: 40px; left: 40px; z-index: 1;
  font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase;
  color: oklch(0.98 0.006 85 / 0.85); font-weight: 500;
}
.hero__body { position: absolute; left: var(--gutter); bottom: 56px; max-width: 780px; z-index: 1; }
.hero__body h1 {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(38px, 5.2vw, 74px); line-height: 1.05;
  color: oklch(0.99 0.004 85); margin: 0 0 22px;
  animation: fadeUp 0.8s ease-out;
}
.hero__body p {
  font-size: 18px; line-height: 1.55;
  color: oklch(0.95 0.006 85 / 0.9); max-width: 560px; margin: 0;
}
/* Standalone CTA pinned to the bottom-right of a hero. */
.hero__cta {
  position: absolute; right: 40px; bottom: 40px; z-index: 1;
  display: inline-block; padding: 17px 28px; border-radius: 3px;
  background: oklch(0.99 0.004 85); color: var(--ink);
  font-size: 15px; font-weight: 500; line-height: 1;
  box-shadow: 0 10px 30px oklch(0.2 0 0 / 0.28);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.hero__cta:hover {
  color: var(--ink); transform: translateY(-2px);
  box-shadow: 0 14px 36px oklch(0.2 0 0 / 0.34);
}
.hero__cta span { margin-left: 6px; color: var(--accent); }

.intro { max-width: 900px; margin: 0 auto; padding: 130px 32px 70px; text-align: center; }
.intro h2 {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(30px, 4vw, 48px); line-height: 1.15; margin: 0;
}

/* --------------------------------------------------------------------------
   Solution cards (the "flying" stack)
   -------------------------------------------------------------------------- */

.stack { max-width: 1120px; margin: 0 auto 100px; padding: 0 32px; }

.solution {
  border-radius: 20px; overflow: hidden;
  box-shadow: 0 20px 50px oklch(0.2 0 0 / 0.2);
  will-change: transform;
}
/* Each card sticks a little lower than the one before, so they fan out as
   you scroll instead of landing on top of each other. */
.stack .solution { position: sticky; margin-bottom: 28px; }
.stack .solution:last-child { margin-bottom: 0; }
.stack .solution:nth-child(1) { top:  96px; z-index: 10; }
.stack .solution:nth-child(2) { top: 124px; z-index: 20; }
.stack .solution:nth-child(3) { top: 152px; z-index: 30; }
.stack .solution:nth-child(4) { top: 180px; z-index: 40; }
.stack .solution:nth-child(5) { top: 208px; z-index: 50; }

.solution__inner {
  display: grid; grid-template-columns: 1.1fr 0.9fr;
  align-items: stretch; min-height: 460px;
}
.solution__text {
  padding: 60px; display: flex; flex-direction: column; justify-content: center;
}
.solution__kicker {
  font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase;
  font-weight: 600; margin-bottom: 16px;
}
.solution__text h3 {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(24px, 2.4vw, 34px); line-height: 1.2; margin: 0 0 18px;
}
.solution__text p { font-size: 15px; line-height: 1.55; margin: 0 0 26px; }
.solution__inner > picture > img { width: 100%; height: 100%; object-fit: cover; }

.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags span {
  font-size: 12px; padding: 6px 12px;
  border: 1px solid currentColor; border-radius: 20px;
}

.checks { display: flex; flex-direction: column; gap: 12px; margin-bottom: 26px; }
.checks li { display: flex; gap: 10px; font-size: 15px; }
.checks { list-style: none; padding: 0; }

/* Card palettes */
.solution--amber  { background: oklch(0.87 0.1 95); }
.solution--amber  .solution__kicker { color: oklch(0.3 0.05 95); }
.solution--amber  .solution__text h3 { color: oklch(0.2 0.02 95); }
.solution--amber  .solution__text p  { color: oklch(0.32 0.03 95); }
.solution--amber  .tags span { color: oklch(0.28 0.04 95); border-color: oklch(0.3 0.05 95 / 0.35); }

.solution--rust   { background: oklch(0.5 0.15 30); }
.solution--rust   .solution__kicker { color: oklch(0.92 0.05 30); }
.solution--rust   .solution__text h3 { color: oklch(0.98 0.01 30); }
.solution--rust   .solution__text p  { color: oklch(0.92 0.03 30); }
.solution--rust   .checks li { color: oklch(0.95 0.02 30); }
.solution--rust   .tags span { color: oklch(0.92 0.03 30); border-color: oklch(0.9 0.03 30 / 0.4); }

.solution--teal   { background: oklch(0.4 0.06 200); }
.solution--teal   .solution__kicker { color: oklch(0.85 0.06 200); }
.solution--teal   .solution__text h3 { color: oklch(0.97 0.01 200); }
.solution--teal   .solution__text p  { color: oklch(0.88 0.03 200); }
.solution--teal   .tags span { color: oklch(0.88 0.03 200); border-color: oklch(0.85 0.03 200 / 0.4); }

.solution--green  { background: oklch(0.42 0.09 145); }
.solution--green  .solution__kicker { color: oklch(0.85 0.08 145); }
.solution--green  .solution__text h3 { color: oklch(0.97 0.02 145); }
.solution--green  .solution__text p  { color: oklch(0.87 0.05 145); }
.solution--green  .tags span { color: oklch(0.87 0.05 145); border-color: oklch(0.85 0.05 145 / 0.4); }

.solution--purple { background: oklch(0.4 0.1 320); }
.solution--purple .solution__kicker { color: oklch(0.85 0.1 320); }
.solution--purple .solution__text h3 { color: oklch(0.97 0.02 320); }
.solution--purple .solution__text p  { color: oklch(0.87 0.06 320); }
.solution--purple .tags span { color: oklch(0.87 0.06 320); border-color: oklch(0.85 0.06 320 / 0.4); }

/* --------------------------------------------------------------------------
   Content blocks
   -------------------------------------------------------------------------- */

.block { max-width: 1120px; margin: 0 auto 110px; padding: 0 32px; }
.block .section-head { margin-bottom: 60px; }

.trio { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }

.plain p { font-size: 14px; color: var(--muted); line-height: 1.55; margin: 0; }

.plain { text-align: center; padding: 8px; }
.plain h3 { font-size: 18px; font-weight: 600; margin: 0 0 12px; }
.plain h3.serif { font-family: var(--serif); font-size: 22px; font-weight: 500; }

.chips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.chips li {
  padding: 28px 24px; border-radius: 14px; background: var(--surface);
  border: 1px solid var(--line); font-size: 15px; font-weight: 600;
}
.chips { list-style: none; padding: 0; margin: 0; }

/* --------------------------------------------------------------------------
   Message box
   -------------------------------------------------------------------------- */

.message { max-width: 640px; margin: 0 auto; padding: 0 32px 100px; text-align: center; }
.message h2 {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(24px, 2.6vw, 32px); margin: 0 0 14px; line-height: 1.2;
}
.message > p { font-size: 14px; color: var(--muted); margin: 0 0 28px; line-height: 1.5; }

.message form { display: flex; flex-direction: column; gap: 14px; text-align: left; }
.message__row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.message input,
.message textarea,
.message select {
  width: 100%; padding: 14px 16px;
  border: 1px solid var(--field); border-radius: 3px;
  font-size: 15px; font-family: inherit; color: var(--ink);
  background: var(--surface);
  transition: border-color 0.2s;
}
.message input:focus,
.message textarea:focus,
.message select:focus { border-color: var(--accent); outline: none; }
.message textarea { resize: vertical; min-height: 110px; }
.message select { appearance: none; cursor: pointer; padding-right: 42px;
  background-image: linear-gradient(45deg, transparent 50%, oklch(0.45 0.01 60) 50%),
                    linear-gradient(135deg, oklch(0.45 0.01 60) 50%, transparent 50%);
  background-position: calc(100% - 22px) 22px, calc(100% - 16px) 22px;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}
/* Placeholder option stays grey until a real choice is made. */
.message select:has(option[value=""]:checked) { color: oklch(0.55 0.01 60); }
.message input[aria-invalid="true"],
.message textarea[aria-invalid="true"],
.message select[aria-invalid="true"] { border-color: oklch(0.55 0.19 25); }

.message button {
  align-self: center; padding: 15px 34px;
  background: var(--ink); color: var(--bg);
  border: none; border-radius: 3px;
  font-size: 15px; font-weight: 500; font-family: inherit;
  cursor: pointer; transition: background 0.2s;
}
.message button:hover:not(:disabled) { background: oklch(0.32 0.02 45); }
.message button:disabled { opacity: 0.6; cursor: default; }

/* Honeypot — hidden from humans, tempting to bots */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form-status {
  margin: 0; padding: 14px 18px; border-radius: 8px;
  font-size: 14px; font-weight: 500; text-align: center;
}
.form-status[hidden] { display: none; }
.form-status--ok  { background: oklch(0.93 0.06 150); color: oklch(0.35 0.09 150); }
.form-status--err { background: oklch(0.93 0.05 25);  color: oklch(0.42 0.16 25); }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.site-footer { padding: 60px var(--gutter) 40px; border-top: 1px solid var(--line); }
.site-footer__inner {
  max-width: 1120px; margin: 0 auto;
  display: grid; grid-template-columns: 1.6fr 1fr; gap: 40px;
  margin-bottom: 50px;
}
.site-footer .logo { display: block; font-size: 18px; margin-bottom: 12px; }
.site-footer__blurb {
  font-size: 14px; color: var(--muted); line-height: 1.6; max-width: 320px; margin: 0;
}
.site-footer h2 {
  font-size: 13px; letter-spacing: 0.04em; text-transform: uppercase;
  font-weight: 600; color: oklch(0.4 0.01 60); margin: 0 0 16px;
}
.site-footer ul {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 10px; font-size: 14px;
}
.site-footer__legal {
  max-width: 1120px; margin: 0 auto; padding-top: 30px;
  border-top: 1px solid var(--line-soft);
  font-size: 13px; color: var(--faint);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 900px) {
  :root { --gutter: 20px; }

  .cards__grid { grid-template-columns: 1fr; gap: 20px; }
  .card { aspect-ratio: 4 / 3; }

  .topbar { padding: 16px 20px; }

  .hero { height: auto; min-height: 0; padding: 120px 0 28px; }
  /* Text sits over the full photo here, not just its darkened base, so the
     overlay has to carry contrast the whole way up. */
  .hero::after {
    background: linear-gradient(180deg, oklch(0.15 0.01 60 / 0.45) 0%, oklch(0.1 0.01 60 / 0.7) 100%);
  }
  .hero__tag { top: 24px; left: 24px; }
  /* Must stay positioned, or z-index is ignored and the absolutely-positioned
     hero image paints straight over the heading. */
  .hero__body { position: relative; inset: auto; padding: 0 24px 8px; max-width: none; }
  /* Let the CTA flow under the hero copy instead of overlapping it. */
  .hero__cta {
    position: relative; inset: auto; z-index: 1;
    display: block; margin: 20px 24px 0; text-align: center;
  }

  .intro { padding: 70px 24px 50px; }

  .solution__inner { grid-template-columns: 1fr; min-height: 0; }
  .solution__inner img { max-height: 260px; grid-row: 1; }
  .solution__text { padding: 36px 28px; grid-row: 2; }
  /* Stacking only works with room to scroll — go static on small screens. */
  .stack .solution { position: static; margin-bottom: 20px; transform: none !important; }

  .trio, .chips { grid-template-columns: 1fr; gap: 20px; }
  .block { margin-bottom: 70px; }

  .message__row { grid-template-columns: 1fr; }
  .site-footer__inner { grid-template-columns: 1fr; gap: 32px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .stack .solution { transform: none !important; }
}
