/* =====================================================================
   eliasframes.com — styles
   Swiss / industrial, monochrome. Tweak the tokens below to re-theme.
   ===================================================================== */

:root {
  --bg: #0a0a0a;
  --fg: #f4f4f2;
  --soft: #c9c9c6;      /* secondary text */
  --muted: #8a8a87;     /* metadata */
  --faint: #4a4a48;     /* frame marks */
  --line: #262626;      /* hairlines */
  --surface: #141414;   /* thumbnail base */
  --surface-hi: #1b1b1b;
  --type-ghost: #222221;

  --font-head: "Inter Tight", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --gutter: clamp(16px, 4vw, 48px);
  --max: 1520px;
  --bar: 56px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: var(--bar);
}
html:has(dialog[open]) { overflow: hidden; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-head);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--fg); color: var(--bg); }

a { color: inherit; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
:focus-visible { outline: 2px solid var(--fg); outline-offset: 3px; }

h1, h2, h3, h4, p, dl, dd { margin: 0; }
[hidden] { display: none !important; }
a, button { -webkit-tap-highlight-color: transparent; }

.mono {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  line-height: 1.4;
}

.wrap {
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 100;
  padding: 8px 12px;
  background: var(--fg);
  color: var(--bg);
}
.skip-link:focus { top: 8px; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgb(10 10 10 / 0.86);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--bar);
}
.topbar a { text-decoration: none; }
.topbar__brand { color: var(--fg); text-transform: none; font-weight: 500; }
.nav { display: flex; gap: clamp(18px, 3vw, 40px); }
.nav a { color: var(--muted); transition: color 0.15s; }
.nav a:hover { color: var(--fg); }

/* ---------- hero ---------- */
.hero {
  padding-top: clamp(56px, 14vh, 160px);
  padding-bottom: clamp(32px, 6vh, 64px);
}
.hero__eyebrow {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  margin-bottom: clamp(16px, 2vw, 28px);
}
.hero__title {
  font-size: clamp(3.75rem, 19.5vw, 19rem);
  font-weight: 800;
  line-height: 0.8;
  letter-spacing: -0.06em;
  text-transform: uppercase;
  margin-left: -0.05em;
  /* "Elias Frames" — one word per line */
  max-width: 6ch;
  overflow-wrap: normal;
}
.hero__foot {
  display: grid;
  gap: 40px 24px;
  margin-top: clamp(40px, 6vw, 88px);
}
.hero__intro {
  font-size: clamp(1.125rem, 1.7vw, 1.625rem);
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.015em;
  max-width: 34ch;
}
.hero__meta { display: grid; gap: 0; }
.hero__meta > div {
  display: grid;
  grid-template-columns: 9rem 1fr;
  gap: 16px;
  padding-block: 10px;
  border-top: 1px solid var(--line);
}
.hero__meta > div:last-child { border-bottom: 1px solid var(--line); }
.hero__meta dt { color: var(--muted); padding-top: 0.2em; }
.hero__meta dd { color: var(--soft); }

@media (min-width: 860px) {
  .hero__foot { grid-template-columns: repeat(12, 1fr); align-items: end; }
  .hero__intro { grid-column: 1 / 8; }
  .hero__meta { grid-column: 9 / -1; }
}

/* ---------- sections ---------- */
.section { padding-top: clamp(72px, 11vw, 160px); }

.section__head {
  display: grid;
  gap: 12px 24px;
  grid-template-columns: repeat(12, 1fr);
  align-items: end;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  margin-bottom: clamp(32px, 5vw, 72px);
}
.section__head > * { grid-column: 1 / -1; }
.section__index { color: var(--muted); }
.section__title {
  font-size: clamp(2.75rem, 8vw, 7.5rem);
  font-weight: 800;
  line-height: 0.85;
  letter-spacing: -0.05em;
  margin-left: -0.04em;
}
.section__lede { color: var(--muted); max-width: 40ch; }

@media (min-width: 860px) {
  .section__index { grid-column: 1 / 3; align-self: start; }
  .section__title { grid-column: 3 / 9; }
  .section__lede { grid-column: 9 / -1; }
}

/* ---------- films grid ---------- */
.films {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(36px, 4vw, 64px) clamp(16px, 2vw, 28px);
}
@media (min-width: 640px)  { .films { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1180px) { .films { grid-template-columns: repeat(3, 1fr); } }

.film {
  appearance: none;
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.film:focus-visible { outline-offset: 6px; }

/* 16:9 typographic "thumbnail" — no images */
.thumb {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--surface);
  container-type: inline-size;
  transition: background-color 0.2s var(--ease);
}
.thumb__frame {
  --c: var(--faint);
  --l: 14px;
  position: absolute;
  inset: 12px;
  background:
    linear-gradient(var(--c), var(--c)) top left / var(--l) 1px no-repeat,
    linear-gradient(var(--c), var(--c)) top left / 1px var(--l) no-repeat,
    linear-gradient(var(--c), var(--c)) top right / var(--l) 1px no-repeat,
    linear-gradient(var(--c), var(--c)) top right / 1px var(--l) no-repeat,
    linear-gradient(var(--c), var(--c)) bottom left / var(--l) 1px no-repeat,
    linear-gradient(var(--c), var(--c)) bottom left / 1px var(--l) no-repeat,
    linear-gradient(var(--c), var(--c)) bottom right / var(--l) 1px no-repeat,
    linear-gradient(var(--c), var(--c)) bottom right / 1px var(--l) no-repeat;
}
.thumb__label {
  position: absolute;
  top: 22px;
  color: var(--muted);
  font-size: 0.6875rem;
}
.thumb__label--tl { left: 24px; }
.thumb__label--tr { right: 24px; }
.thumb__label.is-status { color: var(--fg); }
.thumb__label.is-status::before { content: "● "; }
.thumb__play {
  position: absolute;
  top: 50%;
  left: 50%;
  translate: -50% -50%;
  color: var(--fg);
  opacity: 0;
  transition: opacity 0.2s var(--ease);
}
.thumb__type {
  position: absolute;
  left: 18px;
  right: 0;
  bottom: -0.12em;
  font-size: 3.5rem;
  font-size: 15cqi;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.06em;
  white-space: nowrap;
  overflow: hidden;
  color: var(--type-ghost);
  transition: color 0.2s var(--ease);
}

.film:hover .thumb,
.film:focus-visible .thumb { background: var(--surface-hi); }
.film:hover .thumb__frame,
.film:focus-visible .thumb__frame { --c: var(--fg); }
.film:hover .thumb__play,
.film:focus-visible .thumb__play { opacity: 1; }
.film:hover .thumb__type,
.film:focus-visible .thumb__type { color: #2b2b2a; }

.film__meta {
  display: grid;
  gap: 6px;
  padding-top: 14px;
}
.film__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
}
.film__title {
  font-size: clamp(1.125rem, 1.4vw, 1.375rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.025em;
}
.film__year { color: var(--muted); flex: none; }
.film__client,
.film__role { color: var(--muted); }
.film__role { text-align: right; flex: none; max-width: 55%; }

/* ---------- CV ---------- */
.cv__list { list-style: none; margin: 0; padding: 0; }

.cv__row {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "year type"
    "role role"
    "org  org";
  gap: 4px 16px;
  padding-block: 16px;
  border-top: 1px solid var(--line);
}
.cv__list .cv__row:last-child { border-bottom: 1px solid var(--line); }
.cv__row--head { display: none; color: var(--muted); }

.cv__year { grid-area: year; color: var(--muted); }
.cv__role { grid-area: role; font-weight: 700; letter-spacing: -0.015em; font-size: 1.0625rem; }
.cv__org  { grid-area: org; color: var(--soft); }
.cv__project { color: var(--muted); }
.cv__type { grid-area: type; color: var(--muted); text-align: right; }

@media (min-width: 860px) {
  .cv__row {
    grid-template-columns: repeat(12, 1fr);
    grid-template-areas: none;
    gap: 24px;
    align-items: baseline;
    padding-block: 18px;
  }
  .cv__row--head { display: grid; padding-block: 0 12px; border-top: 0; }
  .cv__row > :nth-child(1) { grid-column: 1 / 3; }
  .cv__row > :nth-child(2) { grid-column: 3 / 6; }
  .cv__row > :nth-child(3) { grid-column: 6 / 11; }
  .cv__row > :nth-child(4) { grid-column: 11 / -1; text-align: right; }
  .cv__year, .cv__role, .cv__org, .cv__type { grid-area: auto; }
}

/* ---------- skills ---------- */
.skills {
  display: grid;
  gap: 24px;
  margin-top: clamp(56px, 7vw, 96px);
}
.skills__title {
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1;
}
.skills__groups {
  display: grid;
  gap: 32px 24px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.skills__label { color: var(--muted); margin-bottom: 12px; }
.skills__list { list-style: none; margin: 0; padding: 0; }
.skills__list li {
  padding-block: 8px;
  border-top: 1px solid var(--line);
  font-weight: 500;
}
.skills__list li:last-child { border-bottom: 1px solid var(--line); }

@media (min-width: 860px) {
  .skills { grid-template-columns: repeat(12, 1fr); }
  .skills__title { grid-column: 1 / 3; }
  .skills__groups { grid-column: 3 / -1; grid-template-columns: repeat(2, 1fr); }
}

/* ---------- footer / contact ---------- */
.footer { padding-bottom: 32px; }

.footer__email {
  display: inline-block;
  font-size: clamp(2rem, 7.2vw, 7rem);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.05em;
  text-decoration: none;
  overflow-wrap: anywhere;
  margin-left: -0.04em;
  transition: color 0.15s;
}
.footer__email:hover { color: var(--soft); text-decoration: underline; text-decoration-thickness: 0.05em; }

.footer__grid {
  display: grid;
  gap: 32px 24px;
  grid-template-columns: repeat(2, 1fr);
  margin-top: clamp(56px, 8vw, 120px);
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.footer__label { color: var(--muted); font-weight: 400; margin-bottom: 8px; }
.footer__social { list-style: none; margin: 0; padding: 0; }
.footer__social li + li { margin-top: 2px; }
.footer__grid a { text-decoration: none; }
.footer__grid a:hover { text-decoration: underline; }
.footer__copy { grid-column: 1 / -1; color: var(--muted); }

@media (min-width: 860px) {
  .footer__grid { grid-template-columns: repeat(12, 1fr); }
  .footer__grid > :nth-child(1) { grid-column: 1 / 4; }
  .footer__grid > :nth-child(2) { grid-column: 4 / 7; }
  .footer__grid > :nth-child(3) { grid-column: 7 / 9; }
  .footer__copy { grid-column: 9 / -1; text-align: right; align-self: end; }
}

.noscript { margin-top: 24px; color: var(--muted); }

/* ---------- modal / player ---------- */
.modal {
  width: min(1200px, calc(100% - 2 * var(--gutter)));
  max-width: none;
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 0;
  background: var(--bg);
  color: var(--fg);
  overflow: auto;
}
.modal::backdrop { background: rgb(0 0 0 / 0.88); }

.modal__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  color: var(--muted);
}
.modal__close {
  appearance: none;
  border: 0;
  background: none;
  color: var(--fg);
  font: inherit;
  text-transform: inherit;
  letter-spacing: inherit;
  padding: 6px 0 6px 12px;
  cursor: pointer;
}
.modal__close:hover { color: var(--soft); }

.player {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
}
.player iframe,
.player video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
}
.player__empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: var(--surface);
  color: var(--muted);
}

.modal__body {
  display: grid;
  gap: 28px 24px;
  padding: 24px 16px 32px;
}
.modal__title {
  font-size: clamp(1.75rem, 3.6vw, 3.25rem);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.045em;
  margin-bottom: 16px;
}
.modal__desc { color: var(--soft); max-width: 56ch; }
.modal__meta > div {
  display: grid;
  grid-template-columns: 8rem 1fr;
  gap: 16px;
  padding-block: 10px;
  border-top: 1px solid var(--line);
}
.modal__meta > div:last-child { border-bottom: 1px solid var(--line); }
.modal__meta dt { color: var(--muted); padding-top: 0.2em; }

@media (min-width: 860px) {
  .modal__bar { padding-inline: 24px; }
  .modal__body { grid-template-columns: 7fr 5fr; padding: 32px 24px 40px; }
}

/* ---------- modal animations ---------- */
.modal[open] { animation: modal-in 0.45s var(--ease-out) both; }
.modal[open]::backdrop { animation: fade-in 0.3s ease both; }

/* content settles in just after the window */
.modal[open] .modal__bar,
.modal[open] .modal__body > * { animation: rise 0.55s var(--ease-out) both; }
.modal[open] .modal__bar { animation-delay: 0.08s; }
.modal[open] .modal__body > :nth-child(1) { animation-delay: 0.14s; }
.modal[open] .modal__body > :nth-child(2) { animation-delay: 0.22s; }

/* viewfinder corners "focus" onto the frame */
.modal[open] .player__empty .thumb__frame { animation: frame-in 0.7s var(--ease-out) 0.1s both; }
.modal[open] .player__empty .mono { animation: fade-in 0.4s ease 0.35s both; }

/* closing (class set by app.js, removed once the animation ends) */
.modal[open].is-closing { animation: modal-out 0.22s ease-in both; }
.modal[open].is-closing::backdrop { animation: fade-out 0.22s ease-in both; }

@keyframes modal-in  { from { opacity: 0; transform: translateY(28px) scale(0.98); } }
@keyframes modal-out { to   { opacity: 0; transform: translateY(14px) scale(0.985); } }
@keyframes rise      { from { opacity: 0; transform: translateY(12px); } }
@keyframes fade-in   { from { opacity: 0; } }
@keyframes fade-out  { to   { opacity: 0; } }
@keyframes frame-in  { from { inset: 40px; opacity: 0; } }

/* ---------- motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .modal::backdrop { animation: none !important; }
}
