/* ==========================================================================
   LANDING — the home page's own layer (main.lp), on top of theme-profile.

   Register: flat, typographic and sparse. One grotesque set very large, one
   italic serif for the asides, one red with its warm family as solid fields, black
   hairlines, square corners. One idea per screen and a lot of air: no glows,
   shadows, cards, pills, icons or drawn-in fake product UI.

   The palette, the flat page, the nav and the footer come from
   theme-profile.css, which every page shares. This file holds only what the
   home page adds: the switch hero, the pinned "we can" tiles, the index
   rows, the Tawakkalna field, rent/own and the closing wordmark.
   ========================================================================== */

/* ---------- the nav over the hero ---------- */
/* Over the hero the bar is clear, its text is paper and the small mark is
   hidden (the hero carries the name). That is the state the page opens in,
   so it is the default here; the script adds html.lp-past once the hero has
   scrolled away. */
html.theme-profile:has(main.lp) .nav { transition: none; }
html.theme-profile:has(main.lp):not(.lp-past) .nav,
html.theme-profile:has(main.lp):not(.lp-past) .nav.is-scrolled { background: transparent; box-shadow: none; }
html.theme-profile:has(main.lp):not(.lp-past) .nav-mark { opacity: 0; pointer-events: none; }
html.theme-profile:has(main.lp):not(.lp-past) .nav-link { color: var(--canvas); transition: color 0.9s ease; }
html.theme-profile:has(main.lp):not(.lp-past) .nav-link::after { background: var(--canvas); }
html.theme-profile:has(main.lp):not(.lp-past) .menu-btn i { background: var(--canvas); }
/* ...and ink while the hero is still paper (before the switch is thrown) */
html.theme-profile:has(.lp-mast.is-off):not(.lp-past) .nav-link { color: var(--ink); }
html.theme-profile:has(.lp-mast.is-off):not(.lp-past) .nav-link::after,
html.theme-profile:has(.lp-mast.is-off):not(.lp-past) .menu-btn i { background: var(--ink); }
html.theme-profile.lp-past:has(main.lp) .nav-mark { transition: opacity 0.3s; }
/* ---------- base ---------- */
.lp {
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-sans);
}
.lp-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* small uppercase label: the only "eyebrow" on the page */
.lp-label,
.lp-strip,
.lp-mast-links,
.lp-tile small {
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

/* the statement size: sentence case, tight, medium weight */
.lp-big {
  font-size: clamp(1.75rem, 4.15vw, 4.5rem);
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -0.038em;
  text-wrap: balance;
}

/* a link is an underline, not a button */
.lp-link {
  display: inline-block;
  color: inherit;
  background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1px no-repeat;
  padding-bottom: 1px;
  transition: background-size 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.lp-link::after { content: "\00a0\2197"; }
.lp-link:hover { background-size: 0 1px; background-position: 100% 100%; }

/* the page grid: a narrow label column, then the content */
.lp-sec { padding: clamp(96px, 13vw, 220px) var(--gutter) 0; }
.lp-head,
.lp-say,
.lp-flag-grid,
.lp-close-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 3fr);
  gap: clamp(16px, 2vw, 32px);
}
.lp-head { margin-bottom: clamp(32px, 5vw, 80px); }
.lp-head .lp-big { max-width: 22ch; }
.lp-head--row { margin-bottom: 14px; }
.lp-cms:has(.teasers:empty),
.lp-cms:has(.quotes-grid:empty),
.lp-cms:has(.notes-grid:empty) { display: none; }

/* ==========================================================================
   MAST
   ========================================================================== */
/* the hero holds still for a short scroll while the switch is thrown */
html.lp-scrub .lp-pin { height: 155vh; height: calc(100svh + 55vh); }

.lp-mast {
  --p: 1;                 /* how far the knob has travelled, 0 to 1 */
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100svh;
  min-height: 420px;
  padding-top: var(--nav-h);
  overflow: hidden;
  background: var(--red);
  color: var(--canvas);
  transition: background-color 0.9s ease, color 0.9s ease;
}
/* before the switch is thrown the hero is plain paper */
.lp-mast.is-off { --p: 0; background: var(--canvas); color: var(--ink); }

/* the sheet of lines behind the switch (three.js) */
.lp-scene { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; pointer-events: none; }
.lp-switch-wrap,
.lp-mast-row { position: relative; z-index: 1; }

/* The switch is the name. Three pieces of text sit in the pill: "we", "can"
   and "'t". The knob is as wide as the first and last piece, so wherever it
   rests it hides one of them: "can't" at the start, "we can" at the end.
   All sizes are in em; the script sets the font size so the pill spans the
   page, and the calc below is the same sum for when it has not run. */
.lp-switch-wrap {
  margin-block: auto;
  padding: clamp(20px, 3vw, 48px) var(--gutter);
  font-size: calc((100vw - 2 * var(--gutter)) / 4.75);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.055em;
}
.lp-switch {
  --knob: 1.46em;
  position: relative;
  display: flex;
  align-items: center;
  width: max-content;
  height: 1.2em;
  padding: 0 0.1em 0.06em;
  border-radius: 999px;
  background: var(--ink);
  color: var(--canvas);
  user-select: none;
}
.lp-mast.is-off .lp-switch { cursor: pointer; }
.sw-we,
.sw-t { flex: none; box-sizing: border-box; width: var(--knob); }
/* both sit in from the knob's round corners, so nothing shows past it */
.sw-we { padding-right: 0.1em; text-align: right; }
.sw-t { padding-left: 0.1em; text-align: left; }
.sw-can { margin-left: 0.03em; }
.sw-knob {
  position: absolute;
  top: 0.1em;
  bottom: 0.1em;
  left: calc(0.1em + var(--p) * (100% - var(--knob) - 0.24em));
  width: calc(var(--knob) + 0.04em);
  border-radius: 999px;
  background: var(--red);
  transition: background-color 0.9s ease;
}
.lp-mast.is-off .sw-knob { background: var(--canvas); }

/* the rest of the sentence, under the switch */
.lp-mast-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px clamp(24px, 4vw, 64px);
  padding: 0 var(--gutter) clamp(20px, 2.4vw, 36px);
}
.lp-mast-line {
  max-width: 15ch;
  font-size: clamp(1.75rem, 4.15vw, 4.5rem);
  font-weight: 500;
  line-height: 0.98;
  letter-spacing: -0.038em;
  text-wrap: balance;
}
/* the sentence ends on a question while the switch is off, a full stop once it is on */
/* both marks take the same room, so the line never re-wraps when it changes */
.lp-mast-line::after { content: "."; display: inline-block; width: 0.5em; }
.lp-mast.is-off .lp-mast-line::after { content: "?"; }
.lp-mast-links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px clamp(18px, 2vw, 32px); padding-bottom: 0.5em; white-space: nowrap; }

/* the closing wordmark: full measure, cropped to its x-height. --ink-h and
   --ink-top are the letters' height and offset in em; the script measures
   them from the loaded font, these are Switzer's. */
.lp-word {
  --ink-h: 0.566;
  --ink-top: 0.314;
  padding: 0 var(--gutter);
  font-size: 33vw;
  font-weight: 600;
  letter-spacing: -0.065em;
  line-height: 1;
  user-select: none;
}
.lp-word > span {
  display: block;
  width: max-content;
  height: calc(var(--ink-h) * 1em);
  padding-right: 0.065em;
  overflow: hidden;
  white-space: nowrap;
}
.lp-word em { display: block; font-style: normal; transform: translateY(calc(var(--ink-top) * -1em)); }
.lp-word b { display: inline-block; font-weight: inherit; }

/* ==========================================================================
   STATEMENT
   ========================================================================== */
.lp-say { padding: clamp(96px, 14vw, 240px) var(--gutter); }

/* ==========================================================================
   WE CAN — the name stays put, the endings pass over it
   ========================================================================== */
.lp-can { position: relative; }
.lp-can-pin {
  position: sticky;
  top: 0;
  display: grid;
  place-items: center;
  height: 100vh;
  height: 100svh;
  pointer-events: none;
}
.lp-can-pin span {
  font-size: 21.5vw;
  font-weight: 600;
  line-height: 0.8;
  letter-spacing: -0.065em;
  text-transform: uppercase;
  white-space: nowrap;
}
.lp-tiles {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 34vh;
  margin: -100vh 0 0;
  margin-top: -100svh;
  padding: 78vh var(--gutter) 34vh;
  list-style: none;
}
.lp-tile {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  width: min(33vw, 520px);
  aspect-ratio: 1;
  margin-left: var(--x);
  padding: clamp(14px, 1.5vw, 24px);
  background: var(--bg);
  color: var(--canvas);
  transition: background-color 0.9s ease;
}
.lp-tile.is-light { color: var(--ink); }
/* the Lindi tile wears Lindi's blue and logo, and links out */
.lp-tile.is-lindi { --lindi-l: #FFFFFF; background: #2153D4; color: #fff; }
.lp-tile-lindi { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: inherit; }
.lp-tile-lindi svg { display: block; width: clamp(84px, 9vw, 132px); aspect-ratio: 169 / 46; height: auto; }
.lp-tile-lindi span { font-size: 0.78rem; font-weight: 500; letter-spacing: 0.02em; text-transform: uppercase; }
.lp-tile-lindi span::after { content: "\00a0\2197"; }
/* the uTestMe tile: its lime, its mark and wordmark */
.lp-tile.is-utest { background: #E0ECA7; color: #17191C; }
/* Meduza, our device: the render sits in the tile, the wordmark links to its section */
.lp-tile-img { display: block; flex: 1 1 0; min-height: 0; width: 100%; object-fit: contain; }
.lp-tile-meduza { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; color: inherit; }
.lp-tile-meduza .meduza-word { font-size: clamp(1.1rem, 1.7vw, 1.6rem); }
.lp-tile-meduza span:last-child { font-size: 0.78rem; font-weight: 500; letter-spacing: 0.02em; text-transform: uppercase; }
.lp-tile-meduza span:last-child::after { content: "\00a0\2193"; }
.lp-tile-utest { display: flex; align-items: center; gap: 0.4em; color: inherit; }
.lp-tile-utest svg { display: block; width: clamp(24px, 2.4vw, 34px); height: auto; aspect-ratio: 1; }
.lp-tile-utest .utest-word { font-size: clamp(1.2rem, 1.9vw, 1.8rem); }
.lp-tile-utest .utest-go { margin-left: auto; background: none; padding: 0; }
.lp-tile p {
  font-size: clamp(1.7rem, 3.5vw, 4rem);
  font-weight: 500;
  line-height: 0.96;
  letter-spacing: -0.04em;
}
.lp-tile.is-serif p {
  font-family: var(--font-aside);
  font-style: italic;
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.025em;
}
.lp-tile.is-num p { font-size: clamp(1.2rem, 1.9vw, 2rem); line-height: 1.02; letter-spacing: -0.03em; }
.lp-tile.is-num b {
  display: block;
  margin: 0.04em 0 0.08em -0.04em;
  font-size: clamp(4.4rem, 10.4vw, 11rem);
  font-weight: 600;
  line-height: 0.8;
  letter-spacing: -0.07em;
}
.lp-tile small:first-child { font-size: 1.4rem; line-height: 0.6; letter-spacing: 0; }

/* ==========================================================================
   WHAT WE DO — rows
   ========================================================================== */
.lp-rows { border-top: 1px solid var(--ink); }
.lp-row { position: relative; isolation: isolate; border-bottom: 1px solid var(--ink); transition: color 0.3s; }
.lp-row::before {
  content: "";
  position: absolute;
  inset: 0 calc(var(--gutter) * -1);
  z-index: -1;
  background: var(--red);
  transform: scaleY(0);
  transform-origin: 50% 100%;
  transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.lp-row:hover::before,
.lp-row.is-open::before { transform: scaleY(1); }
.lp-row:hover,
.lp-row.is-open { color: var(--canvas); }
.lp-row-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 3fr);
  gap: 0 clamp(16px, 2vw, 32px);
  align-items: start;
  width: 100%;
  padding: clamp(12px, 1.3vw, 20px) 0 clamp(10px, 1.1vw, 16px);
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
}
.lp-row-n,
.lp-row-note { font-size: 0.78rem; font-weight: 500; letter-spacing: 0.02em; text-transform: uppercase; }
.lp-row-n { grid-row: 1 / span 2; padding-top: 0.35em; }
.lp-row-title {
  padding-right: 1.2em;
  font-size: clamp(1.9rem, 6vw, 6.4rem);
  font-weight: 500;
  line-height: 0.9;
  letter-spacing: -0.055em;
  text-transform: uppercase;
}
.lp-row-note { grid-column: 2; margin-top: clamp(8px, 0.9vw, 14px); }
.lp-row-x {
  position: absolute;
  top: clamp(16px, 2.1vw, 34px);
  right: 0;
  width: clamp(18px, 2.6vw, 40px);
  aspect-ratio: 1;
}
.lp-row-x::before,
.lp-row-x::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 2px;
  margin-top: -1px;
  background: currentColor;
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.lp-row-x::after { transform: rotate(90deg); }
.lp-row.is-open .lp-row-x::after { transform: rotate(0deg); }
/* the Lindi row fills with Lindi's blue and carries its buttons */
.lp-row.is-lindi::before { background: #2153D4; }
/* ...and the uTestMe row with uTestMe's lime, dark text and square buttons */
.lp-row.is-utest::before { background: #E0ECA7; }
.lp-row.is-utest:hover,
.lp-row.is-utest.is-open { color: #17191C; }
.lp-row.is-utest .lp-row-title { text-transform: none; }
/* ...and the Meduza row with Meduza's ink and its square red buttons */
.lp-row.is-meduza::before { background: var(--ink); }
.lp-row-cta { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 clamp(20px, 2.4vw, 32px) calc(25% + clamp(16px, 2vw, 32px) * 0.75); }

.lp-row-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.5s cubic-bezier(0.2, 0.8, 0.2, 1); }
.lp-row.is-open .lp-row-body { grid-template-rows: 1fr; }
.lp-row-body > div { min-height: 0; overflow: hidden; }
.lp-row-body ul {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 clamp(16px, 2vw, 32px);
  margin: clamp(10px, 1.6vw, 24px) 0 clamp(16px, 2vw, 28px) calc(25% + clamp(16px, 2vw, 32px) * 0.75);
  list-style: none;
}
.lp-row-body li { padding: 9px 0; border-top: 1px solid currentColor; font-size: 0.95rem; line-height: 1.3; }

/* ==========================================================================
   FLAGSHIP — black field
   ========================================================================== */
.lp-strip {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid currentColor;
}
.lp-flag {
  margin-top: clamp(96px, 13vw, 220px);
  padding: 0 var(--gutter) clamp(20px, 2.4vw, 36px);
  background: var(--ink);
  color: var(--canvas);
}
/* a word set to the full measure; the script sizes it, this is the fallback */
.lp-fit {
  font-size: 20vw;
  font-weight: 600;
  line-height: 0.86;
  letter-spacing: -0.065em;
  white-space: nowrap;
  overflow: hidden;
}
.lp-fit > span { display: inline-block; padding-right: 0.065em; }
.lp-flag .lp-fit { margin: clamp(12px, 2vw, 32px) 0 clamp(56px, 8vw, 136px); }
.lp-field { margin-top: clamp(64px, 9vw, 152px); }
.lp-field canvas { display: block; width: 100%; aspect-ratio: 28 / 9; }
.lp-field figcaption {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid currentColor;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

/* ==========================================================================
   OWN
   ========================================================================== */
.lp-own {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 1fr);
  gap: clamp(16px, 2vw, 32px);
  align-items: end;
  padding: clamp(96px, 13vw, 220px) var(--gutter) 0;
}
.lp-own-word {
  display: grid;
  justify-items: start;
  font-size: 25.5vw;
  font-weight: 600;
  line-height: 0.8;
  letter-spacing: -0.07em;
  text-transform: uppercase;
}
.lp-own-word span { display: block; margin-left: -0.045em; }
.lp-rent { position: relative; color: var(--ink-40); }
.lp-rent::after {
  content: "";
  position: absolute;
  left: -0.02em;
  right: 0.02em;
  top: 47%;
  height: 0.06em;
  background: var(--red);
  transform: scaleX(var(--strike, 1));
  transform-origin: 0 50%;
}
.lp-own-copy { display: grid; gap: 14px; justify-items: start; padding-bottom: 0.6vw; }
.lp-own-copy p:not(.lp-label) { font-size: 1.05rem; line-height: 1.35; }

/* ==========================================================================
   CLOSE — red field, the name puts itself the right way round
   ========================================================================== */
.lp-close {
  margin-top: clamp(96px, 13vw, 220px);
  padding: clamp(20px, 2.4vw, 36px) 0 0;
  background: var(--red);
  color: var(--canvas);
  overflow: hidden;
  transition: background-color 0.9s ease;
}
.lp-close .lp-word { color: var(--ink); }
.lp-close-top { padding: 0 var(--gutter) clamp(72px, 11vw, 190px); }
.lp-close-links { display: flex; flex-wrap: wrap; gap: 8px clamp(20px, 3vw, 48px); margin-top: clamp(24px, 3vw, 48px); font-size: clamp(1.1rem, 1.7vw, 1.6rem); font-weight: 500; letter-spacing: -0.02em; }
/* the closing wordmark runs off the bottom edge of the field */
.lp-mirror > span { height: calc(var(--ink-h) * 0.9em); }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 900px) {
  .lp-head,
  .lp-say,
  .lp-flag-grid,
  .lp-close-top { grid-template-columns: minmax(0, 1fr); }
  .lp-head .lp-big { max-width: none; }
  .lp-row-head { grid-template-columns: 3ch minmax(0, 1fr); }
  .lp-row-body ul { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-left: calc(3ch + clamp(16px, 2vw, 32px)); }
  .lp-row-cta { margin-left: calc(3ch + clamp(16px, 2vw, 32px)); }
  .lp-own { grid-template-columns: minmax(0, 1fr); }
  .lp-own-copy { max-width: 46ch; }
  .lp-tile { width: min(46vw, 420px); }
}
@media (max-width: 600px) {
  .lp-mast-row { flex-direction: column; align-items: flex-start; }
  .lp-mast-links { justify-content: flex-start; padding-bottom: 0; }
  .lp-tiles { gap: 22vh; padding-top: 70vh; }
  .lp-tile { width: 74vw; margin-left: 0; }
  .lp-tile:nth-child(even) { margin-left: auto; }
  .lp-tile p { font-size: clamp(1.7rem, 8.4vw, 2.6rem); }
  .lp-tile.is-num b { font-size: 26vw; }
  .lp-tile.is-num p { font-size: 1.15rem; }
  .lp-can-pin span { font-size: 23vw; }
  .lp-row-body ul { grid-template-columns: minmax(0, 1fr); margin-left: 0; }
  .lp-row-cta { margin-left: 0; }
  .lp-row-x { top: 14px; }
  .lp-field canvas { aspect-ratio: 7 / 9; }
}

/* ==========================================================================
   NO MOTION
   ========================================================================== */
html.static .lp-row::before,
html.static .lp-row-body,
html.static .lp-row-x::before,
html.static .lp-row-x::after,
html.static .lp-mast,
html.static .sw-knob,
html.static.theme-profile:has(main.lp):not(.lp-past) .nav-link { transition: none; }
/* without motion the switch is simply on */
html.static .lp-mast.is-off { --p: 1; background: var(--red); color: var(--canvas); }
html.static .lp-mast.is-off .sw-knob { background: var(--red); }
html.static .lp-mast.is-off .lp-mast-line::after { content: "."; }
@media (prefers-reduced-motion: reduce) {
  .lp-mast.is-off { --p: 1; background: var(--red); color: var(--canvas); }
  .lp-mast.is-off .sw-knob { background: var(--red); }
  .lp-mast.is-off .lp-mast-line::after { content: "."; }
  html.theme-profile:has(.lp-mast.is-off):not(.lp-past) .nav-link { color: var(--canvas); }
  html.theme-profile:has(.lp-mast.is-off):not(.lp-past) .nav-link::after,
  html.theme-profile:has(.lp-mast.is-off):not(.lp-past) .menu-btn i { background: var(--canvas); }
  .sw-knob, .lp-mast, .lp-tile, .lp-close, .lp-row::before, .lp-row-body, .lp-link { transition: none; }
}
