/* ==========================================================================
   James O'Connor — Screenwriting portfolio
   Colours and type live at the top. Change them here, nowhere else.
   ========================================================================== */

:root {
  --bg:        #0b0b0d;
  --line:      #26262d;
  --line-soft: #1c1c22;
  --text:      #edebe7;
  --muted:     #928d85;
  --muted-2:   #6d6862;
  --accent:    #d9a441;
  --accent-dim:#8a6a2c;

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --serif: ui-serif, Georgia, "Iowan Old Style", "Times New Roman", serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --wrap: 980px;
  --pad: clamp(1.25rem, 5vw, 3.5rem);
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; }

.skip {
  position: absolute; left: -9999px;
  background: var(--accent); color: #000; padding: .6rem 1rem; z-index: 100;
}
.skip:focus { left: 1rem; top: 1rem; }

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

/* ---------------------------------------------------------------- topbar */

.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem;
  padding: .9rem var(--pad);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line-soft);
}

.topbar__name {
  font-weight: 600; letter-spacing: -.01em; text-decoration: none;
  font-size: .95rem;
}

.topbar__nav { display: flex; gap: 1.4rem; }
.topbar__nav a {
  font-family: var(--mono);
  font-size: .74rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); text-decoration: none;
  transition: color .18s ease;
}
.topbar__nav a:hover { color: var(--accent); }

/* "Screenplays and Pilots" is too long to sit beside the name on a phone.
   Stack the nav under it rather than letting the links wrap raggedly. */
@media (max-width: 560px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: .55rem;
    padding: .8rem 1rem;
  }
  .topbar__name { font-size: .85rem; }
  .topbar__nav { gap: 1.1rem; }
  .topbar__nav a { font-size: .64rem; letter-spacing: .08em; }
}

/* ------------------------------------------------------------------ hero */

.hero {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: clamp(4rem, 14vh, 9rem) var(--pad) clamp(3rem, 9vh, 6rem);
}

.hero__role {
  font-family: var(--mono);
  font-size: .76rem; letter-spacing: .28em; text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 1.4rem;
}

.hero__name {
  margin: 0;
  font-size: clamp(2.9rem, 10vw, 6.5rem);
  line-height: .93;
  letter-spacing: -.035em;
  font-weight: 700;
}

.hero__intro {
  max-width: 46ch;
  /* Keeps the two halves of the line from splitting mid-phrase. */
  text-wrap: balance;
  margin: 2rem 0 0;
  font-family: var(--serif);
  font-size: clamp(1.05rem, 2.1vw, 1.3rem);
  line-height: 1.62;
  color: #c9c5bf;
}

/* --------------------------------------------------------------- sections */

.section-label {
  font-family: var(--mono);
  font-size: .74rem; letter-spacing: .22em; text-transform: uppercase;
  color: var(--muted-2);
  font-weight: 400;
  margin: 0 0 2rem;
  padding-bottom: .9rem;
  border-bottom: 1px solid var(--line-soft);
}

/* No document yet — a clear next step instead of a page that just stops. */
.docs__none {
  margin: 3rem 0 0;
  font-family: var(--mono);
  font-size: .74rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted-2);
}
.docs__ask {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--accent-dim);
  padding-bottom: .2rem;
  margin-left: .5rem;
}
.docs__ask:hover { color: #eab455; border-color: #eab455; }

.work, .about {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: clamp(2.5rem, 7vh, 4.5rem) var(--pad);
}

/* -------------------------------------------------------------- projects */

.projects { list-style: none; margin: 0; padding: 0; }

.project {
  border-bottom: 1px solid var(--line-soft);
}

.project__link {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .5rem 2rem;
  align-items: start;
  padding: 2.1rem 0;
  text-decoration: none;
  transition: opacity .2s ease;
}
.project__link:hover { opacity: 1; }
.projects:hover .project__link { opacity: .52; }
.projects:hover .project__link:hover { opacity: 1; }
.project__link:focus-visible { opacity: 1; }

.project__head { grid-column: 1; }

.project__title {
  margin: 0;
  font-size: clamp(1.7rem, 4.2vw, 2.6rem);
  line-height: 1.05;
  letter-spacing: -.03em;
  font-weight: 650;
  transition: color .2s ease;
}
.project__link:hover .project__title { color: var(--accent); }

.project__meta {
  margin: .7rem 0 0;
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--muted-2);
  display: flex; flex-wrap: wrap; gap: .5rem .9rem;
}
.project__meta span { white-space: nowrap; }

/* Award hint in the work list — results only, full names on the project page. */
.project__awards {
  margin: .55rem 0 0;
  font-family: var(--mono);
  font-size: .67rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent);
}

.project__logline {
  grid-column: 1;
  margin: 1rem 0 0;
  max-width: 58ch;
  font-family: var(--serif);
  font-size: 1.03rem;
  line-height: 1.6;
  color: #b8b4ad;
}

.project__go {
  grid-column: 2; grid-row: 1 / span 3;
  align-self: center;
  font-family: var(--mono);
  font-size: .72rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted-2);
  white-space: nowrap;
  transition: color .2s ease, transform .2s ease;
}
.project__link:hover .project__go { color: var(--accent); transform: translateX(3px); }

@media (max-width: 620px) {
  .project__link { grid-template-columns: 1fr; }
  .project__go { grid-column: 1; grid-row: auto; margin-top: 1.1rem; }
}

/* ------------------------------------------------------------ about/contact */

.about__body {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: start;
}
.about__text { max-width: 52ch; }
.about__body p { margin: 0 0 1.2rem; color: #c2beb7; }
.about__body p:last-child { margin-bottom: 0; }
.about__body em { color: var(--muted-2); font-style: normal; }

/* The source PNG is already circle-cropped with transparent corners, so the
   radius matches the artwork rather than clipping it. */
.about__photo {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  border-radius: 50%;
}

@media (max-width: 640px) {
  .about__body { grid-template-columns: minmax(0, 1fr); }
  .about__photo { max-width: 160px; }
}

/* Contact now lives inside About — one section, one nav item. */
.about__contact {
  display: flex; flex-wrap: wrap; gap: .8rem;
  margin-top: 1.8rem;
}
.about__contact p { margin: 0; color: var(--muted-2); font-size: .92rem; }
.about__contact code {
  font-family: var(--mono); font-size: .85em; color: var(--muted);
}

.btn {
  display: inline-block;
  font-family: var(--mono);
  font-size: .76rem; letter-spacing: .12em; text-transform: uppercase;
  text-decoration: none;
  padding: .85rem 1.5rem;
  border: 1px solid var(--line);
  border-radius: 2px;
  color: var(--text);
  transition: border-color .18s ease, color .18s ease, background .18s ease;
}
.btn:hover { border-color: var(--accent-dim); color: var(--accent); }

.btn--primary {
  background: var(--accent); color: #16130c; border-color: var(--accent);
  font-weight: 600;
}
.btn--primary:hover { background: #eab455; color: #16130c; border-color: #eab455; }

/* ---------------------------------------------------------------- detail */

.detail {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: clamp(2rem, 6vh, 3.5rem) var(--pad) 4rem;
}

.detail__back {
  display: inline-block;
  font-family: var(--mono);
  font-size: .74rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); text-decoration: none;
  margin-bottom: 2.6rem;
}
.detail__back:hover { color: var(--accent); }

.detail__title {
  margin: 0;
  font-size: clamp(2.3rem, 7vw, 4rem);
  line-height: 1;
  letter-spacing: -.035em;
  font-weight: 700;
}

.detail__meta {
  margin: 1.4rem 0 0;
  font-family: var(--mono);
  font-size: .74rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted-2);
  display: flex; flex-wrap: wrap; gap: .5rem 1.1rem;
}

.detail__logline {
  margin: 2.4rem 0 0;
  max-width: 54ch;
  font-family: var(--serif);
  font-size: clamp(1.15rem, 2.6vw, 1.45rem);
  line-height: 1.55;
  color: var(--text);
  border-left: 2px solid var(--accent-dim);
  padding-left: 1.4rem;
}

.detail__desc {
  margin: 2.2rem 0 0;
  max-width: 62ch;
  color: #bcb8b1;
}

/* ------------------------------------------------- documents (title pages) */

.docs {
  display: grid;
  grid-template-columns: minmax(0, 620px);
  gap: clamp(1.75rem, 4vw, 3rem);
  margin: 3.5rem 0 0;
}
/* Two or more documents sit side by side and share the width. */
.docs--multi {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  max-width: 640px;
}

.doc { margin: 0; }

.doc__btn {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
  transition: transform .22s ease;
}
.doc__btn:hover { transform: translateY(-3px); }

.doc__img {
  display: block;
  width: 100%;
  height: auto;
  /* US Letter. Reserves the space before the image loads so the page doesn't
     shift under the reader as it arrives. */
  aspect-ratio: 8.5 / 11;
  background: #f4f2ee;
  border: 1px solid var(--line);
  border-radius: 2px;
  /* The pages are white — lift them off the dark background. */
  box-shadow: 0 12px 34px rgba(0, 0, 0, .6);
  transition: border-color .22s ease, box-shadow .22s ease;
}
.doc__btn:hover .doc__img {
  border-color: var(--accent-dim);
  box-shadow: 0 18px 44px rgba(0, 0, 0, .72);
}

.doc__cap {
  display: flex; flex-direction: column; align-items: center;
  gap: .4rem;
  margin-top: 1rem;
  text-align: center;
}

.doc__label {
  font-family: var(--mono);
  font-size: .72rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--text);
}

.doc__meta {
  font-family: var(--mono);
  font-size: .66rem; letter-spacing: .11em; text-transform: uppercase;
  color: var(--muted-2);
  transition: color .22s ease;
}
.doc:hover .doc__meta { color: var(--accent); }

.doc__dl {
  margin-top: .35rem;
  font-family: var(--mono);
  font-size: .66rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted-2);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  padding-bottom: .25rem;
  transition: color .18s ease, border-color .18s ease;
}
.doc__dl:hover { color: var(--accent); border-color: var(--accent-dim); }

/* ---------------------------------------------------------- sketch page */

.sketch__intro {
  margin: 1.6rem 0 3rem;
  max-width: 46ch;
  font-family: var(--serif);
  font-size: clamp(1.05rem, 2.1vw, 1.25rem);
  line-height: 1.6;
  color: #c9c5bf;
  text-wrap: balance;
}

.sketch__empty {
  margin: 0 0 3rem;
  color: var(--muted-2);
  font-size: .92rem;
}
.sketch__empty code {
  font-family: var(--mono); font-size: .85em; color: var(--muted);
}

/* videos */

.videos {
  display: grid;
  gap: clamp(1.1rem, 2.5vw, 1.75rem);
  margin: 0 0 2.5rem;
}
.videos:last-of-type { margin-bottom: 3.5rem; }

/* Vertical Shorts sit four across and stay narrow. */
.videos--reels {
  grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
}
/* Wide pieces get real width. */
.videos--wide {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.video { margin: 0; }
.video--vertical .video__frame { aspect-ratio: 9 / 16; }

.video__frame {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
  /* Lift the players off the dark page rather than letting them sink into it. */
  box-shadow: 0 10px 28px rgba(0, 0, 0, .5);
  transition: border-color .22s ease, box-shadow .22s ease;
}
.video:hover .video__frame {
  border-color: var(--accent-dim);
  box-shadow: 0 14px 36px rgba(0, 0, 0, .68);
}
.video__frame iframe {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  border: 0;
}

.video__cap {
  display: flex; flex-direction: column; gap: .3rem;
  margin-top: .8rem;
}
.video__title {
  font-weight: 600;
  font-size: .95rem;
  line-height: 1.35;
  letter-spacing: -.012em;
  color: #ddd9d3;
  transition: color .22s ease;
}
.video:hover .video__title { color: var(--text); }

/* Reels are narrow — the headline needs to be smaller to sit well. */
.videos--reels .video__title { font-size: .8rem; line-height: 1.32; }

.video__meta {
  font-family: var(--mono);
  font-size: .66rem; letter-spacing: .11em; text-transform: uppercase;
  color: var(--muted-2);
}

/* sketch list */

.sk-list { list-style: none; margin: 0 0 3.5rem; padding: 0; }

.sk { border-bottom: 1px solid var(--line-soft); }

.sk__btn {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1.5rem;
  width: 100%;
  padding: 1.5rem 0;
  background: none; border: 0;
  color: inherit; text-align: left;
  font: inherit;
  cursor: pointer;
  transition: opacity .2s ease;
}
.sk-list:hover .sk__btn { opacity: .5; }
.sk-list:hover .sk__btn:hover { opacity: 1; }
.sk__btn:focus-visible { opacity: 1; }

.sk__head { display: block; min-width: 0; }

.sk__title {
  display: block;
  font-size: clamp(1.02rem, 2vw, 1.2rem);
  line-height: 1.32;
  letter-spacing: -.012em;
  font-weight: 550;
  transition: color .2s ease;
}
.sk__btn:hover .sk__title { color: var(--accent); }

.sk__note {
  display: block;
  margin-top: .35rem;
  font-family: var(--serif);
  font-size: .95rem;
  color: var(--muted);
}

.sk__meta {
  display: flex; flex-wrap: wrap; gap: .4rem .85rem;
  margin-top: .6rem;
  font-family: var(--mono);
  font-size: .67rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted-2);
}

.sk__go {
  flex: 0 0 auto;
  font-family: var(--mono);
  font-size: .68rem; letter-spacing: .13em; text-transform: uppercase;
  color: var(--muted-2);
  white-space: nowrap;
  transition: color .2s ease, transform .2s ease;
}
.sk__btn:hover .sk__go { color: var(--accent); transform: translateX(3px); }

@media (max-width: 620px) {
  .sk__btn { flex-direction: column; align-items: flex-start; gap: .9rem; }
}

/* -------------------------------------------------------------- lightbox */

body.is-locked { overflow: hidden; }

.lightbox {
  position: fixed; inset: 0; z-index: 200;
  display: flex; flex-direction: column;
  background: rgba(6, 6, 8, .97);
  backdrop-filter: blur(6px);
  animation: lb-in .16s ease-out;
}
@keyframes lb-in { from { opacity: 0 } to { opacity: 1 } }

.lightbox__bar {
  flex: 0 0 auto;
  display: flex; align-items: center; gap: 1rem;
  padding: .85rem clamp(1rem, 4vw, 2rem);
  border-bottom: 1px solid var(--line);
  background: rgba(11, 11, 13, .92);
}

.lightbox__title {
  font-weight: 650; letter-spacing: -.01em; font-size: 1rem;
}
.lightbox__meta {
  font-family: var(--mono);
  font-size: .7rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted-2);
}

.lightbox__close {
  margin-left: auto;
  font-family: var(--mono);
  font-size: .7rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--text);
  background: none;
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: .55rem 1rem;
  cursor: pointer;
  transition: border-color .18s ease, color .18s ease;
}
.lightbox__close:hover { border-color: var(--accent-dim); color: var(--accent); }

.lightbox__scroll {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: clamp(1rem, 3vw, 2.5rem) clamp(.75rem, 3vw, 2rem);
  display: flex; flex-direction: column; align-items: center;
  gap: clamp(.75rem, 2vw, 1.5rem);
}

.lightbox__page {
  display: block;
  width: 100%;
  max-width: 900px;
  height: auto;
  aspect-ratio: 8.5 / 11;
  background: #fff;
  border-radius: 2px;
  box-shadow: 0 8px 26px rgba(0, 0, 0, .6);
}

@media (max-width: 620px) {
  .docs { margin-top: 2.5rem; }
  .lightbox__meta { display: none; }
}

.detail__comps {
  margin: 1.6rem 0 0;
  font-family: var(--mono);
  font-size: .76rem;
  color: var(--muted-2);
  letter-spacing: .04em;
}
.detail__comps b {
  color: var(--muted); font-weight: 400;
  text-transform: uppercase; letter-spacing: .14em; font-size: .72rem;
  display: block; margin-bottom: .45rem;
}

/* ---------------------------------------------------------------- awards */

.awards {
  margin: 2.8rem 0 0;
  padding: 1.6rem 0 0;
  border-top: 1px solid var(--line-soft);
}

.awards__label {
  margin: 0 0 1.2rem;
  font-family: var(--mono);
  font-size: .68rem; letter-spacing: .22em; text-transform: uppercase;
  font-weight: 400;
  color: var(--muted-2);
}

.awards__laurels {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 1.5rem;
  margin: 0 0 1.4rem;
}

/* Laurel art is black on transparency — invert to sit on the dark page. */
.laurel {
  display: block;
  height: 78px;
  width: auto;
  filter: invert(1);
  opacity: .88;
}

.awards__list { list-style: none; margin: 0; padding: 0; }

.award {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: .1rem .7rem;
  padding: .5rem 0;
}
.award + .award { border-top: 1px solid var(--line-soft); }

.award__result {
  font-family: var(--mono);
  font-size: .7rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent);
  white-space: nowrap;
}
.award__name {
  font-size: .92rem;
  color: var(--muted);
}
.award__name--link {
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  transition: color .18s ease, border-color .18s ease;
}
.award__name--link:hover { color: var(--accent); border-color: var(--accent-dim); }

/* ---------------------------------------------------------------- footer */

.foot {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 2.5rem var(--pad) 3.5rem;
  border-top: 1px solid var(--line-soft);
  font-family: var(--mono);
  font-size: .7rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted-2);
  display: flex; flex-wrap: wrap; gap: .6rem;
  align-items: baseline;
}
.foot__rights { margin-left: auto; }

@media (max-width: 620px) {
  .foot__rights { margin-left: 0; width: 100%; }
}
