/* ------------------------------------------------------------------
   Neo Borrel - portfolio
   Palette and type deliberately match the LaTeX CV and cover letters:
   ink + clay on warm paper, Raleway for display, Lato for text.
   ------------------------------------------------------------------ */

:root {
  --ink: #1c1c1c;
  --ink-soft: #4a4542;
  --muted: #7a726c;
  --clay: #9c5b38;
  --clay-dark: #80482a;
  --paper: #faf8f5;
  --paper-2: #f1ece6;
  --hairline: #ddd5cc;

  --font-display: "Raleway", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-body: "Lato", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --gutter: clamp(1.25rem, 5vw, 4.5rem);
  --measure: 64ch;
  --wrap: 1240px;
  --section-y: clamp(4.5rem, 9vw, 8.5rem);

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

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

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a { color: inherit; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 300;
  line-height: 1.12;
  margin: 0;
  letter-spacing: -0.012em;
}

::selection { background: var(--clay); color: #fff; }

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 0.75rem 1.25rem;
  z-index: 100;
}
.skip-link:focus { left: 0; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.wrap--narrow { max-width: 860px; }

/* ---------------------------------------------------- header ------ */

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.15rem var(--gutter);
  color: var(--paper);
  transition: background-color 0.35s var(--ease), color 0.35s var(--ease),
              box-shadow 0.35s var(--ease), padding 0.35s var(--ease);
}

.site-header.is-solid,
.site-header.is-static {
  background: rgba(250, 248, 245, 0.92);
  backdrop-filter: saturate(140%) blur(10px);
  color: var(--ink);
  box-shadow: 0 1px 0 var(--hairline);
  padding-block: 0.85rem;
}

.brand {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
}

.site-nav {
  display: flex;
  gap: clamp(1.1rem, 2.5vw, 2.25rem);
  font-size: 0.8rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.site-nav a {
  text-decoration: none;
  padding-block: 0.25rem;
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s var(--ease);
}
.site-nav a:hover { border-bottom-color: currentColor; }

/* On a narrow phone the brand and the three nav items together are wider
   than the header's content box, and space-between lets them spill past the
   right-hand gutter. Tighten both rather than hide the nav. */
@media (max-width: 480px) {
  .site-header { gap: 0.75rem; }
  .brand { font-size: 0.82rem; letter-spacing: 0.1em; }
  .site-nav { gap: 0.9rem; font-size: 0.72rem; letter-spacing: 0.08em; }
}

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

.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background: var(--ink);
}

.hero__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(16, 14, 13, 0.42) 0%,
    rgba(16, 14, 13, 0.06) 32%,
    rgba(16, 14, 13, 0.52) 82%,
    rgba(16, 14, 13, 0.72) 100%
  );
}

.hero__inner {
  position: relative;
  z-index: 2;
  width: 100%;
  color: #fff;
  padding-bottom: clamp(3.5rem, 9vh, 7rem);
}

.hero__name {
  font-size: clamp(2.6rem, 8.5vw, 6.5rem);
  font-weight: 200;
  letter-spacing: 0.01em;
  text-shadow: 0 1px 36px rgba(0, 0, 0, 0.35);
}

.hero__tagline {
  margin: clamp(0.9rem, 2vw, 1.4rem) 0 0;
  max-width: 34ch;
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(1rem, 1.9vw, 1.4rem);
  line-height: 1.45;
  text-shadow: 0 1px 24px rgba(0, 0, 0, 0.4);
}

.hero__meta {
  margin-top: clamp(1.4rem, 3vw, 2.2rem);
  font-size: 0.78rem;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  opacity: 0.86;
}

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

.section { padding-block: var(--section-y); }
.section--tint { background: var(--paper-2); }
.section--tight { padding-block: clamp(3rem, 6vw, 5rem); }

.label {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin: 0 0 clamp(1.8rem, 4vw, 3rem);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--clay);
}

.label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--hairline);
}

.lede {
  max-width: var(--measure);
  font-size: clamp(1.1rem, 0.98rem + 0.6vw, 1.45rem);
  line-height: 1.6;
  color: var(--ink-soft);
  margin: 0;
}

.prose p {
  max-width: var(--measure);
  margin: 0 0 1.35em;
  color: var(--ink-soft);
}
.prose p:last-child { margin-bottom: 0; }

/* ------------------------------------------------------ work ------ */

.work-featured { margin-bottom: clamp(2.5rem, 5vw, 4.5rem); }

.work-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(2.25rem, 5vw, 4.75rem) clamp(1.5rem, 3.5vw, 3.25rem);
  align-items: start;
}

@media (max-width: 760px) {
  .work-grid { grid-template-columns: minmax(0, 1fr); }
}

.card { display: block; text-decoration: none; }

.card__frame {
  position: relative;
  overflow: hidden;
  background: var(--paper-2);
}

.card__frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.75s var(--ease), filter 0.5s var(--ease);
}

.card:hover .card__frame img,
.card:focus-visible .card__frame img { transform: scale(1.035); }

.card__status {
  position: absolute;
  left: 0;
  top: 0;
  margin: 0.9rem;
  padding: 0.3rem 0.65rem;
  background: rgba(250, 248, 245, 0.93);
  color: var(--ink);
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.card__body {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.9rem;
  padding-top: 1.1rem;
}

.card__title {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 1.1rem + 1vw, 1.95rem);
  font-weight: 300;
}

.card:hover .card__title { color: var(--clay); }

.card__sub {
  width: 100%;
  color: var(--muted);
  font-size: 0.92rem;
}

.card__meta {
  width: 100%;
  margin-top: 0.3rem;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* -------------------------------------------------- services ------ */

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(255px, 1fr));
  gap: clamp(1.8rem, 3.5vw, 3.25rem);
}

.service h3 {
  font-size: 1.14rem;
  font-weight: 600;
  margin-bottom: 0.6rem;
  padding-top: 1rem;
  border-top: 1px solid var(--hairline);
  letter-spacing: 0;
}

.service p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.97rem;
}

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

.about {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: clamp(2.5rem, 6vw, 5.5rem);
  align-items: start;
}

@media (max-width: 860px) {
  .about { grid-template-columns: minmax(0, 1fr); }
}

.facts { margin: 0; }

.facts div {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.15rem;
  padding: 0.85rem 0;
  border-top: 1px solid var(--hairline);
}

.facts dt {
  font-size: 0.7rem;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: var(--clay);
}

.facts dd { margin: 0; color: var(--ink-soft); font-size: 0.95rem; }

.tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 1.6rem;
  padding: 0;
  list-style: none;
}

.tools li {
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--hairline);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
}

/* -------------------------------------------------- project ------- */

.project-head { padding-top: clamp(6.5rem, 12vw, 9rem); }

.project-head h1 {
  font-size: clamp(2.2rem, 1.5rem + 3.4vw, 4.25rem);
  font-weight: 200;
}

.project-head .subtitle {
  margin: 0.6rem 0 0;
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(1.05rem, 1.8vw, 1.35rem);
  color: var(--muted);
}

.project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.6rem;
  margin-top: clamp(1.4rem, 3vw, 2.1rem);
  padding-top: 1.1rem;
  border-top: 1px solid var(--hairline);
  font-size: 0.76rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
}

.project-meta .is-status { color: var(--clay); }

.lead-figure {
  margin: clamp(2.25rem, 5vw, 3.75rem) 0 0;
  background: var(--paper-2);
}

.lead-figure img {
  width: 100%;
  max-height: 84svh;
  object-fit: contain;
  margin-inline: auto;
}

.scope {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 2rem 0 0;
  padding: 0;
  list-style: none;
}

.scope li {
  padding: 0.3rem 0.75rem;
  background: var(--paper-2);
  font-size: 0.78rem;
  color: var(--ink-soft);
}

.gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1.5rem, 3.5vw, 3rem);
}

@media (max-width: 760px) {
  .gallery { grid-template-columns: minmax(0, 1fr); }
}

.gallery figure { margin: 0; }
.gallery .span-wide { grid-column: 1 / -1; }

.gallery img { width: 100%; background: var(--paper-2); }

figcaption {
  margin-top: 0.7rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.process__note {
  max-width: var(--measure);
  margin: 0 0 clamp(1.8rem, 4vw, 2.75rem);
  color: var(--ink-soft);
}

.process .gallery img {
  background: #fff;
  border: 1px solid var(--hairline);
}

/* ------------------------------------------------- next / cta ----- */

.next {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem 2rem;
  padding-block: clamp(3rem, 7vw, 5.5rem);
  border-top: 1px solid var(--hairline);
  text-decoration: none;
}

.next__label {
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--clay);
}

.next__title {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(1.8rem, 1.2rem + 2.4vw, 3.1rem);
  transition: color 0.25s var(--ease);
}

.next:hover .next__title { color: var(--clay); }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--clay);
  border-bottom: 1px solid currentColor;
  padding-bottom: 0.2rem;
}

.link-arrow:hover { color: var(--clay-dark); }

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

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: clamp(1.75rem, 4vw, 3.5rem);
  margin-top: clamp(2rem, 4vw, 3rem);
}

.contact-item dt {
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--clay);
  margin-bottom: 0.4rem;
}

.contact-item dd {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(1.05rem, 0.95rem + 0.5vw, 1.3rem);
  overflow-wrap: anywhere;
}

.contact-item a { text-decoration: none; border-bottom: 1px solid var(--hairline); }
.contact-item a:hover { border-bottom-color: var(--clay); color: var(--clay); }

.site-footer {
  padding: 2.5rem var(--gutter);
  border-top: 1px solid var(--hairline);
  color: var(--muted);
  font-size: 0.8rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.5rem;
  justify-content: space-between;
}

.site-footer a { text-decoration: none; border-bottom: 1px solid var(--hairline); }
.site-footer a:hover { color: var(--clay); }
