/* hgb.fi. The company speaks in the logo's slate and a serif voice (Source Serif 4, SIL OFL);
   each product tile carries its own brand (Palautus cream and amber, Mates navy) and its own face (Montserrat, SIL OFL). */
@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/assets/fonts/source-serif-4-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("/assets/fonts/montserrat-latin.woff2") format("woff2");
}

:root {
  /* Company */
  --slate: #333442;
  --slate-deep: #2A2B37;
  --rule: #4A4C5E;
  --paper: #F2EFE8;
  --mist: #B8B9C6;
  --amber-light: #E5A93F;
  /* Palautus */
  --p-cream: #FAF6F0;
  --p-ink: #1D1B18;
  --p-muted: #6E675D;
  --p-amber: #9A6210;
  /* Mates */
  --m-navy: #0D0E24;
  --m-glow: #F5A524;
  --m-muted: #ABA8BC;

  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --product: "Montserrat", var(--sans);
  --ease: cubic-bezier(.22, 1, .36, 1);
  --gutter: 1.5rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--slate); color: var(--paper); font: 400 1.0625rem/1.65 var(--serif); font-optical-sizing: auto; -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, p, ul, dl, dd { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--amber-light); outline-offset: 3px; border-radius: 4px; }
.skip { position: absolute; left: 1rem; top: -4rem; z-index: 10; padding: .75rem 1rem; border-radius: .5rem; background: var(--paper); color: var(--slate); font-family: var(--sans); }
.skip:focus { top: 1rem; }

/* Header: the logo and the navigation */
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; max-width: 76rem; margin: 0 auto; padding: 1.25rem var(--gutter); }
.site-header .brand img { width: auto; height: 2.75rem; }
.site-header ul { display: flex; flex-wrap: wrap; gap: 0 1.5rem; }
.site-header nav a { display: inline-flex; align-items: center; min-height: 2.75rem; font: 500 .875rem/1 var(--sans); color: var(--mist); text-decoration: none; }
.site-header nav a:hover { color: var(--paper); }

/* Hero: the logo, one line, then the two products */
.hero { max-width: 76rem; margin: 0 auto; padding: clamp(2.5rem, 8vh, 5rem) var(--gutter) 0; text-align: center; }
.hero-intro { text-align: left; }
.hero-intro h1 { max-width: 17ch; font: 600 clamp(2.75rem, 6.4vw, 5.75rem)/1.02 var(--serif); letter-spacing: -.03em; }
.intro-row { margin-top: 2rem; }
.intro-row .intro-links { margin-top: 1.75rem; }
.hero-intro .sub { max-width: 38rem; font: 400 clamp(1.125rem, 1.8vw, 1.375rem)/1.5 var(--serif); color: var(--mist); }
.intro-links { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.5rem; font: 600 .9375rem/1 var(--sans); }
.intro-links a { display: inline-flex; align-items: center; min-height: 2.75rem; color: var(--amber-light); }
.intro-links a:first-child { padding: 0 1.375rem; border-radius: 999px; background: var(--paper); color: var(--slate); text-decoration: none; }
.intro-links a:first-child:hover { background: #fff; }

/* Shipped: a dated record of what is live, read left to right */
.shipped { margin-top: clamp(3rem, 7vh, 4.5rem); }
.shipped ol { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--rule); }
.shipped li { position: relative; padding-top: 1.5rem; }
.shipped li::before { content: ""; position: absolute; left: 0; top: -.3125rem; width: .5625rem; height: .5625rem; border-radius: 50%; background: var(--slate); box-shadow: inset 0 0 0 2px var(--amber-light); }
.shipped li:last-child::before { background: var(--amber-light); }
.shipped time { font: 600 .875rem/1.4 var(--sans); color: var(--amber-light); }
.shipped p { margin-top: .3rem; max-width: 22rem; font: 400 1.0625rem/1.5 var(--serif); color: var(--paper); }

.tiles { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: auto auto; gap: 2rem 1.25rem; margin-top: clamp(3.5rem, 9vh, 6rem); text-align: center; }
.product { display: grid; grid-row: span 2; grid-template-rows: subgrid; gap: 2rem; }
.tile { display: flex; flex-direction: column; min-height: clamp(31rem, 50vw, 40rem); padding-bottom: 2rem; border-radius: 1.75rem; font-family: var(--product); }
.tile-text { padding: clamp(2rem, 4vw, 3rem) 1.5rem 0; }
.tile h2 { display: inline-flex; align-items: center; gap: .65rem; font: 800 clamp(1.75rem, 3vw, 2.375rem)/1.1 var(--product); letter-spacing: -.03em; }
.tile h2 img { width: auto; height: 2.125rem; }
.tile-palautus h2 img { height: 2.5rem; }
.tile-line { margin-top: .6rem; font: 500 clamp(1rem, 1.5vw, 1.1875rem)/1.4 var(--product); }
.tile-links { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: .25rem 1.25rem; margin-top: 1.5rem; font-size: .9375rem; font-weight: 600; }
.tile-links a { display: inline-flex; align-items: center; min-height: 2.75rem; }
.tile-links .tile-btn { padding: 0 1.25rem; border-radius: 999px; text-decoration: none; transition: filter .2s; }
.tile-links .tile-btn:hover { filter: brightness(1.1); }
.tile-media { flex: 1; min-height: 0; display: flex; justify-content: center; align-items: flex-start; margin-top: 2.25rem; }

.tile-palautus { background: var(--p-cream); color: var(--p-ink); padding-bottom: 0; overflow: clip; }
.tile-palautus .tile-media { flex: 1 1 0; min-height: 16rem; overflow: clip; }
.tile-palautus .tile-line { color: var(--p-muted); }
.tile-palautus .tile-links a { color: var(--p-amber); }
.tile-palautus .tile-links .tile-btn { background: var(--p-amber); color: #fff; }
.tile-palautus :focus-visible { outline-color: var(--p-amber); }
.phone { width: clamp(13rem, 21vw, 16rem); padding: .45rem; border-radius: 2.4rem; background: #0B0B0F; box-shadow: inset 0 0 0 1.5px #3A3A44, 0 2rem 3.5rem -1.5rem #0000004D; }
.phone .screen { position: relative; overflow: hidden; border-radius: 1.95rem; aspect-ratio: 1560 / 3376; background: #fff; }
.phone .screen img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top; }
.phone .screen::after { content: ""; position: absolute; top: 2.2%; left: 50%; width: 31%; height: 3.4%; transform: translateX(-50%); border-radius: 999px; background: #000; }

.tile-mates { background: var(--m-navy); color: #fff; }
.tile-mates .tile-line { color: var(--m-muted); }
.tile-mates .tile-links .tile-btn { background: var(--m-glow); color: var(--m-navy); }
.mates { display: grid; grid-template-columns: repeat(3, 1fr); align-content: start; gap: 1rem .75rem; padding: 0 clamp(1.25rem, 3vw, 2.25rem); }
.mates img { width: 100%; aspect-ratio: 1; border-radius: 1rem; }
.mates span { display: block; margin-top: .5rem; font-size: .75rem; font-weight: 600; color: var(--m-muted); }

/* What each product does, under its own tile */
.details { display: grid; align-content: start; gap: .9rem; padding: 0 .5rem; text-align: left; }
.details li { font: 400 .9375rem/1.55 var(--sans); color: var(--mist); }
.details strong { color: var(--paper); font-weight: 600; }

/* Company sections */
.band { max-width: 68rem; margin: 0 auto; padding: clamp(4.5rem, 10vh, 6.5rem) var(--gutter); }
.band + .band { border-top: 1px solid var(--rule); }
.hero + .band { margin-top: clamp(3rem, 8vh, 5rem); border-top: 1px solid var(--rule); }
.band h2 { font: 600 clamp(2rem, 4vw, 2.875rem)/1.1 var(--serif); letter-spacing: -.015em; }
.lead { margin-top: 1.25rem; max-width: 36rem; font-size: clamp(1.125rem, 1.7vw, 1.3125rem); line-height: 1.6; color: var(--mist); }

.split { display: grid; grid-template-columns: 1.25fr 1fr; gap: clamp(2.5rem, 6vw, 5rem); align-items: start; }
.facts { font-family: var(--sans); }
.facts div { display: grid; grid-template-columns: 7.5rem 1fr; gap: 1rem; padding: .85rem 0; border-top: 1px solid var(--rule); font-size: .9375rem; }
.facts div:last-child { border-bottom: 1px solid var(--rule); }
.facts dt { color: var(--mist); }

.principles { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem 3.5rem; margin-top: clamp(3rem, 6vw, 4rem); }
.principles div { padding-left: 1.25rem; border-left: 2px solid var(--amber-light); }
.principles dt { font: 600 1.3125rem/1.3 var(--serif); }
.principles dd { margin-top: .5rem; font: 400 .9375rem/1.6 var(--sans); color: var(--mist); }

.team { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2.5rem 2rem; margin-top: 2.75rem; }
.team img { width: 7.5rem; height: 7.5rem; border-radius: 50%; object-fit: cover; margin-bottom: 1.25rem; }
.team h3 { font: 600 1.25rem/1.25 var(--serif); }
.team .role { margin: .3rem 0 .6rem; font: 600 .875rem/1.4 var(--sans); color: var(--amber-light); }
.team p:last-child { font: 400 .9375rem/1.55 var(--sans); color: var(--mist); }

.contact { text-align: center; }
.contact .lead { margin-left: auto; margin-right: auto; }
.btn { display: inline-flex; align-items: center; min-height: 3rem; margin-top: 2rem; padding: 0 1.75rem; border-radius: 999px; background: var(--paper); color: var(--slate); font: 600 1rem/1 var(--sans); text-decoration: none; transition: background-color .2s; }
.btn:hover { background: #fff; }

.footer { display: grid; justify-items: center; gap: .5rem; padding: 3rem var(--gutter) 2.5rem; background: var(--slate-deep); text-align: center; font: 400 .8125rem/1.5 var(--sans); color: var(--mist); }
.footer img { width: 6rem; margin-bottom: .75rem; opacity: .9; }

/* Palautus phone: extra screens stacked over the home screen, shown only where scroll timelines run */
.phone .screen .shot { opacity: 0; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Motion, part 1: on load, the logo, then the line, then the two products */
@media (prefers-reduced-motion: no-preference) {
  .hero-intro h1, .intro-row { animation: rise 1.1s var(--ease) both; }
  .intro-row { animation-delay: .15s; }
  .shipped li { animation: rise .9s var(--ease) both; }
  .shipped li:nth-child(1) { animation-delay: .3s; }
  .shipped li:nth-child(2) { animation-delay: .45s; }
  .shipped li:nth-child(3) { animation-delay: .6s; }
  .product { animation: rise 1.1s var(--ease) both; }
  .product:first-child { animation-delay: .45s; }
  .product:last-child { animation-delay: .6s; }
}
@keyframes rise { from { opacity: 0; transform: translateY(2.5rem); } }

/* Motion, part 2: tied to scrolling, Apple-style, where the browser supports scroll timelines */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    /* The logo and line recede as you scroll past them */
    .hero-intro { animation: recede linear both; animation-timeline: view(); animation-range: exit 0% exit 100%; }
    @keyframes recede { to { opacity: 0; transform: scale(.88) translateY(-1.5rem); } }

    /* The tiles grow to full size as they come into view */
    .tile { animation: grow linear both; animation-timeline: view(); animation-range: entry 0% cover 45%; }
    @keyframes grow { from { transform: scale(.93); } }

    /* The Palautus phone moves through the year: capture, home, report */
    .tile-palautus .screen { view-timeline: --palautus block; }
    .tile-palautus .screen .shot-capture { animation: fade-in linear both reverse; animation-timeline: --palautus; animation-range: cover 28% cover 36%; }
    .tile-palautus .screen .shot-summary { animation: fade-in linear both; animation-timeline: --palautus; animation-range: cover 48% cover 56%; }
    @keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

    /* The mates arrive one after another */
    .mates li { animation: pop linear both; animation-timeline: view(); animation-range: entry 0% entry 90%; }
    .mates li:nth-child(3n+2) { animation-range: entry 15% entry 100%; }
    .mates li:nth-child(3n) { animation-range: entry 30% cover 15%; }
    @keyframes pop { from { opacity: 0; transform: translateY(1.5rem) scale(.9); } }

    /* The company paragraph lights up word by word */
    .words-ready { view-timeline: --words block; }
    .words-ready .word { opacity: .2; animation: word-on linear both; animation-timeline: --words;
      animation-range: cover calc(8% + var(--i) / var(--n) * 30%) cover calc(14% + var(--i) / var(--n) * 30%); }
    @keyframes word-on { to { opacity: 1; } }

    /* Sections and their items rise in as they enter */
    .reveal, .reveal-each > * { animation: rise-in linear both; animation-timeline: view(); animation-range: entry 0% cover 25%; }
    .reveal-each > :nth-child(2) { animation-range: entry 10% cover 28%; }
    .reveal-each > :nth-child(3) { animation-range: entry 20% cover 31%; }
    .reveal-each > :nth-child(4) { animation-range: entry 30% cover 34%; }
    @keyframes rise-in { from { opacity: 0; transform: translateY(3rem); } }
  }
}

/* Responsive */
@media (max-width: 900px) {
  .split { grid-template-columns: 1fr; }
  .team { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .tiles { grid-template-columns: 1fr; gap: 3rem; }
  .product { grid-row: auto; grid-template-rows: auto; gap: 1.75rem; }
  .principles { grid-template-columns: 1fr; }
  .shipped ol { grid-template-columns: 1fr; gap: 0; border-top: 0; border-left: 1px solid var(--rule); }
  .shipped li { padding: 0 0 1.5rem 1.5rem; }
  .shipped li::before { left: -.3125rem; top: .4rem; }
}
@media (max-width: 520px) {
  :root { --gutter: 1rem; }
  .site-header { gap: .75rem; }
  .site-header ul { gap: 0 .875rem; }
  .site-header nav a { font-size: .8125rem; }
  .site-header .brand img { height: 2rem; }
  .team { grid-template-columns: 1fr; }
  .facts div { grid-template-columns: 1fr; gap: .125rem; }
  .mates span { font-size: .6875rem; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
@media (prefers-contrast: more) { .words-ready .word { opacity: 1; animation: none; } }
.logo-404 { width: 12rem; margin: 0 auto 2rem; }
