/* ============================================================
   ARC Studios — landing page
   arcstudiosco.com

   TYPE: Century Gothic, per the brand guidelines. It ships with
   Microsoft Office rather than as a web font, so visitors who
   have it get the real thing and everyone else falls back to
   Jost, a geometric sans with the same single-storey 'a'.
   To put Century Gothic on every visitor you need a web font
   licence from Monotype; add the @font-face here and drop the
   Google Fonts link from index.html.

   Century Gothic has only Regular and Bold, so this file uses
   400 and 700 only — emphasis comes from size and spacing.
   ============================================================ */

:root {
  /* Colour */
  --taupe:       #E4E1DE;   /* the warm taupe */
  --taupe-light: #F3F1EE;
  --ink:         #1F1D1B;   /* soft black */
  --ink-muted:   #5C574F;
  --on-dark:     #F3F1EE;
  --on-dark-dim: #BFBAB3;

  /* Type */
  --font: "Century Gothic", CenturyGothic, "Jost", "Didact Gothic",
          "URW Gothic", AppleGothic, "Avant Garde", sans-serif;
  --mono: "DM Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

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

html { -webkit-text-size-adjust: 100%; }

/* Height and scrolling belong to the individual page, not here —
   the landing is deliberately one screen, but teach and book scroll,
   and they share this file. */
body {
  margin: 0;
  background: var(--ink);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

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

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---- The stage: video, scrim, logo, small print ---- */

/* The landing page only: one screen, never scrolls. Scrolling pages
   that share this stylesheet simply don't carry this class. */
.stage-page {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: var(--ink);
}

.stage { position: relative; height: 100%; overflow: hidden; }

.stage__media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Film grain, generated by the browser rather than downloaded.
   Raise the opacity for more texture, drop it for less. */
.stage__grain {
  position: absolute;
  inset: -40%;
  pointer-events: none;
  opacity: 0.30;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='3' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='220' height='220' filter='url(%23n)' opacity='0.55'/></svg>");
  background-size: 220px 220px;
  animation: grain-shift .9s steps(5) infinite;
  will-change: transform;
}

/* Shuffling the layer each step is what makes it flicker like film
   rather than sit there like a texture. */
@keyframes grain-shift {
  0%   { transform: translate(0, 0); }
  20%  { transform: translate(-4%, 3%); }
  40%  { transform: translate(3%, -4%); }
  60%  { transform: translate(-3%, -2%); }
  80%  { transform: translate(4%, 2%); }
  100% { transform: translate(0, 0); }
}

/* Darkens the footage just enough for the tiles and small print to
   hold their contrast whatever frame is on screen. */
.stage__scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(26, 24, 22, 0.72) 0%,
    rgba(26, 24, 22, 0.30) 32%,
    rgba(26, 24, 22, 0.30) 68%,
    rgba(26, 24, 22, 0.74) 100%
  );
}

.stage__head {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: clamp(20px, 3.4vh, 38px) clamp(20px, 4vw, 56px);
}
.stage__logo { height: clamp(20px, 2.2vw, 30px); width: auto; }
/* Matches the burger's full footprint — its width plus the inset
   below — so the logo stays centred between them. */
.stage__head-spacer { width: calc(44px + clamp(6px, 0.8vw, 14px)); }

.stage__foot {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: clamp(18px, 3vh, 34px) clamp(20px, 4vw, 56px);
  pointer-events: none;
}
.stage__meta {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(243, 241, 238, 0.82);
}

/* ---- Hamburger ---- */

/* Sits a little inside the padding edge rather than hard against it.
   On a phone this inset is removed, because there the tiles run full
   width and the burger should land on their left edge exactly. */
.burger {
  width: 44px; height: 44px;
  margin-left: clamp(6px, 0.8vw, 14px);
  display: flex; align-items: center;
  background: none; border: 0; padding: 0;
  cursor: pointer;
  color: var(--on-dark);
}
.burger__bars, .burger__bars::before, .burger__bars::after {
  content: "";
  display: block;
  width: 26px; height: 3px;
  border-radius: 2px;
  background: currentColor;
}
.burger__bars { position: relative; }
.burger__bars::before { position: absolute; top: -8px; }
.burger__bars::after  { position: absolute; top:  8px; }

/* ---- The two tiles ---- */

/* The outer box is now a column: a line of copy, then the two tiles.
   It still has to fit one screen with nothing scrolling, so the gap
   and the intro's size both give way before the tiles do. */
.tiles {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  /* space-evenly, not center. Centring treats the copy and the tiles
     as one block and puts all the spare height around the outside, so
     the two end up touching with big voids above and below. Here the
     spare height is shared equally: above the copy, between copy and
     tiles, and below the tiles. The gap below is only a floor for when
     there is no spare height to share. */
  justify-content: space-evenly;
  gap: clamp(16px, 2.5vh, 32px);
  padding: clamp(76px, 12vh, 150px) clamp(20px, 4vw, 56px);
}

.intro {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(8px, 1.2vh, 14px);
  text-align: center;
  color: var(--on-dark);
  /* The video behind this is busy and bright in places. A soft shadow
     keeps the text legible over the light frames without putting a
     panel behind it. */
  text-shadow: 0 1px 14px rgba(0, 0, 0, 0.6);
}
.intro p { margin: 0; text-wrap: balance; }

/* The max-widths are sized to the copy: wide enough that the headline
   holds one line and the paragraph settles on two, on any screen with
   the room for it. Narrow screens wrap as they must. */
.intro__title {
  font-size: clamp(21px, 2.4vw, 38px);
  line-height: 1.1;
  letter-spacing: -0.025em;
  max-width: 40ch;
}
.intro__body {
  font-size: clamp(13px, 1.1vw, 16px);
  line-height: 1.5;
  color: var(--on-dark-dim);
  max-width: 92ch;
}

.tiles__row {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: clamp(12px, 2vw, 28px);
  width: 100%;
  min-height: 0;
}

.tile {
  flex: 1 1 0;
  min-width: 0;
  max-width: 430px;
  min-height: clamp(250px, 38vh, 360px);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 16px;
  padding: clamp(26px, 2.8vw, 44px);
  border-radius: clamp(16px, 1.6vw, 24px);
  text-decoration: none;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: transform .25s ease, background-color .25s ease;
}
.tile:hover { transform: translateY(-5px); }

.tile--dark  { background: rgba(26, 24, 22, 0.84); color: var(--on-dark); }
.tile--light { background: rgba(228, 225, 222, 0.90); color: var(--ink); }
.tile--dark:hover  { background: rgba(10, 10, 10, 0.90); }
.tile--light:hover { background: rgba(243, 241, 238, 0.95); }

.tile__label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--on-dark-dim);
}
.tile--light .tile__label { color: var(--ink-muted); }

.tile__title {
  font-size: clamp(24px, 2.6vw, 40px);
  line-height: 1.08;
  letter-spacing: -0.025em;
}

.tile__cta {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-height: 48px;
  padding: 0 22px;
  margin-top: 6px;
  border-radius: 3px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  white-space: nowrap;
}
.tile--dark  .tile__cta { background: var(--on-dark); color: var(--ink); }
.tile--light .tile__cta { background: var(--ink); color: var(--on-dark); }

/* ---- Half-page menu ---- */

.menu {
  position: fixed;
  inset: 0;
  z-index: 60;
  visibility: hidden;
}
.menu.is-open { visibility: visible; }

.menu__scrim {
  position: absolute;
  inset: 0;
  background: rgba(16, 15, 14, 0.55);
  opacity: 0;
  transition: opacity .35s ease;
}
.menu.is-open .menu__scrim { opacity: 1; }

.menu__panel {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 50%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(18px, 3vh, 34px);
  padding: clamp(40px, 7vh, 88px) clamp(28px, 5vw, 80px);
  background: var(--taupe);
  color: var(--ink);
  transform: translateX(-100%);
  transition: transform .4s cubic-bezier(.4, 0, .2, 1);
  overflow-y: auto;
}
.menu.is-open .menu__panel { transform: translateX(0); }

.menu__close {
  position: absolute;
  top: clamp(18px, 3vh, 34px);
  right: clamp(18px, 2.4vw, 34px);
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  background: none; border: 0; padding: 0;
  cursor: pointer;
  color: var(--ink-muted);
}
.menu__close:hover { color: var(--ink); }

.menu__link {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-decoration: none;
  color: var(--ink);
  padding-block: 6px;
}
.menu__link-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.menu__link-title {
  font-size: clamp(30px, 3.6vw, 56px);
  line-height: 1.05;
  letter-spacing: -0.025em;
  width: max-content;
  max-width: 100%;
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease;
}
.menu__link:hover .menu__link-title { border-bottom-color: currentColor; }

.menu__foot {
  margin-top: auto;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

/* ---- 404 ---- */

.error-page { background: var(--taupe); color: var(--ink); }

.error {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: clamp(20px, 3.4vh, 38px) clamp(20px, 4vw, 56px);
}

.error__head { display: flex; justify-content: center; }
.error__logo { height: clamp(20px, 2.2vw, 30px); width: auto; }

.error__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
  /* A px measure, not ch — ch resolves against the body size, not the
     heading's, so it strangled the title down to one word per line. */
  max-width: 660px;
  padding-block: 48px;
}

.error__code {
  margin: 0;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.error__title {
  margin: 0;
  font-weight: 400;
  font-size: clamp(34px, 5.2vw, 72px);
  line-height: 1.03;
  letter-spacing: -0.025em;
}

.error__note { margin: 0; color: var(--ink-muted); max-width: 34ch; }

.error__links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 26px;
  margin-top: 14px;
}

.error__cta {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 3px;
  background: var(--ink);
  color: var(--on-dark);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
}

.error__alt {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-muted);
  text-decoration: none;
  padding-block: 12px;
  border-bottom: 1px solid transparent;
}
.error__alt:hover { color: var(--ink); border-bottom-color: currentColor; }

.error__foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
}
.error__meta {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

/* ---- Phones ---- */

@media (max-width: 760px) {
  /* The tiles stack, full width, and still fit one screen.
     Instructors sit on top. */
  .tiles {
    gap: clamp(18px, 4vh, 34px);
    padding: 70px 16px 54px;
  }
  .tiles__row {
    flex-direction: column;
    justify-content: center;
    gap: 12px;
    flex: 0 1 auto;
    min-height: 0;
  }
  /* No width cap at this size — the 16px gutter on .tiles is the
     only limit the copy needs. */
  .intro { flex: 0 0 auto; }
  .intro__title { font-size: 20px; max-width: none; }
  .intro__body  { font-size: 13px; line-height: 1.45; max-width: none; }
  .tile {
    width: 100%;
    max-width: none;
    /* flex-grow 0: the tiles take the height their content needs and
       no more, instead of stretching to fill. That hands the spare
       room to the copy above rather than to empty tile. */
    flex: 0 0 auto;
    min-height: 0;
    padding: 22px 24px 24px;
    gap: 10px;
    border-radius: 18px;
  }
  .tile__label { font-size: 10px; letter-spacing: 0.16em; }
  .tile__title { font-size: 26px; letter-spacing: -0.02em; }
  .tile__cta {
    min-height: 46px;
    padding: 0 20px;
    font-size: 10px;
    letter-spacing: 0.14em;
  }

  /* Full width on a phone — half a phone screen is unreadable. */
  .menu__panel { width: 100%; }

  /* The tiles run full width at this size, so the 16px padding edge
     is a real line down the page: burger, tiles and footer all start
     on it. No inset here. */
  .stage__head { padding: 20px 16px; }
  .burger { margin-left: 0; }
  .stage__head-spacer { width: 44px; }
  .stage__foot { padding: 16px; }
  .stage__meta { font-size: 8px; letter-spacing: 0.14em; }
  /* Only room for one line of small print at this width. */
  .stage__foot > .stage__meta:last-child { display: none; }
}

/* Short phones — an SE, or anything in landscape. There is no scroll
   to fall back on here: the stage is locked to the viewport, so copy
   that doesn't fit slides under the header instead of pushing the page
   taller. Everything tightens a notch so all of it stays in view. */
@media (max-width: 760px) and (max-height: 720px) {
  .stage__head { padding: 14px 16px; }
  .stage__foot { padding: 13px 16px; }
  .tiles { padding: 56px 16px 42px; gap: clamp(16px, 3.2vh, 26px); }
  .tiles__row { gap: 10px; }

  .intro { gap: 6px; }
  .intro__title { font-size: 18px; }
  .intro__body  { font-size: 12px; line-height: 1.4; }

  .tile { padding: 14px 16px 16px; gap: 8px; }
  .tile__title { font-size: 22px; }
  /* 42px is the floor — below that it stops being a comfortable
     tap target. */
  .tile__cta { min-height: 42px; padding: 0 16px; }
}

/* Shorter still. This catches an original SE, the older small
   Androids, and a desktop window dragged narrow and short — that last
   one used to fall between tiers and overflow, because the tiles have
   already stacked by this width. Side padding stays at 16px so the
   burger, tiles and footer keep sharing one left edge. */
@media (max-width: 760px) and (max-height: 620px) {
  .tiles { padding: 52px 16px 34px; gap: clamp(13px, 2.8vh, 20px); }
  .intro { gap: 5px; }
  .intro__title { font-size: 17px; }
  .intro__body  { font-size: 11.5px; line-height: 1.35; }
  .tile { padding: 12px 14px 14px; gap: 7px; }
  .tile__title { font-size: 21px; }
}

/* A phone held sideways. Stacking is wrong here: there is width going
   spare and almost no height, so the tiles go back to sitting beside
   each other and everything fits again. */
@media (max-width: 760px) and (max-height: 480px) {
  .tiles__row { flex-direction: row; }
  .tile { flex: 1 1 0; min-height: clamp(140px, 38vh, 190px); }
}


/* Any short viewport, whatever its width. A large phone in landscape
   is over 760px wide, so it never matched the phone rules above and
   was being handed desktop spacing inside 390px of height. This keys
   off height alone and comes last, so it wins wherever it applies. */
@media (max-height: 560px) {
  .stage__head { padding: 12px 16px; }
  .stage__foot { padding: 11px 16px; }
  .tiles { padding: 54px 16px 34px; gap: clamp(14px, 3.4vh, 24px); }
  .tiles__row { gap: 10px; }

  .intro { gap: 5px; }
  .intro__title { font-size: clamp(17px, 2vw, 24px); }
  .intro__body  { font-size: clamp(11.5px, 1.2vw, 14px); line-height: 1.4; }

  .tile {
    min-height: 0;
    padding: 12px 16px 14px;
    gap: 7px;
    border-radius: 14px;
  }
  .tile__title { font-size: clamp(20px, 2.2vw, 26px); }
  .tile__cta { min-height: 42px; padding: 0 16px; }
}

/* Wide but short — a desktop window, not a phone. The rule above
   collapses the tiles to the height of their text, which is right for
   a stacked pair on a phone and wrong here, where they sit side by
   side with room to keep their shape. Must come after it to win. */
@media (min-width: 761px) and (max-height: 560px) {
  .tile {
    min-height: clamp(185px, 40vh, 260px);
    /* Not the cramped 16px the rule above gives a phone. There is
       width to spare here, and the padding is what makes these read
       as cards rather than boxes with text jammed in the corner. */
    padding: clamp(26px, 2.4vw, 36px);
    gap: 12px;
    border-radius: clamp(16px, 1.6vw, 24px);
  }
}

/* Below this there is genuinely no room, and a paragraph nobody can
   read is worth less than two tiles they can tap. The headline stays. */
@media (max-height: 345px) {
  .intro__body { display: none; }
}

/* Anyone who asks for less motion gets the poster still instead,
   and the menu appears rather than sliding. */
@media (prefers-reduced-motion: reduce) {
  .stage__media { display: none; }
  .stage { background: var(--ink) url("../img/hero-poster.jpg") center / cover no-repeat; }
  .menu__panel, .menu__scrim, .tile { transition: none; }
  /* Grain stays, but stops flickering. */
  .stage__grain { animation: none; }
}
