/* omargourari.com — one screen, no scroll on common devices.
   Layouts: desktop (landscape ≥1024px), tablet (≥700px portrait), phone (<700px). */

@font-face {
  font-family: "GT Super Display";
  src: url("/assets/fonts/GTSuperDisplay-Light.woff") format("woff");
  font-weight: 300; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "GT Super Display";
  src: url("/assets/fonts/GTSuperDisplay-Regular.woff") format("woff");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "GT Super Display";
  src: url("/assets/fonts/GTSuperDisplay-RegularItalic.woff") format("woff");
  font-weight: 400; font-style: italic; font-display: swap;
}

:root {
  --ink: #F2F0EA;
  --muted: #CFCBC2;
  --ground: #0d0d0c;
  --scrim: rgba(10, 10, 9, 0.5);

  /* type — the name is always 2px larger than the bio, in Light */
  --bio: 19px;
  --name: calc(var(--bio) + 2px);
  --text: 16px;
  --label: 15px;
  --caption: 12px;

  /* heatmap dots: --box is the cell, dots scale inside it by level */
  --box: 7px;
  --col-gap: 6px;
  --row-gap: 2px;
  --heat-w: calc(12 * var(--box) + 11 * var(--col-gap));

  --pad-top: max(48px, env(safe-area-inset-top));
  --pad-x: 24px;
  --pad-bottom: max(36px, env(safe-area-inset-bottom));
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--ground);
  color: var(--ink);
  font-family: "GT Super Display", Georgia, serif;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: rgba(242, 240, 234, 0.5);
  text-underline-offset: 4px;
}
a:hover, a:focus-visible { color: #fff; text-decoration-color: #fff; }
a:focus-visible { outline: 1px solid var(--ink); outline-offset: 4px; }

/* background */
.bg-video, .bg-scrim { position: fixed; inset: 0; width: 100%; height: 100%; }
.bg-video { object-fit: cover; z-index: -2; pointer-events: none; }
/* iOS draws a play button over a video it will not autoplay (Low Power Mode) */
.bg-video::-webkit-media-controls,
.bg-video::-webkit-media-controls-start-playback-button { display: none !important; -webkit-appearance: none; }

/* the page fades in once everything is ready (main.js adds .ready) */
.js .page { opacity: 0; transition: opacity 400ms ease-out; }
.js.ready .page { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .js .page { transition: none; } }
.bg-scrim { background: var(--scrim); z-index: -1; }
@media (prefers-reduced-motion: reduce) { .bg-video { display: none; } body { background: var(--ground) url("/assets/video/poster.jpg") center / cover fixed; } }

/* page: fills the screen; if a device is too short it scrolls instead of clipping */
.page {
  min-height: 100vh;
  min-height: 100dvh;
  padding: var(--pad-top) var(--pad-x) var(--pad-bottom);
  display: flex;
  flex-direction: column;
}

p { margin: 0; }
.name { margin: 0; font-size: var(--name); line-height: 1.2; font-weight: 300; }
.bio { font-size: var(--bio); line-height: 1.4; }
.intro { display: flex; flex-direction: column; gap: 10px; margin-top: auto; padding-top: 32px; }
.side { display: flex; flex-direction: column; gap: 24px; margin-top: 24px; font-size: var(--text); line-height: 1.45; }
.block { display: flex; flex-direction: column; gap: 6px; }
.label { font-size: var(--label); font-style: italic; color: var(--muted); }

/* heatmap ------------------------------------------------------------ */
.heatmap { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.caption { width: var(--heat-w); margin-top: 4px; font-size: var(--caption); line-height: 1.4; font-style: italic; color: var(--muted); }

.cell { width: var(--box); height: var(--box); display: flex; align-items: center; justify-content: center; }
.dot { width: calc(var(--box) * var(--s)); height: calc(var(--box) * var(--s)); border-radius: 50%; background: rgba(242, 240, 234, var(--a)); }
.l0 { --s: .30; --a: .28; }
.l1 { --s: .50; --a: .32; }
.l2 { --s: .70; --a: .52; }
.l3 { --s: .82; --a: .74; }
.l4 { --s: 1;   --a: .95; }
.future .dot { visibility: hidden; }

.mlabel { height: 16px; font-size: 11px; font-style: italic; color: var(--muted); white-space: nowrap; overflow: visible; }

/* vertical: one column per month, label every 4 months */
.heatmap-months { display: flex; gap: var(--col-gap); align-items: flex-start; }
.hm-col { width: var(--box); display: flex; flex-direction: column; gap: var(--row-gap); }
.hm-col .mlabel { margin-bottom: 4px; }

/* horizontal: one column per week (desktop only) */
.heatmap-weeks { display: none; flex-direction: column; gap: 8px; }
.hw-months, .hw-grid { display: flex; gap: var(--gap-h, 3px); }
.hw-months > span { width: var(--box); flex: none; }
.hw-col { display: flex; flex-direction: column; gap: var(--gap-h, 3px); }

/* short phones (e.g. iPhone SE) */
@media (max-width: 699px) and (max-height: 740px) {
  :root { --row-gap: 1px; --box: 6px; --bio: 17px; --text: 15px; --pad-top: max(28px, env(safe-area-inset-top)); }
}

/* tablet portrait ----------------------------------------------------- */
@media (min-width: 700px) {
  :root {
    --bio: 28px; --text: 21px; --label: 17px; --caption: 14px;
    --box: 10px; --col-gap: 8px; --row-gap: 7px;
    --pad-top: 80px; --pad-x: 72px; --pad-bottom: 80px;
  }
  .heatmap { gap: 10px; }
  .mlabel { height: 18px; font-size: 13px; }
  .hm-col .mlabel { margin-bottom: 6px; }
  .intro { gap: 16px; }
  .bio { max-width: 760px; }
  .side { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 48px; align-items: end; margin-top: 56px; }
  .block { gap: 10px; }
}
@media (min-width: 700px) and (max-height: 1200px) { :root { --row-gap: 4px; } }
@media (min-width: 700px) and (max-height: 1060px) { :root { --row-gap: 2px; } }

/* desktop -------------------------------------------------------------- */
@media (min-width: 1024px) and (orientation: landscape) {
  :root {
    --bio: clamp(20px, 1.8vw, 26px);
    --text: clamp(16px, 1.32vw, 19px);
    --label: 16px; --caption: 13px;
    --box: clamp(6px, 0.68vw, 10px);
    --gap-h: calc(var(--box) * 0.3);
    --heat-w: calc(53 * var(--box) + 52 * var(--gap-h));
    --pad-top: 72px; --pad-x: clamp(48px, 6.6vw, 96px); --pad-bottom: 72px;
  }
  .page {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(0, 1fr) minmax(0, 4fr);
    grid-template-areas: "heat . ." "intro . side";
    align-content: end;
    column-gap: 32px;
  }
  .heatmap { grid-area: heat; gap: 8px; margin-bottom: 48px; }
  .heatmap-months { display: none; }
  .heatmap-weeks { display: flex; }
  .mlabel { height: 16px; font-size: 12px; }
  .intro { grid-area: intro; margin: 0; padding: 0; gap: 16px; }
  .bio { max-width: 640px; }
  .side { grid-area: side; display: flex; align-items: stretch; margin: 0; gap: 24px; align-self: end; }
  .block { gap: 10px; }
}
