/* ==========================================================================
   Elizabeth Fernandes Portfolio — Design System
   Ported from Squarespace 7.1 Fluid Engine
   ========================================================================== */

/* ---------- Font-face declarations (self-hosted woff2) ---------- */

@font-face {
  font-family: 'Volkhov';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/volkhov-normal-400-lat.woff2') format('woff2');
}
@font-face {
  font-family: 'Volkhov';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/assets/fonts/volkhov-normal-700-lat.woff2') format('woff2');
}
@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('/assets/fonts/montserrat-normal-300_700-lat.woff2') format('woff2');
}
@font-face {
  font-family: 'Montserrat';
  font-style: italic;
  font-weight: 400 600;
  font-display: swap;
  src: url('/assets/fonts/montserrat-italic-400_600-lat.woff2') format('woff2');
}

/* ---------- CSS Custom Properties (Design Tokens) ---------- */

:root {
  /* Colours */
  --color-bg:           hsl(240, 100%, 99.41%);   /* near-white cream */
  --color-text:         #000;
  --color-accent:       #feec4f;                    /* yellow highlight */
  --color-muted:        hsl(0, 0%, 44.71%);         /* #727272 */
  --color-light-accent: hsl(60, 3%, 93.5%);
  --color-white:        #fff;

  /* Typography — sans throughout; the serif is reserved for the hero headline */
  --font-heading: 'Montserrat', 'Helvetica Neue', Arial, sans-serif;
  --font-body:    'Montserrat', 'Helvetica Neue', Arial, sans-serif;
  /* Homepage hero headline only */
  --font-display: 'Volkhov', Georgia, serif;

  /* Spacing */
  /* Same content column as the case studies, which use
     .wrap { width: min(calc(100% - 40px), 1180px) }.
     Expressed as max-width + padding here so the existing container rules
     keep working: content resolves to min(100% - 40px, 1180px). */
  --page-padding:        20px;
  --page-padding-mobile: 12px;
  --max-page-width:      1220px;   /* 1180 content + 20px gutter each side */

  /* Header */
  --header-v-padding:    1vw;
  --header-logo-height:  35px;
  --header-height:       calc(var(--header-logo-height) + var(--header-v-padding) * 2 + 20px);
}

/* ---------- Reset & Base ---------- */

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

html {
  font-size: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 1.1rem;
  line-height: 1.6em;
  letter-spacing: 0;
  color: var(--color-text);
  background-color: var(--color-bg);
  overflow-x: hidden;
}

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

/* Custom CSS from the live site: no underlines on links inside headings/paragraphs */
h1 a, h2 a, h3 a, h4 a, p a { text-decoration: none; }

/* ---------- Typography Scale ---------- */

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.4em;
  letter-spacing: 0.01em;
}

h1 { font-size: 4.2rem; }
h2 { font-size: 1.8rem; }
h3 { font-size: 1.6rem; }
h4 { font-size: 2.4rem; }   /* Intentionally larger than h2/h3 — matches live site */

p  { margin-bottom: 1em; }
p:last-child { margin-bottom: 0; }

.text-large { font-size: 1.3rem; }
.text-small { font-size: 0.9rem; }
.text-muted { color: var(--color-muted); }

/* Yellow highlight background (inline) */
.highlight {
  background-color: var(--color-accent);
  padding: 0.05em 0.15em;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

/* ---------- Page wrapper ---------- */

.page-content {
  padding-top: var(--header-height);
}

/* ---------- Site Header ---------- */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--color-bg);
  transition: transform 0.3s ease;
  will-change: transform;
}

.site-header.header--hidden {
  transform: translateY(-100%);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max-page-width);
  margin: 0 auto;
  padding: var(--header-v-padding) var(--page-padding);
}

.header-logo img {
  height: var(--header-logo-height);
  width: auto;
}

.header-nav {
  display: flex;
  gap: 2rem;
}

.nav-link {
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 400;
  text-decoration: none;
  color: var(--color-text);
  position: relative;
  padding-bottom: 2px;
  letter-spacing: 0.02em;
}

.nav-link--active {
  text-decoration: underline;
  text-decoration-color: var(--color-accent);
  text-underline-offset: 4px;
  text-decoration-thickness: 2.5px;
}

.nav-link:hover {
  text-decoration: underline;
  text-decoration-color: var(--color-accent);
  text-underline-offset: 4px;
  text-decoration-thickness: 2.5px;
}

/* Only three links, so they stay inline at every width — no menu needed. */
@media (max-width: 767px) {
  .header-inner {
    padding: var(--header-v-padding) var(--page-padding-mobile);
    gap: 1rem;
  }

  .header-nav {
    gap: 1.1rem;
    flex-shrink: 0;
  }

  .header-nav .nav-link {
    font-size: 0.85rem;
  }

  .header-logo img {
    height: 26px;
  }
}

@media (max-width: 380px) {
  .header-nav {
    gap: 0.85rem;
  }
  .header-nav .nav-link {
    font-size: 0.8rem;
  }
  .header-logo img {
    height: 22px;
  }
}

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

/* max-width and padding sit on the same element here, exactly like
   .case-studies and .content-page, so the footer lines up with the page. */
.site-footer {
  padding: 4rem var(--page-padding);
  max-width: var(--max-page-width);
  margin: 0 auto;
}

.footer-inner {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 2rem;
  align-items: start;
}

.footer-text,
.footer-heading {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.35;
  margin: 0;
}

.footer-contact {
  justify-self: end;
  text-align: right;
}

.footer-icons {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1rem;
}

.footer-icons a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: 1.5px solid var(--color-text);
  border-radius: 5px;
  color: var(--color-text);
  transition: background-color 0.2s ease, color 0.2s ease;
}

.footer-icons svg {
  width: 14px;
  height: 14px;
}

/* Invert on hover rather than fading — a faded outline button just looks
   disabled, and the LinkedIn mark is a solid shape so opacity read oddly. */
.footer-icons a:hover,
.footer-icons a:focus-visible {
  background: var(--color-text);
  color: var(--color-bg);
}

@media (max-width: 767px) {
  .site-footer {
    padding: 3rem var(--page-padding-mobile);
  }
  .footer-inner {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .footer-contact {
    justify-self: start;
    text-align: left;
  }
  .footer-icons {
    justify-content: flex-start;
  }
  .footer-text,
  .footer-heading {
    font-size: 1.1rem;
  }
}

/* ---------- Hero (Homepage) ---------- */

.hero-section {
  position: relative;
  /* Same content column as .site-header and .case-studies so the left and
     right edges line up with the case-study thumbnails below. */
  max-width: var(--max-page-width);
  margin: 0 auto;
  padding: 3rem var(--page-padding) 2rem;
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* All hero text sits above the decorative blob */
.hero-name,
.hero-typewriter,
.hero-tagline {
  position: relative;
  z-index: 1;
}

.hero-name {
  font-family: var(--font-display);
  font-size: 4.2rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.1em;
}

.hero-typewriter {
  font-family: var(--font-display);
  font-size: 4.2rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--color-text);
}

/* Phrases swap as a whole rather than typing out — see typewriter.js.
   All of them share one grid cell, so the container reserves the height of the
   tallest phrase and the page never reflows as they rotate. */
.hero-typewriter {
  display: grid;
}

.hero-typewriter .phrase {
  grid-area: 1 / 1;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.14s ease;
}

.hero-typewriter .phrase.is-active {
  visibility: visible;
  opacity: 1;
}

/* Wrapper exists so the blob can sit behind the tagline */
.hero-tagline-wrap {
  position: relative;
  margin-top: 2.5rem;
  width: fit-content;
}

.hero-tagline {
  position: relative;
  z-index: 1;
  font-family: var(--font-body);
  font-size: clamp(0.95rem, 1.55vw, 1.3rem);
  font-weight: 400;
  line-height: 1.6;
  white-space: nowrap;   /* keep the subtitle on a single line */
  color: var(--color-text);
}

.hero-blob {
  position: absolute;
  z-index: 0;
  left: -1.2rem;
  top: 50%;
  transform: translateY(-50%);
  width: clamp(100px, 11vw, 175px);
  pointer-events: none;
}

.hero-smiley {
  position: absolute;
  /* Right edge sits on the same line as the case-study thumbnails */
  right: var(--page-padding);
  top: 20%;
  width: clamp(44px, 3.4vw, 68px);
  pointer-events: none;
}

.hero-arrow {
  display: block;
  align-self: center;
  width: clamp(26px, 2.4vw, 38px);
  margin-top: 5rem;
}

@media (max-width: 767px) {
  .hero-section {
    padding: 2rem var(--page-padding-mobile) 1.5rem;
    min-height: 50vh;
  }
  .hero-name,
  .hero-typewriter {
    font-size: 2.4rem;
  }
  .hero-tagline {
    font-size: 0.95rem;
    white-space: normal;
    max-width: 22rem;
  }
  .hero-blob {
    left: -0.8rem;
    width: clamp(85px, 22vw, 125px);
  }
  .hero-smiley {
    right: var(--page-padding-mobile);
    top: 8%;
    width: 40px;
  }
  .hero-arrow {
    margin-top: 3rem;
  }
}

/* ---------- Case Study Cards (Homepage) ---------- */

.case-studies {
  padding: 0 var(--page-padding) 4rem;
  max-width: var(--max-page-width);
  margin: 0 auto;
}

.case-study-card {
  display: block;
  text-decoration: none;
  color: var(--color-text);
  margin-bottom: 5rem;
  transition: opacity 0.2s ease;
}

.case-study-card:hover {
  opacity: 0.85;
}

.case-study-card__category {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-muted);
  margin-bottom: 0.5rem;
}

.case-study-card__question {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 1.2rem;
}

.case-study-card__image {
  width: 100%;
  /* Same value as .about-layout__photo img — change both together */
  border-radius: 16px;
  object-fit: cover;
}

@media (max-width: 767px) {
  .case-studies {
    padding: 1.5rem var(--page-padding-mobile) 3rem;
  }
  .case-study-card__question {
    font-size: 1.3rem;
  }
  .case-study-card {
    margin-bottom: 3.5rem;
  }
}

/* ---------- Content Pages (About, Values, Writing) ---------- */

.content-page {
  padding: 4rem var(--page-padding) 4rem;
  max-width: var(--max-page-width);
  margin: 0 auto;
}

/* About and Values put both classes on <main>, so this shorthand wipes out the
   padding-top from .page-content. Add the header height back, plus clearance so
   the scroll-back header never lands on the title. Writing pages nest
   .content-page inside .page-content and already have the offset. */
.page-content.content-page {
  padding-top: calc(var(--header-height) + 4rem);
}

.content-page h1 {
  /* Standard page-title size across Values, About and Writing */
  font-size: 2.2rem;
  margin-bottom: 2rem;
}

@media (max-width: 767px) {
  .content-page {
    padding: 2rem var(--page-padding-mobile) 3rem;
  }
  .page-content.content-page {
    padding-top: calc(var(--header-height) + 2rem);
  }
  h1 {
    font-size: 2.6rem;
  }
}

/* ---------- Values Page ---------- */

.values-intro {
  font-size: 0.95rem;
  line-height: 1.8;
  max-width: 900px;
  margin-top: -1rem;
  margin-bottom: 4rem;
}

.value-block {
  display: grid;
  gap: 3rem;
  align-items: center;
  margin-bottom: 6rem;
}

/* Rows alternate: collage left / text right, then text left / collage right.
   nth-of-type keeps the rhythm independent of the intro paragraph above. */
.value-block:nth-of-type(odd) {
  grid-template-columns: 3fr 1fr;
}
.value-block:nth-of-type(odd) .value-block__image {
  order: -1;
}
.value-block:nth-of-type(even) {
  grid-template-columns: 1fr 3fr;
}

.value-block__text h2 {
  font-size: 1.5rem;
  margin-bottom: 0.9rem;
}

.value-block__text p {
  font-size: 0.95rem;
  line-height: 1.8;
}

.value-block__image img {
  width: 100%;
  border-radius: 4px;
}

@media (max-width: 767px) {
  .values-intro {
    margin-bottom: 2.5rem;
  }
  .value-block,
  .value-block:nth-of-type(odd),
  .value-block:nth-of-type(even) {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .value-block {
    margin-bottom: 3.5rem;
  }
  .value-block:nth-of-type(odd) .value-block__image {
    order: 0;
  }
}

/* ---------- About Page ---------- */

/* No max-width here: the grid spans the full .content-page column so the left
   and right edges land on exactly the same padding as Values and Work. */
.about-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: clamp(2.5rem, 6vw, 6rem);
  align-items: start;
}

.about-layout__photo {
  justify-self: end;
  /* Sits below the fixed header instead of tucking under it */
  margin-top: 2.5rem;
  width: clamp(240px, 30vw, 400px);
}

.about-layout__photo img {
  display: block;
  width: 100%;
  /* Same value as .case-study-card__image — change both together */
  border-radius: 16px;
}

.about-layout__bio h1 {
  margin-bottom: 1.8rem;
}

.about-layout__bio p {
  max-width: 640px;
  font-size: 0.95rem;
  line-height: 1.8;
  margin-bottom: 1.6em;
}

/* Hand-drawn style yellow underline behind inline text.
   nowrap keeps the phrase (and its underline) on a single line. */
.underline-accent {
  font-weight: 700;
  white-space: nowrap;
  background-image: linear-gradient(var(--color-accent), var(--color-accent));
  background-repeat: no-repeat;
  background-size: 100% 0.18em;
  background-position: 0 88%;
}

/* Yellow wave that separates page content from the footer */
.wave-divider {
  width: 100%;
  margin-top: 6rem;
  line-height: 0;
}

.wave-divider svg {
  display: block;
  width: 100%;
  height: clamp(48px, 6vw, 90px);
}

@media (max-width: 767px) {
  .about-layout {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
  .about-layout__photo {
    justify-self: start;
    width: 100%;
    max-width: 340px;
    margin-top: 0;
  }
  .wave-divider {
    margin-top: 3.5rem;
  }
}

/* ---------- Utility Classes ---------- */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.visually-hidden { /* alias */
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Reduced Motion ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .hero-typewriter .phrase {
    transition: none;
  }
}
