/* ISLA Studios, minimal direction.
   The homepage as a letterhead: one sheet, set like the 22 Nov stationery.
   Two colours only (cream and ink). Oxblood appears once, on hover. */

:root {
  --cream: #f8f6f1;
  --ink: #080808;
  --quiet: #6a675f;          /* warm grey for secondary text */
  --rule: #e3e0d8;
  --faint: #d6d2c8;          /* text before it lights up */
  --accent: #6d2e36;

  --font: "Devanagari Sangam MN", "Satoshi", "Helvetica Neue", Arial, sans-serif;
  --track: 0.13em;
  --edge: clamp(20px, 3.2vw, 48px);
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-gutter: stable; }  /* the scrollbar never shifts the page */
body {
  margin: 0; background: var(--cream); color: var(--ink);
  font-family: var(--font); font-size: 17px; line-height: 1.55;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
p, h1, h2, ul, figure { margin: 0; padding: 0; }
ul { list-style: none; }
a { color: inherit; text-decoration: none; }
img, video, svg { display: block; max-width: 100%; }
::selection { background: var(--ink); color: var(--cream); }
:focus-visible { outline: 1px solid currentColor; outline-offset: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.caps, .masthead, .clocks, .descriptor {
  font-size: 12.5px; letter-spacing: var(--track); text-transform: uppercase; line-height: 1.3; font-weight: 400;
}

/* The sheet -------------------------------------------------------------- */
.sheet {
  min-height: 100svh;
  display: grid; grid-template-rows: auto 1fr auto; justify-items: center;
  padding: clamp(28px, 4.5vh, 48px) var(--edge);
  text-align: center;
}
.topbar { width: 100%; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; }
.masthead { font-weight: 700; display: flex; gap: .9em; }
/* Inquire: two direct ways in, top left */
.inquire { justify-self: start; display: flex; align-items: center; gap: 14px; }
.inquire-label { color: var(--quiet); white-space: nowrap; margin-right: 2px; }
.icon-link { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: var(--ink); border: 1px solid var(--rule); transition: background .3s var(--ease), color .3s var(--ease), border-color .3s var(--ease); }
.icon-link svg { width: 17px; height: 17px; }
.icon-link:hover { background: var(--ink); color: var(--cream); border-color: var(--ink); }

/* The work, front and centre on the letterhead */
.hero-film {
  align-self: center; margin: clamp(28px, 5vh, 56px) 0;
  width: min(100%, 820px, calc((100svh - 300px) * 16 / 9));
}
.hero-film video { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; background: #e9e6df; }
/* Films never show the phone's player (play button, scrubber, mute) when a
   browser refuses to autoplay; a tap anywhere starts them instead */
video[data-film] { pointer-events: none; }
video[data-film]::-webkit-media-controls,
video[data-film]::-webkit-media-controls-panel,
video[data-film]::-webkit-media-controls-overlay-play-button,
video[data-film]::-webkit-media-controls-start-playback-button { display: none !important; -webkit-appearance: none; }

.dateline { display: grid; gap: 22px; }
.clocks { font-weight: 700; display: flex; flex-wrap: wrap; gap: 6px 2.2em; justify-content: center; font-variant-numeric: tabular-nums; }
.clock-label { font-weight: 400; color: var(--quiet); margin-right: .5em; }
.descriptor { color: var(--ink); }

/* Loading screen:
   1. black, for a breath
   2. the black lifts to cream (only the background changes, nothing else)
   3. the letters are written in, one after the other in reading order, each
      revealed the way a hand would write it: the I from the top, the S and
      the L across, the A rising (the square is left out of the intro)
   4. a short hold, the mark fades, then the cream lifts as the film fades up
   Steps 1 to 3 are pure CSS. The script waits for the A to finish before it
   starts step 4, so the beats can never overlap. The fallback fade
   means the page always appears even if scripts fail. The scrollbar stays
   in place the whole time (scrolling is paused by script instead), so the
   page never shifts sideways when the intro ends. */
.loader {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center;
  background: var(--ink); color: var(--ink);
  animation: loader-light 1s cubic-bezier(.4, 0, .2, 1) .45s forwards,
             loader-out 1.4s var(--ease) 7s forwards;
}
.loader.is-done { background: var(--cream); animation: loader-lift 1.4s cubic-bezier(.4, 0, .2, 1) forwards; }
.loader-mark {
  width: clamp(66px, calc(4vw + 20px), 80px);
  transition: opacity .7s ease;
}
.loader-mark .mono-frame { display: none; }
.loader-mark .mono-letter {
  clip-path: var(--from);
  animation: written .9s cubic-bezier(.65, 0, .35, 1) var(--at) forwards;
}
.loader-mark .mono-i { --from: inset(0 0 100% 0); --at: 1.35s; }
.loader-mark .mono-s { --from: inset(0 100% 0 0); --at: 1.77s; }
.loader-mark .mono-l { --from: inset(0 100% 0 0); --at: 2.19s; }
.loader-mark .mono-a { --from: inset(100% 0 0 0); --at: 2.61s; }
.loader.is-leaving .loader-mark { opacity: 0; }
@keyframes loader-light { to { background-color: var(--cream); } }
@keyframes written { to { clip-path: inset(0 0 0 0); } }
@keyframes loader-out { to { opacity: 0; visibility: hidden; } }
@keyframes loader-lift { from { opacity: 1; } to { opacity: 0; visibility: hidden; } }

/* While the intro plays, the letterhead waits just out of sight */
.hero-film, .topbar, .dateline { transition: opacity 1.6s cubic-bezier(.4, 0, .2, 1); }
.hero-film { transition-duration: 1.4s; }
.topbar, .dateline { transition-delay: .35s; }
html.is-loading .hero-film, html.film-hold .hero-film { opacity: 0; }
html.is-loading .topbar, html.is-loading .dateline { opacity: 0; }

/* Body ------------------------------------------------------------------- */
.statement-mobile { display: none; }
.body {
  max-width: 1120px; margin: 0 auto;
  padding: clamp(82px, 13.6vh, 170px) var(--edge) 0;
  display: grid; gap: clamp(75px, 11.9vh, 153px);
}
.statement {
  font-size: clamp(28px, 3.2vw, 46px); line-height: 1.3; text-align: center;   /* matches "Request the portfolio." */
  max-width: 38ch; margin: 0 auto; text-wrap: balance;   /* three balanced lines */
}
.index {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--edge);
  border-top: 1px solid var(--rule); padding-top: 20px;
}
.index h2 { color: var(--quiet); margin-bottom: 14px; }
.index li { line-height: 1.75; }

.plate figcaption { margin-top: 12px; color: var(--quiet); text-align: center; }

.body > * { min-width: 0; }

/* Call to action: request the portfolio, two direct ways */
.cta { text-align: center; display: grid; grid-template-columns: minmax(0, 1fr); gap: 30px; justify-items: center; }
.cta-heading { font-size: clamp(28px, 3.2vw, 46px); line-height: 1.15; font-weight: 400; letter-spacing: -0.005em; }
.channels {
  width: 100%; max-width: 600px;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px;
}
/* The two buttons share the password bar's shape: a fine pill with an ink circle and arrow */
.channel {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 54px; padding: 0 7px 0 24px; border-radius: 999px;
  border: 1px solid var(--rule); color: var(--ink); text-align: left;
  font-size: 17px;
  transition: border-color .3s var(--ease);
}
.channel-go {
  flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  background: var(--ink); color: var(--cream); transition: transform .3s var(--ease);
}
.channel-go svg { width: 17px; height: 17px; }
.channel:hover, .channel:focus-visible { border-color: var(--ink); }
.channel:hover .channel-go, .channel:focus-visible .channel-go { transform: translateX(2px); }
.cta-mark { width: 62px; margin-top: clamp(40px, 7vh, 72px); color: var(--ink); }
.cta-mark .mono-frame { display: none; }
.links { display: flex; gap: 2em; flex-wrap: wrap; justify-content: center; font-size: 15px; }
.links a { background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1px no-repeat; padding-bottom: 2px; transition: color .4s var(--ease); }
.links a:hover { color: var(--accent); }

.foot { padding: clamp(36px, 6vh, 56px) var(--edge) clamp(28px, 4.5vh, 48px); text-align: center; color: var(--quiet); }

/* Scroll lit text (only once the script has split it up) ------------- */
.scrub-ready [data-scrub] .w { color: var(--faint); transition: color .5s var(--ease); }
.scrub-ready [data-scrub] .w.on { color: var(--ink); }
.scrub-ready [data-scrub] h2.w.on { color: var(--quiet); }

/* Client portal entrance: a compact password bar in the top right */
.sheet { position: relative; }
.portal-bar {
  position: relative; justify-self: end;
  width: min(250px, 100%);
  display: flex; align-items: center; gap: 6px;
  height: 38px; padding: 0 4px 0 16px; border-radius: 999px;
  background: transparent; border: 1px solid var(--rule);
  transition: border-color .3s var(--ease), background .3s var(--ease);
}
.portal-bar:hover { border-color: color-mix(in srgb, var(--ink) 35%, transparent); }
.portal-bar:focus-within { border-color: var(--ink); background: var(--cream); }
@keyframes drop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.portal-bar input {
  flex: 1; min-width: 0; height: 100%; border: 0; outline: none; background: transparent;
  font: inherit; font-size: 16px; color: var(--ink); letter-spacing: .02em;
}
.portal-bar input::placeholder { color: transparent; }
/* The label is drawn here rather than as the field's placeholder: iPhones sit a
   small placeholder on the baseline, so it never lines up with the arrow. This
   one is centred on the bar, and so on the arrow, everywhere. */
.portal-bar::before {
  content: attr(data-label); position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  font-size: 11.5px; line-height: 1; letter-spacing: var(--track); text-transform: uppercase;
  color: var(--quiet); white-space: nowrap; pointer-events: none;
  /* Trim the line to the capitals, so their middle (not the font's) meets the arrow's */
  text-box: trim-both cap alphabetic;
}
.portal-bar:has(input:not(:placeholder-shown))::before { content: none; }
.portal-go {
  flex: none; width: 30px; height: 30px; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center; background: var(--ink); color: var(--cream);
  transition: transform .3s var(--ease), opacity .3s var(--ease);
}
.portal-go svg { width: 15px; height: 15px; }
.portal-go:hover { transform: translateX(2px); }
.portal-go:disabled { opacity: .45; cursor: progress; }
.portal-bar.is-checking input { opacity: .4; }
.portal-bar .portal-note {
  position: absolute; top: calc(100% + 10px); right: 4px; width: max-content; max-width: 80vw; text-align: right;
  font-size: 14px; color: var(--accent);
}

/* Client portal ------------------------------------------------------- */
.portal {
  border: 0; padding: 0; margin: auto; width: min(420px, calc(100% - 32px)); max-height: calc(100% - 32px);
  background: var(--cream); color: var(--ink); box-shadow: 0 30px 80px rgba(8, 8, 8, .12);
}
.portal::backdrop { background: rgba(248, 246, 241, .86); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.portal[open] { animation: rise .5s var(--ease); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.portal-sheet { position: relative; display: grid; gap: 22px; padding: 56px clamp(24px, 6vw, 48px) 40px; text-align: center; }
.portal-close { position: absolute; top: 18px; right: 20px; background: none; border: 0; padding: 4px; font: inherit; font-size: 12.5px; color: var(--quiet); cursor: pointer; }
.portal-close:hover { color: var(--ink); }
.portal-mark { width: 44px; margin: 0 auto 6px; }
.portal-title { font-weight: 700; margin-bottom: 8px; }
.field { display: grid; gap: 8px; text-align: left; }
.field .caps { color: var(--quiet); }
.field input {
  font: inherit; font-size: 16px; color: var(--ink); background: transparent;
  border: 0; border-bottom: 1px solid var(--rule); border-radius: 0; padding: 8px 0; outline: none;
  transition: border-color .3s var(--ease);
}
.field input:focus { border-bottom-color: var(--ink); }
.portal-submit {
  margin-top: 10px; font: inherit; font-size: 11px; letter-spacing: var(--track); font-weight: 700;
  background: var(--ink); color: var(--cream); border: 1px solid var(--ink); padding: 16px; cursor: pointer;
  transition: background .3s var(--ease), color .3s var(--ease);
}
.portal-submit:hover { background: transparent; color: var(--ink); }
.portal-note { min-height: 1.5em; font-size: 13px; color: var(--accent); }
.portal-note:empty { min-height: 0; }
.portal-help { font-size: 13.5px; color: var(--quiet); text-align: center; }
.portal-help a { border-bottom: 1px solid currentColor; }
.portal [hidden] { display: none !important; }
.portal-gate { display: grid; gap: 22px; }
.portal-submit:disabled { opacity: .5; cursor: progress; }
.portal-space { display: grid; gap: 14px; text-align: left; }
.portal-welcome { color: var(--quiet); text-align: center; }
.portal-client { font-size: clamp(22px, 2.4vw, 28px); line-height: 1.2; font-weight: 400; text-align: center; }
.portal-intro { font-size: 15.5px; color: var(--quiet); text-align: center; text-wrap: balance; }
.portal-items { margin-top: 12px; border-top: 1px solid var(--rule); }
.portal-item {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  padding: 16px 2px; border-bottom: 1px solid var(--rule); transition: color .3s var(--ease);
}
a.portal-item:hover { color: var(--accent); }
.portal-item.is-pending { color: var(--quiet); }
.portal-item-detail { color: var(--quiet); white-space: nowrap; }
.portal-signout {
  justify-self: center; margin-top: 14px; background: none; border: 0; padding: 4px 0;
  font: inherit; font-size: 12.5px; color: var(--quiet); cursor: pointer;
  border-bottom: 1px solid currentColor;
}
.portal-signout:hover { color: var(--ink); }

/* 404 */
.notfound { min-height: 100svh; display: grid; place-content: center; justify-items: center; gap: 28px; text-align: center; padding: 40px var(--edge); }
.notfound-mark { width: 54px; }
.notfound-line { font-size: clamp(21px, 1.95vw, 28px); font-weight: 400; line-height: 1.4; }
.notfound-home { border-bottom: 1px solid currentColor; padding-bottom: 3px; }
.notfound-home:hover { color: var(--accent); }

@media (max-width: 680px) {
  /* Below the dateline: the statement holds the screen, and Services,
     Engagements and Studio read as one centred column, like a menu */
  .statement { font-size: 26px; line-height: 1.36; max-width: 15em; }
  .index { grid-template-columns: 1fr; row-gap: 36px; text-align: center; border-top: 0; }
  .index li { font-size: 18px; line-height: 1.7; }
  .channels { grid-template-columns: minmax(0, 1fr); max-width: 280px; }   /* stacked and narrower on phones */
  .statement-desktop { display: none; }
  .statement-mobile { display: block; }
  .clocks { display: grid; grid-template-columns: auto auto; gap: 6px 18px; justify-content: center; font-size: 11px; letter-spacing: .1em; }
  .clock { text-align: left; white-space: nowrap; }
  .hero-film { width: 100%; }
  /* First screen on phones: the name, the two icons centred under it, the film,
     the clocks, then the client password bar where the descriptor sits on
     desktop (the descriptor is left out on phones). The top bar steps aside
     (display: contents) so its pieces can sit around the film. */
  .topbar { display: contents; }
  .topbar .masthead { font-size: 11px; letter-spacing: .1em; }
  .sheet { grid-template-rows: auto auto 1fr auto 1fr auto auto; }
  .masthead { grid-row: 1; }
  .inquire { grid-row: 2; justify-self: center; margin-top: 18px; }
  .inquire-label { display: none; }
  .hero-film { grid-row: 4; margin: 36px 0; }
  .dateline { grid-row: 6; }
  .descriptor { display: none; }
  .topbar > * { transition: opacity 1.6s cubic-bezier(.4, 0, .2, 1) .35s; }
  html.is-loading .topbar > * { opacity: 0; }
  .portal-bar { grid-column: 1 / -1; grid-row: 7; justify-self: center; margin-top: 24px; width: min(230px, 100%); height: 36px; padding-left: 14px; }
  .portal-bar::before { left: 14px; font-size: 10.5px; }
  .portal-bar .portal-go { width: 28px; height: 28px; }
  .portal-bar .portal-note { left: 0; right: 0; width: auto; text-align: center; }
  .sheet { padding-bottom: 40px; }
  .masthead { gap: .6em; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
