/* ==========================================================================
   Portfolio — styles
   Change the look of the whole site from the tokens below.
   ========================================================================== */
:root {
  --bg: #0d0d0f;
  --surface: #17171a;
  --line: #2a2a2e;
  --text: #edece8;
  --muted: #8d8c88;
  --accent: #ff4f2b;          /* the one bold colour — change to taste */
  --gap: 6px;
  --gutter: clamp(16px, 3vw, 40px);
  --font: "Inter Tight", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --ease: cubic-bezier(.2, .7, .1, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg, video, iframe { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
::selection { background: var(--accent); color: var(--bg); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.mono { font-family: var(--mono); font-size: 12px; letter-spacing: .04em; text-transform: uppercase; }
.muted { color: var(--muted); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ==========================================================================
   ENTRY SCREEN (index.html)
   ========================================================================== */
.entry { height: 100svh; overflow: hidden; }
.entry-bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.entry-bg .bg {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  opacity: 0; transform: scale(1.08);
  transition: opacity .7s var(--ease), transform 6s linear;
}
.entry-bg .bg.on { opacity: .42; transform: scale(1); }
.entry-bg::after { /* film grain + vignette */
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, rgba(0,0,0,.25) 30%, rgba(0,0,0,.7) 100%);
  mix-blend-mode: multiply;
}

/* viewfinder corner marks */
.frame { position: fixed; inset: calc(var(--gutter) * .6); z-index: 1; pointer-events: none; }
.frame i { position: absolute; width: 22px; height: 22px; border-color: var(--muted); border-style: solid; border-width: 0; opacity: .6; }
.frame i:nth-child(1) { top: 0; left: 0; border-top-width: 1px; border-left-width: 1px; }
.frame i:nth-child(2) { top: 0; right: 0; border-top-width: 1px; border-right-width: 1px; }
.frame i:nth-child(3) { bottom: 0; left: 0; border-bottom-width: 1px; border-left-width: 1px; }
.frame i:nth-child(4) { bottom: 0; right: 0; border-bottom-width: 1px; border-right-width: 1px; }
.frame .cross { position: absolute; top: 50%; left: 50%; width: 14px; height: 14px; transform: translate(-50%, -50%); opacity: .35; }
.frame .cross::before, .frame .cross::after { content: ""; position: absolute; background: var(--muted); }
.frame .cross::before { left: 50%; top: 0; bottom: 0; width: 1px; }
.frame .cross::after { top: 50%; left: 0; right: 0; height: 1px; }

.entry-shell {
  position: relative; z-index: 2; height: 100%;
  display: grid; grid-template-rows: auto 1fr auto;
  padding: calc(var(--gutter) * .6 + 18px) calc(var(--gutter) * .6 + 22px);
}
.entry-top, .entry-bottom { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.entry-top .brand { font-weight: 600; font-size: 15px; letter-spacing: -.01em; }
.rec { display: inline-flex; align-items: center; gap: 8px; }
.rec::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: blink 1.2s steps(2, start) infinite; }
@keyframes blink { to { visibility: hidden; } }
.entry-bottom { color: var(--muted); }
.entry-bottom a:hover { color: var(--text); }

.entry-shell > nav { align-self: center; }
.entry-menu { display: flex; flex-direction: column; gap: clamp(2px, 1vh, 10px); margin: 0; padding: 0; list-style: none; }
.entry-menu a {
  display: grid; grid-template-columns: 3.2em auto 1fr; align-items: baseline; gap: 0 .4em;
  width: fit-content; max-width: 100%;
  transition: opacity .4s var(--ease), color .3s;
}
.entry-menu .num { font-family: var(--mono); font-size: 13px; color: var(--muted); transform: translateY(-1.2em); }
.entry-menu .word {
  font-size: clamp(48px, 11vw, 168px); font-weight: 600; line-height: .92; letter-spacing: -.045em;
  display: inline-block; overflow: hidden; padding-bottom: .06em;
}
.entry-menu .word > span { display: inline-block; transform: translateY(105%); animation: rise .9s var(--ease) forwards; }
.entry-menu li:nth-child(2) .word > span { animation-delay: .08s; }
.entry-menu li:nth-child(3) .word > span { animation-delay: .16s; }
@keyframes rise { to { transform: none; } }
.entry-menu .count { font-family: var(--mono); font-size: 12px; color: var(--muted); opacity: 0; transform: translateX(-8px); transition: .35s var(--ease); white-space: nowrap; }
.entry-menu.has-active a { opacity: .22; }
.entry-menu.has-active a.active { opacity: 1; }
.entry-menu a.active .word { color: var(--accent); }
.entry-menu a.active .count { opacity: 1; transform: none; }

/* shutter page transition */
.shutter { position: fixed; inset: 0; z-index: 50; pointer-events: none; display: grid; grid-template-rows: 1fr 1fr; }
.shutter i { background: var(--bg); transform: scaleY(0); transition: transform .45s var(--ease); }
.shutter i:first-child { transform-origin: top; }
.shutter i:last-child { transform-origin: bottom; }
.shutter.close i { transform: scaleY(1); }

@media (max-width: 640px) {
  .entry-menu a { grid-template-columns: 2.4em auto; }
  .entry-menu .count { display: none; }
  .entry-menu .num { font-size: 11px; transform: translateY(-.9em); }
  .entry-bottom .hide-sm { display: none; }
}

/* ==========================================================================
   INNER PAGES
   ========================================================================== */
.site-header {
  position: sticky; top: 0; z-index: 20;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 18px var(--gutter);
  background: linear-gradient(var(--bg) 60%, rgba(13,13,15,0));
}
.site-header .brand { font-weight: 600; font-size: 15px; letter-spacing: -.01em; white-space: nowrap; }
.site-header .brand:hover { color: var(--accent); }
.site-nav { display: flex; gap: clamp(12px, 2.4vw, 28px); font-size: 14px; }
.site-nav a { color: var(--muted); position: relative; padding: 4px 0; transition: color .2s; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--text); }
.site-nav a[aria-current="page"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 1px; background: var(--accent); }
@media (max-width: 560px) {
  .site-header { flex-direction: column; align-items: flex-start; gap: 8px; padding-top: 14px; padding-bottom: 12px; }
  .site-nav { gap: 18px; font-size: 13px; }
}

main.page { padding: 0 var(--gutter) 80px; animation: pageIn .7s var(--ease) both; }
@keyframes pageIn { from { opacity: 0; transform: translateY(14px); } }

.page-intro { display: flex; justify-content: space-between; align-items: end; gap: 24px; flex-wrap: wrap; padding: clamp(28px, 8vh, 90px) 0 clamp(20px, 4vh, 40px); }
.page-title { margin: 0; font-size: clamp(44px, 8vw, 120px); font-weight: 600; line-height: .9; letter-spacing: -.045em; }
.page-title sup { font-family: var(--mono); font-size: 13px; font-weight: 400; letter-spacing: 0; color: var(--accent); vertical-align: top; margin-left: .3em; }
.page-lede { max-width: 38ch; margin: 0; color: var(--muted); }

/* filter chips */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.filters button { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; padding: 7px 12px; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); transition: .2s; }
.filters button:hover { color: var(--text); border-color: var(--muted); }
.filters button[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }

/* --- photography masonry --- */
.masonry { columns: 3 320px; column-gap: var(--gap); }
.masonry .ph { break-inside: avoid; margin: 0 0 var(--gap); position: relative; overflow: hidden; background: var(--surface); cursor: zoom-in; display: block; width: 100%; }
.masonry .ph img { width: 100%; height: auto; transition: transform .8s var(--ease), opacity .6s; opacity: 0; }
.masonry .ph img.loaded { opacity: 1; }
.masonry .ph:hover img { transform: scale(1.03); }
.ph .cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 30px 12px 10px; display: flex; justify-content: space-between; gap: 8px; text-align: left;
  background: linear-gradient(transparent, rgba(0,0,0,.7)); opacity: 0; transition: opacity .3s; font-size: 13px; }
.ph:hover .cap, .ph:focus-visible .cap { opacity: 1; }

/* --- card grid (design + video) --- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); gap: 40px var(--gap); }
.card { display: block; }
.card .media { position: relative; overflow: hidden; background: var(--surface); aspect-ratio: 4 / 3; }
.cards.video .card .media { aspect-ratio: 16 / 9; }
.card .media img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease), filter .5s; }
.card:hover .media img { transform: scale(1.035); }
.card .meta { display: flex; justify-content: space-between; gap: 12px; padding-top: 12px; }
.card h3 { margin: 0; font-size: 17px; font-weight: 500; letter-spacing: -.01em; transition: color .2s; }
.card:hover h3 { color: var(--accent); }
.card .sub { color: var(--muted); font-size: 14px; }
.card .tags { color: var(--muted); text-align: right; white-space: nowrap; }
.badge { position: absolute; right: 10px; bottom: 10px; background: rgba(0,0,0,.65); padding: 4px 7px; border-radius: 3px; backdrop-filter: blur(6px); }
.play { position: absolute; inset: 0; display: grid; place-items: center; opacity: 0; transition: opacity .3s; }
.play span { width: 64px; height: 64px; border-radius: 50%; background: var(--accent); display: grid; place-items: center; transform: scale(.8); transition: transform .4s var(--ease); }
.play span::before { content: ""; border-left: 16px solid var(--bg); border-top: 10px solid transparent; border-bottom: 10px solid transparent; margin-left: 4px; }
.card:hover .play { opacity: 1; }
.card:hover .play span { transform: none; }

/* showreel */
.reel { margin: 0 0 56px; }
.reel-label { display: flex; justify-content: space-between; margin-bottom: 10px; }

/* --- player (video embed or placeholder) --- */
.player { position: relative; aspect-ratio: 16 / 9; background: #000; overflow: hidden; }
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player .ph-frame { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; color: var(--muted); background-size: cover; background-position: center; }
.player .ph-frame::before { content: ""; position: absolute; inset: 0; background: rgba(0,0,0,.6); }
.player .ph-frame div { position: relative; padding: 20px; }

/* --- project detail page --- */
.project-head { padding: clamp(28px, 7vh, 80px) 0 28px; display: grid; gap: 28px; }
.project-head h1 { margin: 0; font-size: clamp(40px, 7vw, 104px); font-weight: 600; line-height: .92; letter-spacing: -.045em; max-width: 14ch; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 16px; border-top: 1px solid var(--line); padding-top: 16px; margin: 0; }
.facts div { min-width: 0; }
.facts dt { color: var(--muted); margin-bottom: 4px; }
.facts dd { margin: 0; font-size: 15px; }
.project-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 40px; padding: 48px 0; }
.project-body .summary { font-size: clamp(19px, 2vw, 24px); line-height: 1.35; letter-spacing: -.01em; margin: 0; }
.prose { color: #c9c8c3; max-width: 66ch; }
.prose h2, .prose h3 { color: var(--text); font-weight: 600; letter-spacing: -.02em; margin: 1.6em 0 .5em; }
.prose h2:first-child, .prose h3:first-child, .prose p:first-child { margin-top: 0; }
.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.stack { display: grid; gap: var(--gap); }
.stack img { width: 100%; height: auto; background: var(--surface); }
.stack .pair { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); }
.credits { columns: 2 220px; margin: 0; padding: 0; list-style: none; }
.credits li { break-inside: avoid; padding: 8px 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; }
.next { display: block; margin-top: 80px; padding-top: 24px; border-top: 1px solid var(--line); }
.next .t { font-size: clamp(32px, 6vw, 80px); font-weight: 600; letter-spacing: -.04em; line-height: 1; transition: color .2s; }
.next:hover .t { color: var(--accent); }
@media (max-width: 760px) {
  .project-body { grid-template-columns: 1fr; gap: 20px; padding: 32px 0; }
  .stack .pair { grid-template-columns: 1fr; }
}

/* --- about --- */
.about { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: clamp(28px, 5vw, 80px); padding-top: clamp(28px, 7vh, 80px); }
.about .portrait { aspect-ratio: 4 / 5; object-fit: cover; width: 100%; background: var(--surface); }
.about h1 { font-size: clamp(32px, 4.4vw, 60px); font-weight: 600; line-height: 1.02; letter-spacing: -.035em; margin: 0 0 28px; }
.about h1 em { font-style: normal; color: var(--accent); }
.about .block { border-top: 1px solid var(--line); padding: 16px 0 28px; display: grid; grid-template-columns: 140px 1fr; gap: 16px; }
.about .block ul { margin: 0; padding: 0; list-style: none; }
.about .big-mail { font-size: clamp(22px, 3vw, 36px); letter-spacing: -.02em; border-bottom: 1px solid var(--accent); overflow-wrap: anywhere; }
.about .big-mail:hover { color: var(--accent); }
@media (max-width: 760px) {
  .about { grid-template-columns: 1fr; }
  .about .portrait { max-width: 420px; }
  .about .block { grid-template-columns: 1fr; gap: 8px; }
}

/* --- footer --- */
.site-footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px; padding: 24px var(--gutter) 32px; border-top: 1px solid var(--line); margin: 0 var(--gutter); padding-left: 0; padding-right: 0; color: var(--muted); }
.site-footer nav { display: flex; gap: 18px; flex-wrap: wrap; }
.site-footer a:hover { color: var(--text); }

/* --- lightbox --- */
.lightbox { position: fixed; inset: 0; z-index: 60; background: rgba(8,8,10,.97); display: none; grid-template-rows: auto 1fr auto; }
.lightbox.open { display: grid; animation: fadeIn .25s ease; }
@keyframes fadeIn { from { opacity: 0; } }
.lightbox .lb-top, .lightbox .lb-bottom { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px var(--gutter); }
.lightbox .lb-stage { position: relative; display: grid; place-items: center; min-height: 0; padding: 0 var(--gutter); }
.lightbox img { max-width: 100%; max-height: calc(100svh - 130px); width: auto; height: auto; object-fit: contain; }
.lightbox .lb-nav { position: absolute; top: 0; bottom: 0; width: 30%; }
.lightbox .lb-prev { left: 0; cursor: w-resize; }
.lightbox .lb-next { right: 0; cursor: e-resize; }
.lightbox .lb-close:hover { color: var(--accent); }

.empty { padding: 60px 0; color: var(--muted); }

/* Safety net: once settled, intro animations can never leave content hidden. */
.settled main.page, .settled .entry-menu .word > span { animation: none; transform: none; opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
