/* ------------------------------------------------------------------
   Emily Bajalia: personal site
   Palette from the supplied reference; type: Instrument Serif + Public Sans
------------------------------------------------------------------- */

@font-face {
  font-family: "Instrument Serif";
  src: url("assets/fonts/instrument-serif-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("assets/fonts/instrument-serif-latin-400-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Public Sans";
  src: url("assets/fonts/public-sans-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --linen: #FFF9F3;
  --latte: #DBC4A5;
  --weathered: #A08670;
  --cedar: #7C7960;
  --clockwork: #72583E;
  --olive: #44422D;
  --noir: #443223;
  --mauve: #755151;

  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --sans: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  --gutter: clamp(20px, 5vw, 64px);
  --section-pad: clamp(72px, 11vw, 144px);
  --hairline: rgba(68, 50, 35, 0.28);

  color-scheme: light;
}

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

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

body {
  margin: 0;
  background: var(--linen);
  color: var(--noir);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; height: auto; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, p, figure { margin: 0; }

a { color: inherit; }
a:focus-visible,
.button:focus-visible {
  outline: 2px solid var(--mauve);
  outline-offset: 4px;
  border-radius: 2px;
}

section[id] { scroll-margin-top: 16px; }

.container {
  width: min(1240px, 100% - (var(--gutter) * 2));
  margin-inline: auto;
}

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

.skip-link {
  position: absolute;
  left: 16px; top: -64px;
  z-index: 10;
  padding: 10px 16px;
  background: var(--olive);
  color: var(--linen);
  border-radius: 6px;
}
.skip-link:focus { top: 16px; }

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

.site-header { padding-block: 28px; }

.site-header__row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px 32px;
}

.wordmark {
  font-family: var(--serif);
  font-size: 1.75rem;
  line-height: 1;
  letter-spacing: -0.005em;
  text-decoration: none;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 32px;
  font-size: 0.9375rem;
}
.nav a {
  text-decoration: none;
  padding-block: 4px;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: background-size 0.25s ease;
}
.nav a:hover { background-size: 100% 1px; }

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

.hero {
  padding-block: clamp(32px, 6vw, 72px) clamp(72px, 10vw, 128px);
}

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.7fr);
  gap: clamp(32px, 6vw, 96px);
  align-items: center;
}

.hero__title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(3.25rem, 9vw, 8.75rem);
  line-height: 0.96;
  letter-spacing: -0.025em;
}

.hero__line {
  display: block;
  animation: rise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  animation-delay: calc(var(--i) * 120ms);
}
.hero__line:nth-child(2) { padding-left: 0.9em; }
.hero__line:nth-child(3) { padding-left: 0.3em; }

@keyframes rise {
  from { opacity: 0; transform: translateY(0.35em); }
  to   { opacity: 1; transform: none; }
}

.hero__lede {
  margin-top: clamp(24px, 3vw, 40px);
  max-width: 34ch;
  font-size: clamp(1.125rem, 1.6vw, 1.375rem);
  line-height: 1.45;
  color: var(--clockwork);
}

.button {
  display: inline-block;
  margin-top: clamp(28px, 3.5vw, 40px);
  padding: 14px 32px;
  border-radius: 999px;
  background: var(--olive);
  color: var(--linen);
  font-weight: 500;
  font-size: 0.9375rem;
  letter-spacing: 0.01em;
  text-decoration: none;
  transition: background-color 0.2s ease;
}
.button:hover { background: var(--clockwork); }

.portrait {
  position: relative;
  justify-self: end;
  width: min(100%, 440px);
}
.portrait::before {
  content: "";
  position: absolute;
  inset: 20px -20px -20px 20px;
  border: 1px solid var(--weathered);
  border-radius: 999px 999px 0 0;
}
.portrait__frame {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: 999px 999px 0 0;
  background: var(--latte);
}
.portrait__frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 10%;
}

/* ---------- Shared section styles ---------- */

.section { padding-block: var(--section-pad); }
.section--latte { background: var(--latte); }
.section--olive { background: var(--olive); color: var(--linen); }

.section-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.5rem, 5vw, 4rem);
  line-height: 1.04;
  letter-spacing: -0.015em;
}

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

.about__grid {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  gap: clamp(32px, 6vw, 96px);
  align-items: start;
}

.about .section-title { position: sticky; top: 32px; }

.about__text { max-width: 44rem; }
.about__text p + p { margin-top: 1.4em; }
.about__text p { max-width: 64ch; }

.about__lede {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 2.6vw, 2.0625rem);
  line-height: 1.3;
  letter-spacing: -0.005em;
  max-width: none !important;
  margin-bottom: 0.4em;
}

/* ---------- Scope ---------- */

.scope .section-title { margin-bottom: clamp(40px, 6vw, 72px); }

.scope__list { border-bottom: 1px solid var(--hairline); }

.scope__item {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 16px clamp(24px, 6vw, 96px);
  padding-block: clamp(24px, 3.4vw, 40px);
  border-top: 1px solid var(--hairline);
}

.scope__name {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.scope__desc { max-width: 56ch; }

/* ---------- Clients ---------- */

.clients .section-title { margin-bottom: clamp(40px, 6vw, 72px); }

.clients__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--hairline);
  border: 1px solid var(--hairline);
}

.client {
  display: grid;
  place-items: center;
  min-height: clamp(110px, 14vw, 168px);
  padding: 24px;
  background: var(--linen);
  text-align: center;
}

.client__logo {
  height: var(--h, 56px);
  width: auto;
  max-width: 100%;
  object-fit: contain;
  opacity: 0.9;
}


/* ---------- Contact ---------- */

.contact__grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(32px, 6vw, 96px);
  align-items: end;
}

.contact__lede {
  margin-top: 20px;
  max-width: 24ch;
  font-size: 1.25rem;
  line-height: 1.45;
  color: var(--latte);
}

.contact__email {
  display: inline-block;
  font-family: var(--serif);
  font-size: clamp(1.75rem, 4.4vw, 3.75rem);
  line-height: 1.1;
  letter-spacing: -0.015em;
  color: var(--linen);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  overflow-wrap: anywhere;
}
.contact__email:hover { color: var(--latte); }

.contact__social {
  display: flex;
  gap: 28px;
  margin-top: 28px;
  font-size: 0.9375rem;
}
.contact__social a { color: var(--latte); text-underline-offset: 0.25em; }
.contact__social a:hover { color: var(--linen); }

.contact a:focus-visible { outline-color: var(--latte); }

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

.site-footer {
  background: var(--olive);
  color: var(--latte);
  font-size: 0.875rem;
}
.site-footer__row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-block: 28px 36px;
  border-top: 1px solid rgba(219, 196, 165, 0.25);
}
.site-footer a { text-underline-offset: 0.25em; }
.site-footer a:focus-visible { outline-color: var(--latte); }

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

@media (max-width: 899px) {
  .hero__grid { grid-template-columns: 1fr; }
  .portrait { justify-self: start; width: min(78%, 360px); margin-right: 20px; }
  .about__grid { grid-template-columns: 1fr; }
  .about .section-title { position: static; }
  .contact__grid { grid-template-columns: 1fr; align-items: start; }
  .clients__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 719px) {
  .scope__item { grid-template-columns: 1fr; }
  .nav { gap: 6px 22px; }
  .hero__line:nth-child(2) { padding-left: 0.5em; }
  .hero__line:nth-child(3) { padding-left: 0.15em; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero__line { animation: none; }
  .nav a, .button { transition: none; }
}
