/* =====================================================================
   Colours, fonts and sizes live at the top. Change them here and the
   whole site follows.
   ===================================================================== */

/* Self-hosted fonts (files in /fonts, all SIL Open Font Licence) */
@font-face { font-family: "Gloock"; src: url("../fonts/gloock-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url("../fonts/atkinson-hyperlegible-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url("../fonts/atkinson-hyperlegible-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url("../fonts/atkinson-hyperlegible-700-normal.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Kalam"; src: url("../fonts/kalam-300-normal.woff2") format("woff2"); font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: "Kalam"; src: url("../fonts/kalam-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "DM Mono"; src: url("../fonts/dm-mono-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }

:root {
  --orange: #ff4d00;       /* page background, her pick (text on it: 4.7:1) */
  --orange-hot: #ff6a1c;   /* light leak, top of page */
  --ink: #4a0a0c;          /* body text: deep red. Any brighter fails 4.5:1 on the orange */
  --frame: #b80f1f;        /* her crimson: video borders, headings, nav, footer, film strip */
  --red: var(--frame);     /* headings. Crimson on the orange is only 2:1, so it is kept to large text */
  --blue: #1aa3d4;         /* her light blue (from the Love in an STD Clinic end titles) */
  --navy: #1c2747;         /* keyboard focus outline */
  --cream: #fbeedd;        /* text on crimson */
  --print: #fbf3e8;        /* cream paper: contact form */
  --glow: #ffb07a;         /* light orange used on crimson (3.8:1, large text only) */
  --wine: #7a0a12;         /* deeper red for large text on the blue (3.9:1) */
  --film: #1a0d0b;         /* screens behind the videos */

  --display: "Kalam", "Segoe Print", "Comic Sans MS", cursive;   /* handwritten: headings and main text */
  --serif: "Gloock", Georgia, "Times New Roman", serif;          /* previous heading font, unused for now */
  --body: "Atkinson Hyperlegible", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --mono: "DM Mono", Consolas, "Courier New", monospace;

  --strip: 44px;           /* width of the film strip down the left edge */
  --shell: 1180px;         /* max content width */
  --gutter: clamp(20px, 4vw, 48px);
}

/* ---------- base and background ---------- */
* { box-sizing: border-box; }
html {
  position: relative;
  min-height: 100%;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  background: var(--orange);
}

/* light leak: warm burned light at the top right, scrolling with the page */
html::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(min(640px, 70vw) 420px at 90% 0, rgba(255, 196, 110, .85), transparent 70%),
    radial-gradient(420px 700px at 100% 640px, rgba(255, 150, 70, .5), transparent 70%),
    radial-gradient(min(760px, 90vw) 360px at 0 1100px, rgba(255, 160, 80, .45), transparent 70%),
    linear-gradient(170deg, var(--orange-hot) 0, var(--orange) 900px);
}

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-left: var(--strip);
  color: var(--ink);
  font: 400 18px/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
}
main { flex: 1 0 auto; }   /* pushes the footer to the bottom on short pages */
/* film grain over everything */
body::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 40;
  pointer-events: none;
  opacity: .2;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .3  0 0 0 0 .1  0 0 0 0 .05  0 0 0 .6 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
/* 35mm film strip down the left edge, sprocket holes and all */
body::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: var(--strip);
  background-color: var(--frame);
  background-image: repeating-linear-gradient(to bottom, transparent 0 10px, var(--blue) 10px 26px, transparent 26px 36px);
  background-size: calc(var(--strip) / 2) 100%;
  background-position: center top;
  background-repeat: no-repeat;
}

img, video, iframe { display: block; max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--navy); outline-offset: 3px; }

.shell { width: min(var(--shell), 100% - 2 * var(--gutter)); margin-inline: auto; }
.skip-link {
  position: absolute; z-index: 100; top: 8px; left: calc(var(--strip) + 8px); padding: 12px 16px;
  transform: translateY(-200%); background: var(--ink); color: var(--cream);
}
.skip-link:focus { transform: none; }

/* ---------- type ---------- */
h1, h2, h3 { margin: 0; color: var(--red); font-family: var(--display); font-weight: 400; line-height: 1.12; letter-spacing: 0; }
h1 { font-size: clamp(34px, 4.6vw, 56px); }
h2 { font-size: clamp(28px, 3.2vw, 40px); }
h3 { font-size: clamp(21px, 2vw, 25px); line-height: 1.12; }
p { margin: 0 0 1em; }
.lede { max-width: 46ch; margin: 16px 0 0; font: 400 clamp(20px, 2.1vw, 24px)/1.45 var(--display); }
.mono { font-family: var(--mono); font-size: 15px; letter-spacing: 0; }

/* anything still to fill in: faded, italic, dashed underline. Search the files for "TODO". */
.todo {
  font-style: italic;
  opacity: .62;
  text-decoration: underline dashed 1.5px;
  text-underline-offset: .22em;
}
/* the display font has no italic, so keep display placeholders upright */
h1 .todo, h2 .todo, h3 .todo, .wordmark .todo, .footer-email .todo, .contact-email .todo, .pager .todo { font-style: normal; }

/* ---------- header and navigation ---------- */
.site-header {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 28px;
  width: min(var(--shell), 100% - 2 * var(--gutter)); margin-inline: auto; padding: 24px 0;
}
/* her name in her blue with a dark red outline round each letter (blue alone on the orange is 1.2:1) */
.wordmark {
  display: inline-block; color: var(--blue); font: 400 clamp(24px, 2.6vw, 30px)/1.3 var(--display); text-decoration: none;
  -webkit-text-stroke: 2.4px var(--ink); paint-order: stroke fill;
}
.site-nav { display: flex; flex-wrap: wrap; gap: 4px clamp(18px, 2.4vw, 32px); }
.site-nav a { padding: 6px 2px 10px; color: var(--frame); font-weight: 700; font-size: 18px; text-decoration: none; }
.site-nav a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }
/* the current page gets a hand-drawn chinagraph pencil stroke */
.site-nav a[aria-current="page"] {
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 12' preserveAspectRatio='none'><path d='M2 8c18-4 40-6 62-5 12 .5 24 1.5 34 3' fill='none' stroke='%23b80f1f' stroke-width='3.2' stroke-linecap='round'/></svg>") left bottom / 100% 10px no-repeat;
}
.site-nav a[aria-current="page"]:hover { text-decoration: none; }

/* ---------- film frame: a red print border round a 16:9 screen ---------- */
.frame {
  position: relative;
  padding: 12px;
  background: var(--frame);
  box-shadow: 0 1px 0 rgba(61, 10, 16, .25), 0 10px 24px -14px rgba(61, 10, 16, .45);
  transition: transform .2s ease;
}
.frame-inner { position: relative; overflow: hidden; aspect-ratio: 16 / 9; background: var(--film); }
.frame-inner > iframe, .frame-inner > video, .frame-inner > img {
  position: absolute; inset: 0; width: 100%; height: 100%; border: 0; object-fit: cover;
}
.placeholder {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; padding: 16px; text-align: center; background: var(--film); color: var(--cream);
}
.play {
  display: grid; place-items: center; width: 58px; height: 58px; padding-left: 4px;
  border: 2px solid var(--cream); border-radius: 50%; font-size: 18px;
}

/* ---------- home ---------- */
.hero { padding: clamp(8px, 2vw, 24px) 0 clamp(8px, 2vw, 24px); }
.status { margin: 10px 0 0; }
.reel { margin-top: clamp(28px, 3.4vw, 44px); width: min(100%, 760px, max(480px, calc((100vh - 460px) * 16 / 9))); }
.reel-bar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 20px; margin-top: 14px; font-family: var(--mono); font-size: 15px; }
.reel-tabs { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.reel-tabs:empty { display: none; }

.section { padding-block: clamp(40px, 6vw, 84px); }
.section-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px 24px; margin-bottom: clamp(24px, 3.5vw, 40px); }
.text-link { font-weight: 700; text-decoration-thickness: 2px; text-underline-offset: 5px; }
.text-link:hover { text-decoration-color: var(--frame); }

/* About teaser: a crimson band with light orange writing */
.band { position: relative; background: var(--frame); color: var(--glow); }
.band .btn { background: var(--blue); border-color: var(--blue); color: var(--ink); }
.band .btn:hover { background: var(--glow); border-color: var(--glow); }
.band :focus-visible { outline-color: #fff; }
.band .section { display: grid; grid-template-columns: 1.1fr 1fr; align-items: center; gap: 24px clamp(28px, 6vw, 80px); }
.band p { margin: 0 0 18px; font: 400 clamp(24px, 2.4vw, 28px)/1.45 var(--display); }
.band p:last-child { margin-bottom: 0; }

/* ---------- film cards ---------- */
.grid { display: grid; grid-template-columns: 1fr; gap: clamp(32px, 4vw, 52px) clamp(20px, 3vw, 36px); align-items: start; }
.card { display: block; text-decoration: none; }
.card .frame { padding: 8px; }
.card:hover .frame, .card:focus-visible .frame { transform: translateY(-4px) rotate(-.6deg); }
.card:focus-visible { outline-offset: 8px; }
.card-meta { display: flex; flex-direction: column; gap: 4px; margin-top: 16px; }
.card-meta p { display: flex; flex-wrap: wrap; gap: 2px 16px; margin: 0; font-family: var(--mono); font-size: 15px; }

/* filter buttons: her blue writing in crimson-edged boxes. The fill is dark red because
   blue straight on the orange can't be read (1.2:1); blue on dark red is 5.4:1 */
.chip {
  padding: 9px 18px; border: 2px solid var(--frame); border-radius: 3px;
  background: var(--ink); color: var(--blue); cursor: pointer; font: 700 16px/1 var(--body);
}
.chip:hover { border-color: var(--blue); }
.chip[aria-pressed="true"] { background: var(--blue); border-color: var(--frame); color: var(--ink); }
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin: 28px 0 clamp(28px, 4vw, 44px); }
.filters:empty { display: none; }

@media (min-width: 680px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  /* projects page: every film the same size, zig-zagging left, right, left... */
  #project-grid { grid-template-columns: 1fr; }
  #project-grid .card { width: 62%; }
  #project-grid .card:nth-child(even) { justify-self: end; }
}
@media (min-width: 1000px) {
  /* home: three films stepping down */
  .grid-featured { grid-template-columns: repeat(3, 1fr); }
  .grid-featured .card:nth-child(2) { margin-top: 44px; }
  .grid-featured .card:nth-child(3) { margin-top: 88px; }
}

/* ---------- inner pages ---------- */
.page { padding-top: clamp(8px, 2vw, 24px); padding-bottom: clamp(48px, 7vw, 96px); }
.page > h1 { margin-bottom: 0; }

/* film page */
.back { margin: 0 0 14px; font-weight: 700; }
#project > h1 { margin-bottom: clamp(20px, 3vw, 32px); }
.detail { display: grid; grid-template-columns: 1.4fr 1fr; gap: 28px clamp(28px, 6vw, 80px); margin-top: clamp(28px, 4vw, 44px); }
.synopsis { max-width: 54ch; margin: 0; font: 400 clamp(20px, 2.1vw, 24px)/1.55 var(--display); }
.facts { display: grid; gap: 16px; margin: 0; }
.fact { padding-top: 12px; border-top: 2px solid var(--ink); }
.fact dt { font-family: var(--mono); font-size: 15px; }
.fact dd { margin: 2px 0 0; }
.credit { display: block; }
#project > h2 { margin: clamp(40px, 6vw, 72px) 0 20px; }
.stills { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 24px; }
.stills .frame { padding: 8px; }
.pager { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 20px; margin-top: clamp(40px, 6vw, 72px); padding-top: 20px; border-top: 2px solid var(--ink); }
.pager a { display: flex; flex-direction: column; gap: 4px; text-decoration: none; font: 400 clamp(22px, 2.4vw, 28px)/1.1 var(--display); }
.pager a:last-child { text-align: right; }
.pager small { font: 400 15px/1.4 var(--mono); }
.pager a:hover span { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 5px; }

/* about */
.about-grid { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 28px clamp(28px, 6vw, 80px); align-items: start; margin-top: clamp(24px, 4vw, 44px); }
.portrait .frame-inner { aspect-ratio: 4 / 5; }
.prose { max-width: 58ch; font: 400 clamp(20px, 2.1vw, 23px)/1.55 var(--display); }
.prose p:first-child { font-size: clamp(23px, 2.6vw, 29px); line-height: 1.4; }
.timeline { margin: 0; padding: 0; list-style: none; }
.timeline li { display: grid; grid-template-columns: minmax(96px, 160px) 1fr; gap: 6px 24px; padding: 18px 0; border-top: 2px solid var(--ink); }
.timeline li:last-child { border-bottom: 2px solid var(--ink); }
.timeline p { margin: 4px 0 0; }
.timeline .when { font-family: var(--mono); font-size: 15px; padding-top: 4px; }
.skills { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 28px; }
.skill { padding-top: 14px; border-top: 2px solid var(--ink); }
.skill ul { margin: 12px 0 0; padding: 0; list-style: none; }
.skill li { padding: 3px 0; }

/* contact */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 36px clamp(28px, 7vw, 96px); align-items: start; margin-top: clamp(24px, 4vw, 48px); }
.contact-email {
  display: inline-block; font: 400 clamp(28px, 4vw, 48px)/1.1 var(--display);
  overflow-wrap: anywhere; text-decoration-thickness: 2px; text-underline-offset: 7px;
}
a.contact-email:hover { text-decoration-color: var(--frame); }
.contact-side p { margin: 18px 0 0; }
.contact-side .social { margin-top: 24px; font-size: 19px; font-weight: 700; }
.form-panel { padding: clamp(20px, 3vw, 32px); background: var(--print); box-shadow: 0 1px 0 rgba(61, 10, 16, .25), 0 10px 24px -14px rgba(61, 10, 16, .45); }
.form { display: grid; gap: 18px; }
.form label { display: block; font-weight: 700; }
.form input, .form textarea {
  display: block; width: 100%; margin-top: 8px; padding: 12px 14px;
  border: 2px solid var(--ink); border-radius: 3px; background: #fff; color: var(--ink); font: inherit;
}
.form textarea { min-height: 150px; resize: vertical; }
.form input:focus-visible, .form textarea:focus-visible { outline: 3px solid var(--navy); outline-offset: 0; }
.hp { display: none; }
.btn {
  display: inline-block; padding: 14px 24px; border: 2px solid var(--ink); border-radius: 3px;
  background: var(--ink); color: var(--cream); cursor: pointer; text-decoration: none; font: 700 17px/1 var(--body);
  transition: background-color .15s ease, border-color .15s ease;
}
.btn:hover { background: var(--frame); border-color: var(--frame); }
.prose .btn, .section .btn { margin-top: 8px; }

/* ---------- footer: the bold blue bar ---------- */
.site-footer { position: relative; z-index: 1; padding: clamp(72px, 9vw, 120px) 0 32px; background: var(--blue); color: var(--ink); }
/* a strip of film along the top edge, so the blue doesn't butt straight against the orange */
.site-footer::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 26px;
  background-color: var(--frame);
  background-image: repeating-linear-gradient(to right, transparent 0 10px, var(--blue) 10px 26px, transparent 26px 36px);
  background-size: 100% 12px; background-position: left center; background-repeat: no-repeat;
}
.footer-email { display: inline-block; margin-bottom: clamp(32px, 5vw, 56px); color: var(--wine); font: 400 clamp(30px, 5.4vw, 68px)/1.08 var(--display); overflow-wrap: anywhere; text-decoration: none; }
a.footer-email:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 8px; }
.footer-row { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 14px 32px; padding-top: 22px; border-top: 2px solid rgba(74, 10, 12, .35); font-size: 16px; }
.footer-row p { margin: 0; }
.social { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 0; padding: 0; list-style: none; }
.footer-row a { font-weight: 700; }
.site-footer :focus-visible { outline-color: var(--ink); }

/* ---------- small screens ---------- */
@media (max-width: 800px) {
  .band .section, .detail, .about-grid, .contact-grid { grid-template-columns: 1fr; }
  .portrait { max-width: 320px; }
  .timeline li { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  :root { --strip: 18px; --gutter: 18px; }
  body::after { background-size: 10px 100%; }
  .site-header { padding: 18px 0 12px; }
  .site-nav { gap: 2px 20px; }
  .frame { padding: 8px; }
  .card .frame { padding: 6px; }
  .pager a:last-child { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
  .card:hover .frame, .card:focus-visible .frame { transform: none; }
}
