/* ============================================================
   Design portfolio — portfolio.martinjsalgado.com
   Palette and type inherited from martinjsalgado.com so the
   subdomain reads as part of the same site.
   ============================================================ */

:root {
  --black:      #232B2B;   /* page canvas          */
  --card:       #2A3440;   /* raised surface       */
  --border:     #2E3B4E;   /* hairlines            */
  --terra:      #41536E;   /* structural accent    */
  --steel:      #7C93B5;   /* interactive accent   */
  --cream:      #F2F4F6;   /* primary text         */
  --cream-dim:  #A8B2BC;   /* secondary text       */

  --display: "roc-grotesk", "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  --body:    "neue-haas-grotesk-text", "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  --mono:    ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --gutter: clamp(1.25rem, 5vw, 5.5rem);
  --maxw: 1240px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--black);
  color: var(--cream);
  font-family: var(--body);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin: 0;
}

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

a { color: inherit; }

code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: rgba(124, 147, 181, 0.14);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.1em 0.38em;
  /* Must wrap. A nowrap token like `$ lloyd init --client acme` widens the
     whole document at phone width, and overflow-x:hidden then clips the page
     instead of scrolling it. */
  overflow-wrap: anywhere;
}

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

.skip-link {
  position: absolute; left: -9999px;
  background: var(--cream); color: var(--black);
  padding: 0.7rem 1.1rem; border-radius: 6px; z-index: 100;
}
.skip-link:focus { left: 1rem; top: 1rem; }

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

/* ───────────── Scroll reveal ───────────── */

/* Content is visible by default. Only a JS-capable browser opts into the
   hidden starting state, so a failed script can never leave a blank page. */
.js .reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.js .reveal.visible { opacity: 1; transform: none; }
.reveal-d1 { transition-delay: 0.10s; }
.reveal-d2 { transition-delay: 0.20s; }
.reveal-d3 { transition-delay: 0.30s; }

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

/* ───────────── Header ───────────── */

.site-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem var(--gutter);
  max-width: var(--maxw);
  margin: 0 auto;
}

.wordmark {
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: -0.01em;
  font-size: 1.0625rem;
  text-decoration: none;
}
.wordmark:hover { color: var(--steel); }

.site-head nav {
  display: flex;
  gap: clamp(0.9rem, 2.5vw, 1.9rem);
  font-size: 0.875rem;
}
.site-head nav a {
  color: var(--cream-dim);
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
.site-head nav a:hover { color: var(--cream); border-bottom-color: var(--steel); }

/* ───────────── Intro ───────────── */

.intro {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(3rem, 9vw, 7.5rem) var(--gutter) clamp(2.5rem, 6vw, 5rem);
}

.eyebrow {
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--steel);
  margin-bottom: 1.4rem;
}

.intro h1 {
  font-size: clamp(2.2rem, 6.4vw, 4.6rem);
  max-width: 17ch;
  margin-bottom: clamp(1.8rem, 4vw, 2.8rem);
}
.intro h1 { text-wrap: balance; }

.intro-body {
  max-width: 62ch;
  color: var(--cream-dim);
  font-size: clamp(1.02rem, 0.98rem + 0.25vw, 1.15rem);
}

.facts {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(1.5rem, 5vw, 4rem);
  margin: clamp(2.4rem, 6vw, 4rem) 0 0;
  padding-top: clamp(1.6rem, 4vw, 2.4rem);
  border-top: 1px solid var(--border);
}
.facts div { margin: 0; }
.facts dt {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cream-dim);
  margin-bottom: 0.45rem;
}
.facts dd {
  margin: 0;
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}

/* ───────────── Bands ───────────── */

.band {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(3rem, 8vw, 6rem) var(--gutter);
}

.band-title {
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--steel);
  padding-bottom: 1.1rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: clamp(2.5rem, 6vw, 4.5rem);
}

.band-lede {
  max-width: 58ch;
  color: var(--cream-dim);
  margin: -2rem 0 clamp(2.5rem, 6vw, 4rem);
}

/* ───────────── Project ───────────── */

.project {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(0, 1fr);
  gap: clamp(1.8rem, 4vw, 3.5rem);
  align-items: start;
  padding-bottom: clamp(3rem, 8vw, 6rem);
  margin-bottom: clamp(3rem, 8vw, 6rem);
  border-bottom: 1px solid var(--border);
}
.project:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }

/* Grid children default to min-width:auto, which lets a long token push the
   column — and the page — past the viewport. */
.project > * { min-width: 0; }

/* Browser frame */
.shot {
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--card);
  position: sticky;
  top: 2rem;
}
.chrome {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 12px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}
.chrome span {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--terra);
  display: block;
}
.shot img { width: 100%; }

.detail .num {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  color: var(--steel);
  margin-bottom: 0.7rem;
}

.detail h3 {
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  margin-bottom: 0.5rem;
}

.domain {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--steel);
  text-decoration: none;
  border-bottom: 1px solid rgba(124, 147, 181, 0.35);
  padding-bottom: 1px;
  margin-bottom: 1.5rem;
  transition: color 0.2s, border-color 0.2s;
}
.domain:hover { color: var(--cream); border-bottom-color: var(--cream); }

.brief {
  font-size: clamp(1.05rem, 1rem + 0.3vw, 1.2rem);
  line-height: 1.5;
  color: var(--cream);
  margin-bottom: 1.3rem;
}

.detail p:not(.brief):not(.num) { color: var(--cream-dim); }

.meta {
  list-style: none;
  margin: 1.7rem 0 1.4rem;
  padding: 1.4rem 0 0;
  border-top: 1px solid var(--border);
  font-size: 0.875rem;
  color: var(--cream-dim);
}
.meta li { margin-bottom: 0.5rem; }
.meta li:last-child { margin-bottom: 0; }
.meta span {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--steel);
  display: inline-block;
  min-width: 4.6rem;
  margin-right: 0.5rem;
}

/* Palette swatches */
.swatches {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
}
.swatches li {
  position: relative;
  width: 2rem;
  height: 2rem;
  border-radius: 5px;
  background: var(--c);
  border: 1px solid rgba(242, 244, 246, 0.16);
}
.swatches li span {
  position: absolute;
  bottom: calc(100% + 7px);
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.02em;
  background: var(--cream);
  color: var(--black);
  padding: 0.22rem 0.42rem;
  border-radius: 4px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s;
}
.swatches li:hover span, .swatches li:focus-within span { opacity: 1; }

/* ───────────── Resources ───────────── */

.res-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: clamp(1.5rem, 3vw, 2.2rem);
}

.res {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s;
}
.res:hover { transform: translateY(-4px); border-color: var(--terra); }

.res-shot {
  margin: 0;
  background: var(--black);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  aspect-ratio: 16 / 11;
}
.res-shot.tall { aspect-ratio: 4 / 3; }
.res-shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.res-body { padding: clamp(1.25rem, 2.4vw, 1.7rem); }

.res-client {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--steel);
  margin-bottom: 0.6rem;
}

.res h3 {
  font-size: 1.22rem;
  margin-bottom: 0.75rem;
}

.res-body p { color: var(--cream-dim); font-size: 0.945rem; }

.res-meta {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 1.2rem 0 0;
  padding: 0;
}
.res-meta li {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  color: var(--cream-dim);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.25rem 0.6rem;
}

/* ───────────── Contact ───────────── */

.contact {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(3rem, 8vw, 6.5rem) var(--gutter);
  border-top: 1px solid var(--border);
}
.contact h2 {
  font-size: clamp(1.8rem, 5vw, 3.2rem);
  max-width: 16ch;
  margin-bottom: 1.2rem;
}
.contact > p {
  max-width: 54ch;
  color: var(--cream-dim);
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2.2rem;
}

.btn {
  display: inline-block;
  font-size: 0.9rem;
  text-decoration: none;
  padding: 0.75rem 1.35rem;
  border-radius: 999px;
  background: var(--cream);
  color: var(--black);
  border: 1px solid var(--cream);
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.btn:hover { background: transparent; color: var(--cream); }

.btn.ghost {
  background: transparent;
  color: var(--cream);
  border-color: var(--border);
}
.btn.ghost:hover { border-color: var(--steel); color: var(--steel); }

/* ───────────── Footer ───────────── */

.site-foot {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 2rem var(--gutter) 3.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.6rem;
  font-size: 0.82rem;
  color: var(--cream-dim);
}
.site-foot p { margin: 0; }

/* ───────────── Responsive ───────────── */

@media (max-width: 900px) {
  .project { grid-template-columns: 1fr; }
  .shot { position: static; }
}

@media (max-width: 560px) {
  .intro h1 { max-width: none; }
  .facts { gap: 1.4rem 2.2rem; }
  .site-head nav { font-size: 0.82rem; }
  .btn { width: 100%; text-align: center; }
}
