/* New home (Figma V2_Home, 34:2540). Positions are Figma's, counted in grid columns:
   the content box starts at Figma x 264, one column plus its gutter is 153px. */

.home { width: var(--content); margin: 0 auto; }

/* Hero: the name's first line on columns 2–6, its second on 1–6, the text on 2–5, the
   weather widget on 7–8. The name's lines are grid items themselves (the h1 is display:
   contents), so they sit on the columns. Figma: top at y 260. */
.hero {
  margin-top: 136px; /* header ends at 100 (124 with the bar's edge), hero starts at 260 */
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  grid-template-rows: auto auto auto 1fr; /* the widget spans the last one, so it never stretches the name's rows */
  column-gap: var(--gutter);
  align-items: start;
  container-type: inline-size; /* the name's size is measured against this width (cqw) */
}
.hero__name { display: contents; }
/* --name is the name's font size: 96px, as in Figma, as long as both lines fit (content at least
   568px); narrower, just small enough that "Mezhevych" and the sound button stay on one line.
   The photo, the sound button and the gaps scale with it, so a phone keeps the desktop's
   proportions (owner, 2026-11-12: the gap between the two names was far too big on phones). */
.hero__row {
  --name: min(96px, (100cqw - 80px) / 5.1, (100cqw - 120px) / 4.54);
  display: flex; align-items: center; gap: calc(var(--name) / 3); /* 32px at 96 */
}
.hero__row--first { grid-column: 2 / 7; grid-row: 1; margin-top: 1px; }
.hero__row--second { grid-column: 1 / 7; grid-row: 2; margin-top: calc(var(--name) / 6); align-items: flex-end; gap: calc(var(--name) / 4); } /* 16 and 24px at 96 */
.hero__word {
  font-family: var(--f-display);
  font-variation-settings: "opsz" 14;
  font-weight: 500;
  font-size: var(--name);
  line-height: 0.885em; /* 85px at 96 */
  letter-spacing: -0.04em;
  color: var(--c-ink);
  white-space: nowrap;
  text-box: trim-both cap alphabetic; /* Figma trims the line box to the capitals */
}
.hero__avatar { display: block; width: calc(var(--name) * 88 / 96); height: calc(var(--name) * 88 / 96); border-radius: 50%; object-fit: cover; flex: none; }
.hero__sound { display: block; width: calc(var(--name) * 56 / 96); height: calc(var(--name) * 56 / 96); flex: none; border-radius: 50%; background: #f6f1ee; overflow: hidden; } /* PF-Neutral-100 (owner, 2026-11-02) */
/* The speaker rolls on hover like the link icons: up one button's height while its copy
   comes in from below, 0.4s, the same easing (keyframes in alt.css use 36px, so its own here) */
.hero__sound-track { display: flex; flex-direction: column; }
.hero__sound svg { display: block; width: calc(var(--name) * 56 / 96); height: calc(var(--name) * 56 / 96); flex: none; }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .hero__sound:hover .hero__sound-track { animation: sound-roll 0.4s cubic-bezier(0.645, 0.045, 0.355, 1); }
}
@keyframes sound-roll { to { transform: translateY(-50%); } } /* the track is two buttons tall: up one button */
.hero__text { grid-column: 2 / 6; grid-row: 3; margin-top: 40px; color: var(--c-body); }

/* Weather widget (weather-dots.js draws the icon, stockholm-weather.js sets data-state) */
.weather {
  grid-column: 7 / 9;
  grid-row: 1 / 5;
  position: relative;
  aspect-ratio: 1;
  border-radius: 24px;
  overflow: hidden;
  background: #ebf2ff;
  transition: background-color 0.4s ease;
}
.weather[data-state="sunny"] { background: #fff3cc; }
.weather[data-state="night"] { background: #1e2a5a; }
.weather__top {
  position: absolute;
  top: 24px;
  left: 24px;
  right: 24px;
  display: flex;
  justify-content: space-between;
  font-family: var(--f-display);
  font-variation-settings: "opsz" 14;
  font-weight: 500;
  font-size: 20px;
  line-height: 24px;
  color: var(--c-muted);
}
.weather[data-state="night"] .weather__top { color: #c9cde0; }
/* The icon's box, in shares of the 282px widget, so it scales with it (alt-weather-dots.js) */
.weather__icon { position: absolute; top: 42.2%; left: 50%; width: 65.6%; height: 40.07%; transform: translateX(-50%); }
.weather__dots { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; transition: opacity 0.4s ease; }
.weather[data-state="loading"] .weather__dots { opacity: 0; }

/* Cases: 2 x 2 cards, 4 columns each, 32px between rows. Figma: top at y 702. */
.cases {
  margin-top: 160px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px var(--gutter);
}

/* Say hi: "Say hi" on columns 1–4, the contact table on 5–8. Figma: top at y 1778. */
.contact {
  margin-top: 160px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: var(--gutter);
  align-items: start;
}
/* Each row on the grid's columns (Figma, 2026-11-02): the label on the first of the
   table's four columns, the links from the second, so they start on column 6 */
.contact__rows { display: flex; flex-direction: column; }
.contact__row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: var(--gutter);
  align-items: center;
  height: 64px;
  border-top: 1px solid var(--c-line);
}
.contact__row:last-child { border-bottom: 1px solid var(--c-line); }
.contact__label { grid-column: 1; }
.contact__row > :not(.contact__label) { grid-column: 2 / -1; justify-self: start; }
.contact__links { display: flex; align-items: center; gap: 24px; }
.contact .link { gap: 4px; } /* Figma: the icons sit 4px after the words in these rows */
/* The email address (327px at 28px, its icon 4 + 32 after) never runs past the line: on
   phones, where the label sits above it, it gets smaller if the screen is too narrow. */
.contact__rows { container-type: inline-size; }

/* Footer: under the contact table (columns 5–8), 48px below it, Kumbh Sans 16/24 in the
   label color, 120px of page below it. Figma: text at y 2018, frame 2162 tall. */
.footer {
  width: var(--content);
  margin: 48px auto 0;
  padding-bottom: 120px;
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  column-gap: var(--gutter);
  color: var(--c-label);
}
.footer p { grid-column: 5 / -1; }

/* Narrower windows: the cards stack below 1024px; the name keeps its 96px */
/* With 160px margins the name no longer fits beside the widget below 1224px: the widget
   is hidden there instead of moving under the name. */
@media (max-width: 1223px) {
  .weather { display: none; }
  .hero__row--first { grid-column: 2 / -1; }
  .hero__row--second { grid-column: 1 / -1; }
  .hero__text { grid-column: 2 / -1; max-width: 588px; }
}
/* Say hi stacks below 1360px: narrower, its half of the grid is too small for the email at
   28px after a one-column label (the row needs 492px). The footer follows it to the full width. */
@media (max-width: 1359px) {
  .contact { grid-template-columns: minmax(0, 1fr); }
  .contact__rows { margin-top: 40px; }
  .contact__row { grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); } /* full width: still the label on one column */
  .footer p { grid-column: 1 / -1; }
}
@media (max-width: 1023px) {
  .cases { grid-template-columns: minmax(0, 1fr); }
  .contact__row { grid-template-columns: repeat(4, minmax(0, 1fr)); } /* eighths get too narrow for the labels */
}
/* Below 768px the first line loses its one-column indent, so the name keeps 96px longer */
@media (max-width: 767px) {
  .hero__row--first { grid-column: 1 / -1; }
  .hero__text { grid-column: 1 / -1; } /* no indent: the text starts under the photo and fills the width (owner, 2026-11-12) */
}

/* Phones: a contact row wraps its label above its links, so the email address fits
   without scrolling sideways (the header stacks below 832px, in alt.css) */
@media (max-width: 559px) {
  /* Owner, 2026-11-12 (iPhone screenshots; 32px was too little, doubled): the name block starts 64px
     under the header's links (the bar ends 24px below them, the first row adds 1px, so 39px here), and
     the first case follows the intro text at the same 64px. The sound button is 44px, Apple's minimum touch target, so it weighs as much as the name. */
  .hero { margin-top: 39px; }
  .cases { margin-top: 64px; }
  .hero__sound, .hero__sound svg { width: 44px; height: 44px; }
  /* The 44px button is taller than the name's capitals here: centered on them instead of sitting on the
     baseline, it moves about 6px down and lines up optically with "Mezhevych" (owner, 2026-11-13). */
  .hero__row--second { align-items: center; }
  .contact__row { height: auto; min-height: 64px; padding: 14px 0; row-gap: 8px; }
  .contact__label, .contact__row > :not(.contact__label) { grid-column: 1 / -1; }
  .contact__links { flex-wrap: wrap; row-gap: 8px; } /* View and Download stack on the smallest phones */
  .contact__email { font-size: min(28px, (100cqw - 40px) / 11.7); } /* the label sits above it here */
}
