/* ---------------------------------------------------------------------------
   Youssef Biaz — personal site
   Single-page static layout. Mirrors the section order of the original
   Squarespace site: hero → screenwriting → prose → poetry → about → footer.
--------------------------------------------------------------------------- */

:root {
  /* --- Palette (reverse-engineered from the original Squarespace Site Style) --- */
  --bg: #ffffff;
  /* White — site background                 */
  --bg-alt: #e7d9cb;
  /* Light Accent — warm sand, alt sections   */
  --ink: #000000;
  /* Black — primary text                     */
  --ink-soft: #3d4435;
  /* Dark Accent — olive, for secondary text  */
  --rule: #d8ccbd;
  /* hairline derived from the sand tone       */
  --accent: #c2c8cc;
  /* Accent — light blue-grey                 */
  --accent-ink: #1a1a1a;
  /* dark text sitting on a light fill          */

  /* Button contrast colors — overridden per section (see .hero for dark).
     Default = light sections: black underline/fill, white label on hover. */
  --btn-line: var(--ink);
  --btn-fill-text: #ffffff;

  --max: 1280px;
  --pad: clamp(1.25rem, 5vw, 4rem);

  /* --- Type roles (mirror Squarespace's heading / body / meta / nav split) --- */
  --font-heading: "Italiana", "Times New Roman", serif;
  /* display serif      */
  --font-body: "Courier Prime", "Courier New", Courier, monospace;
  /* body + buttons  */
  --font-meta: "IBM Plex Mono", "Courier New", monospace;
  /* labels, tags       */
  --font-ui: "Inter", "Helvetica Neue", Arial, sans-serif;
  /* nav, brand         */
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  /* monospace runs a touch wide; 17px keeps measure comfortable */
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* --------------------------- Scroll reveal ----------------------------- */
/* Scoped to .js so that without JavaScript nothing is ever hidden. Each
   element fades + lifts into place once, then keeps its final state. */
.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
  will-change: opacity, transform;
}

.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .js .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

a {
  color: inherit;
}

/* ----------------------------- Header / nav ----------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  /* Black bar stays full-bleed; the inner wrapper caps content at --max. */
  padding: 1rem var(--pad);
  background: var(--ink);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  /* Dark bar → light-grey button underline/fill, dark label on hover. */
  --btn-line: var(--accent);
  --btn-fill-text: var(--ink);
}

.site-header-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.brand img {
  /* Monogram art is light grey; sits on the dark bar. Height drives size,
     width auto keeps the 786:530 aspect ratio. */
  height: 2.5rem;
  width: auto;
  display: block;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(0.75rem, 2.5vw, 1.75rem);
  flex-wrap: wrap;
  font-family: var(--font-ui);
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.site-nav a {
  text-decoration: none;
  color: rgba(255, 255, 255, 0.72);
  transition: color 0.15s;
}

.site-nav a:hover {
  color: #fff;
}

.nav-email {
  text-transform: none;
  letter-spacing: 0;
}

/* The nav email is now a .btn; override the plain-link colors (higher
   specificity) so its label shows light by default and inverts on the
   hover fill, matching the other buttons. */
.site-nav a.btn {
  color: #fff;
}

.site-nav a.btn:hover,
.site-nav a.btn:focus-visible {
  color: var(--btn-fill-text);
}

@media (max-width: 600px) {
  .nav-email {
    display: none;
  }

  /* keep the mobile nav uncluttered */
}

/* -------------------------------- Hero --------------------------------- */

.hero {
  background: var(--ink);
  color: #fff;
  padding: clamp(3rem, 9vw, 6rem) var(--pad) clamp(3rem, 8vw, 5rem);
  /* Dark section → light-grey underline/fill, dark label on hover. */
  --btn-line: var(--accent);
  --btn-fill-text: var(--ink);
}

.hero-inner {
  max-width: var(--max);
  margin: 0 auto;
  container-type: inline-size;
  /* lets .hero-name size to this width */
}

.hero-name {
  font-family: var(--font-heading);
  /* Sized in cqi (1% of .hero-inner width) so the name fills the section.
     "YOUSSEF BIAZ" measures 6.40em in Italiana, so 100/6.40 = 15.62cqi fills
     edge-to-edge; 15.5cqi leaves a hair of breathing room. The max cap (13rem)
     is only a safety rail — it sits just above the fill size at the 1280px
     container so it never clips. Re-measure if the name text changes length. */
  font-size: clamp(2.4rem, 15.5cqi, 13rem);
  line-height: 1.02;
  margin: 0 0 clamp(0.75rem, 2vw, 1.5rem);
  letter-spacing: 0.01em;
  text-align: center;
  color: var(--accent);
  white-space: nowrap;
  font-weight: 400;
}

.hero-role {
  font-family: var(--font-heading);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  /* Responsive: "SCREENWRITER" is one unbreakable word, so a fixed size wider
     than the viewport would force horizontal overflow and drag the rest of the
     hero off the right edge on small phones. */
  font-size: clamp(1.8rem, 8vw, 3.5rem);
  color: rgba(255, 255, 255, 0.7);
  margin: 0 0 clamp(2.25rem, 6vw, 3.5rem);
  text-align: left;
}

/* Name sits centered above; portrait left, bio right. */
.hero-cols {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: clamp(1.5rem, 5vw, 3.5rem);
  align-items: center;
}

.hero-portrait {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 10px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
}

.hero-intro {
  margin: 0 0 2rem;
  font-size: 1.15rem;
  color: rgba(255, 255, 255, 0.85);
}

@media (max-width: 720px) {
  .hero-cols {
    grid-template-columns: 1fr;
  }

  .hero-portrait {
    max-width: 320px;
    margin: 0 auto;
  }
}

/* ------------------------------- Buttons ------------------------------- */

/* Underline button: transparent (so it inherits whatever section sits behind
   it) with a single high-contrast bottom border. On hover that border color
   floods the whole rectangular button and the label inverts to stay legible.
   The contrast color is per-section via --btn-line / --btn-fill-text. */
.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 1rem;
  letter-spacing: 0.02em;
  line-height: 1.2;
  text-transform: none;
  text-decoration: none;
  padding: 0.7rem 1.1rem;
  background: transparent;
  color: inherit;
  border: 0;
  border-bottom: 2px solid var(--btn-line);
  border-radius: 0;
  /* fully rectangular */
  transition: background 0.18s, color 0.18s;
}

.btn:hover,
.btn:focus-visible {
  background: var(--btn-line);
  color: var(--btn-fill-text);
}

/* ------------------------------ Sections ------------------------------- */

.section {
  padding: clamp(3rem, 8vw, 5.5rem) var(--pad);
}

.section-alt {
  background: var(--bg);
}

.section-accent {
  background: var(--accent);
}

/* Thin black divider only between two sections that share a background — the
   adjacent-sibling selector matches a section directly following a same-class
   (same-color) one, so no line appears where the color already changes. */
.section-accent+.section-accent,
.section-alt+.section-alt {
  border-top: 1px solid var(--ink);
}

.section-title {
  max-width: var(--max);
  margin: 0 auto clamp(1.75rem, 4vw, 3rem);
  font-family: var(--font-heading);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  /* Scales with viewport so the longest title ("SCREENWRITING") never spills
     past the screen edge on narrow phones, while sitting clearly above
     .work-title at every width. */
  font-size: clamp(1.9rem, 9vw, 4rem);
  font-weight: 500;
  text-align: center;
  color: var(--ink);
}

.section-title::after {
  content: "";
  display: block;
  width: 40px;
  height: 2px;
  background: var(--ink);
  margin: 0.9rem auto 0;
}

/* --------------------------- Work / articles --------------------------- */

.work {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: clamp(1.5rem, 5vw, 3.5rem);
  align-items: center;
}

.work-reverse .work-poster {
  order: 2;
}

.work-poster {
  width: 100%;
  border-radius: 4px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.10);
}

.about-photo {
  aspect-ratio: 4 / 5;
  object-fit: cover;
}

/* Responsive 16:9 YouTube embed (Poetry section). */
.video-embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.10);
}

.video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Poetry Out Loud badge, sits below the text. */
.poetry-badge {
  height: clamp(96px, 17vw, 136px);
  width: auto;
  margin-top: 1.75rem;
}

.work-title {
  font-family: var(--font-heading);
  font-size: clamp(1.4rem, 3.4vw, 2.1rem);
  margin: 0 0 0.75rem;
  line-height: 1.15;
}

.work-tag {
  font-family: var(--font-meta);
  font-size: 0.7em;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
}

.work-body p {
  margin: 0 0 1.5rem;
  color: var(--ink-soft);
}

/* ------------------------------- Laurels ------------------------------- */

.laurels {
  list-style: none;
  margin: 2rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: clamp(0.75rem, 3vw, 1.75rem);
}

.laurels img {
  height: clamp(84px, 16vw, 126px);
  width: auto;
}

/* ------------------------------- Footer -------------------------------- */

.site-footer {
  border-top: 1px solid var(--rule);
  padding: clamp(2.5rem, 6vw, 4rem) var(--pad);
  text-align: center;
}

.footer-name {
  font-family: var(--font-heading);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  font-size: 0.95rem;
  margin: 0 0 0.5rem;
}

.footer-meta {
  font-family: var(--font-meta);
  font-size: 0.8rem;
  color: var(--ink);
  margin: 0;
}

.footer-meta a {
  text-decoration: none;
}

.footer-meta a:hover {
  text-decoration: underline;
}

/* ------------------------------ Responsive ----------------------------- */

@media (max-width: 720px) {
  .work {
    grid-template-columns: 1fr;
  }

  .work-reverse .work-poster {
    order: 0;
  }

  /* image always on top when stacked */
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}