/* ==========================================================
   Andy Crego · Portfolio
   Brand: orange #ff4a00, black, white, light gray · Archivo 400/900
   ========================================================== */

:root {
  --orange: #ff4a00;
  --black: #000;
  --white: #fff;

  /* theme tokens (light) */
  --bg: #ffffff;
  --surface: #f2f2f2;       /* light gray */
  --text: #0a0a0a;
  --muted: #6b6b6b;
  --line: #e2e2e2;
  --card-bg: #f2f2f2;
  --dialog-bg: #ffffff;

  --maxw: 1240px;
  --pad: clamp(20px, 5vw, 48px);
  --radius: 999px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e0e0e;
    --surface: #181818;
    --text: #f3f3f3;
    --muted: #a0a0a0;
    --line: #2a2a2a;
    --card-bg: #1c1c1c;
    --dialog-bg: #141414;
  }
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

body {
  margin: 0;
  font-family: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-weight: 400;
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }
h1, h2, h3 { font-weight: 900; line-height: 1.05; margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }
a { color: inherit; }
ul { margin: 0; padding: 0; list-style: none; }

.container {
  width: 100%;
  max-width: calc(var(--maxw) + var(--pad) * 2);
  margin: 0 auto;
  padding-left: var(--pad);
  padding-right: var(--pad);
}

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

/* ---------- 1. HERO ---------- */
.hero {
  background: var(--orange);
  color: var(--black);
  overflow: hidden;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 22px;
  padding-bottom: 22px;
}
.brand {
  font-weight: 900;
  letter-spacing: 0.06em;
  text-decoration: none;
  font-size: 18px;
}
.nav-links { display: flex; gap: clamp(14px, 3vw, 32px); }
.nav-links a {
  text-decoration: none;
  font-size: 15px;
  position: relative;
}
.nav-links a::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: -3px;
  height: 2px; background: currentColor;
  transform: scaleX(0); transform-origin: left;
  transition: transform .25s ease;
}
.nav-links a:hover::after, .nav-links a:focus-visible::after { transform: scaleX(1); }
.hero :focus-visible { outline-color: var(--black); }

.hero-inner {
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  align-items: center;
  gap: clamp(32px, 5vw, 72px);
  padding-top: clamp(24px, 5vw, 56px);
  padding-bottom: clamp(56px, 8vw, 104px);
}

.hero-logo {
  width: clamp(200px, 30vw, 340px);
  margin: 0 0 24px -6px;
}
.hero h1 {
  color: var(--white);
  font-size: clamp(40px, 6.2vw, 76px);
  margin-bottom: 22px;
  max-width: 11ch;
}
.hero-copy p {
  font-size: clamp(17px, 1.6vw, 19px);
  max-width: 34em;
  margin-bottom: 32px;
}

.btn {
  display: inline-block;
  background: var(--black);
  color: var(--white);
  text-decoration: none;
  font-weight: 900;
  font-size: 16px;
  padding: 16px 30px;
  border-radius: var(--radius);
  transition: transform .2s ease, box-shadow .2s ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0,0,0,.25); }

/* paintings hanging on a wall */
.wall {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 0.86;
}
.frame {
  position: absolute;
  margin: 0;
  background: #fff;
  padding: clamp(6px, 1.1vw, 13px);
  box-shadow:
    0 2px 4px rgba(0,0,0,.12),
    0 18px 40px rgba(0,0,0,.28);
  transition: transform .35s ease;
}
.frame img { width: 100%; height: auto; }
.frame-a { left: 2%;  top: 9%;  width: 29%; transform: rotate(-4deg); z-index: 1; }
.frame-b { left: 28%; top: 0;   width: 39%; transform: rotate(1.5deg); z-index: 2; }
.frame-c { right: 1%; top: 21%; width: 37%; transform: rotate(5deg); z-index: 3; }
.frame-a:hover { transform: rotate(-2deg) translateY(-4px); }
.frame-b:hover { transform: rotate(0deg) translateY(-4px); }
.frame-c:hover { transform: rotate(3deg) translateY(-4px); }

/* ---------- 2. BIO ---------- */
.bio {
  background: #000;
  color: #fff;
  overflow: hidden;
}
.bio-inner {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(24px, 5vw, 64px);
  align-items: end;
}
.bio-copy { padding: clamp(64px, 9vw, 112px) 0; }
.bio h2 {
  font-size: clamp(40px, 5.5vw, 64px);
  color: var(--orange);
  margin-bottom: 28px;
}
.bio-copy p { color: #e6e6e6; margin-bottom: 18px; max-width: 36em; }
.pills { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }
.pills li {
  border: 1px solid rgba(255,255,255,.35);
  border-radius: var(--radius);
  padding: 7px 16px;
  font-size: 14px;
  line-height: 1.3;
  color: #fff;
}
.bio-photo {
  align-self: end;
  justify-self: center;
  width: 100%;
  max-width: 460px;
}
.bio-photo img {
  width: 100%;
  /* melt the photo edges into the black background */
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 6%, #000 94%, transparent 100%);
          mask-image: linear-gradient(to right, transparent 0, #000 6%, #000 94%, transparent 100%);
}

/* ---------- 3. WORKS ---------- */
.works { background: var(--bg); padding: clamp(72px, 9vw, 120px) 0; }
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px 48px;
  margin-bottom: clamp(32px, 4vw, 52px);
}
.section-head h2 { font-size: clamp(34px, 4.6vw, 56px); max-width: 12ch; }
.section-head p { color: var(--muted); max-width: 30em; }

.grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(28px, 3vw, 40px) clamp(16px, 2vw, 28px);
}
.card {
  all: unset;
  display: block;
  width: 100%;
  cursor: pointer;
  border-radius: 4px;
}
.card:focus-visible { outline: 3px solid var(--orange); outline-offset: 4px; }
.card-media {
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: var(--card-bg);
  margin-bottom: 14px;
}
.card-media img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .6s cubic-bezier(.2,.7,.2,1);
}
.card:hover .card-media img, .card:focus-visible .card-media img { transform: scale(1.06); }
.card h3 { font-size: 19px; line-height: 1.2; margin-bottom: 4px; color: var(--text); }
.card:hover h3 { color: var(--orange); }
.card .original { font-style: italic; color: var(--muted); font-size: 15px; margin-bottom: 4px; }
.card .meta { font-size: 13.5px; color: var(--text); opacity: .8; line-height: 1.4; }

/* ---------- 4. PROCESS ---------- */
.process { background: var(--surface); padding: clamp(72px, 9vw, 112px) 0; }
.process h2 { font-size: clamp(32px, 4.2vw, 50px); margin-bottom: clamp(36px, 5vw, 56px); max-width: 14ch; }
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(28px, 4vw, 56px); }
.dot {
  display: block;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--orange);
  margin-bottom: 22px;
}
.step h3 { font-size: 22px; margin-bottom: 12px; }
.step p { color: var(--muted); }
@media (prefers-color-scheme: dark) { .step p { color: #c4c4c4; } }

/* ---------- 5. CLOSING ---------- */
.closing {
  background: var(--orange);
  color: var(--black);
  text-align: center;
  padding: clamp(72px, 9vw, 112px) 0 40px;
}
.closing :focus-visible { outline-color: var(--black); }
.closing-logo { width: clamp(220px, 32vw, 380px); margin: 0 auto 28px; }
.closing-text {
  font-weight: 900;
  font-size: clamp(24px, 3.2vw, 36px);
  line-height: 1.2;
  max-width: 20em;
  margin: 0 auto 40px;
}
.contact {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px 40px;
  margin-bottom: 56px;
}
.contact li { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.contact span { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; opacity: .75; }
.contact a { font-weight: 900; text-decoration: none; font-size: 18px; border-bottom: 2px solid transparent; }
.contact a:hover { border-bottom-color: currentColor; }
.copy { font-size: 13px; opacity: .7; }

/* ---------- LIGHTBOX ---------- */
.lightbox {
  width: min(1120px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: var(--dialog-bg);
  color: var(--text);
  overflow: auto;
}
.lightbox::backdrop { background: rgba(0,0,0,.82); }
.lb-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
}
.lb-media {
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
}
.lb-media img {
  width: 100%;
  height: auto;
  max-height: calc(100dvh - 32px);
  object-fit: contain;
}
.lb-info { padding: clamp(24px, 3vw, 40px); display: flex; flex-direction: column; }
.lb-count { font-size: 13px; color: var(--muted); letter-spacing: .06em; margin-bottom: 10px; }
.lb-info h3 { font-size: clamp(26px, 3vw, 36px); margin-bottom: 6px; }
.lb-original { font-style: italic; color: var(--muted); margin-bottom: 24px; }
.lb-specs { margin: 0 0 24px; border-top: 1px solid var(--line); }
.lb-specs div { display: grid; grid-template-columns: 90px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.lb-specs dt { font-weight: 900; font-size: 14px; }
.lb-specs dd { margin: 0; font-size: 15px; }
.lb-thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 24px; }
.lb-thumbs button {
  all: unset;
  cursor: pointer;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border-radius: 3px;
  outline: 2px solid transparent;
  outline-offset: 2px;
  opacity: .65;
  transition: opacity .2s;
}
.lb-thumbs button:hover { opacity: 1; }
.lb-thumbs button[aria-current="true"] { outline-color: var(--orange); opacity: 1; }
.lb-thumbs button:focus-visible { outline-color: var(--text); }
.lb-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.lb-controls { display: flex; gap: 10px; margin-top: auto; }
.lb-btn {
  font: inherit;
  font-weight: 900;
  cursor: pointer;
  border: 2px solid var(--text);
  background: transparent;
  color: var(--text);
  border-radius: var(--radius);
  min-width: 48px;
  height: 46px;
  padding: 0 18px;
  font-size: 17px;
  transition: background .2s, color .2s;
}
.lb-btn:hover { background: var(--text); color: var(--bg); }
.lb-close { margin-left: auto; background: var(--text); color: var(--bg); }
.lb-close:hover { background: var(--orange); border-color: var(--orange); color: #000; }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1024px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .hero-inner { grid-template-columns: 1fr; }
  .wall { max-width: 560px; margin: 8px auto 0; aspect-ratio: 1 / 0.76; }
  .hero-inner { padding-bottom: 48px; }
  .bio-inner { grid-template-columns: 1fr; gap: 0; }
  .bio-copy { padding-bottom: 16px; }
  .bio-photo { max-width: 380px; }
  /* trim the empty black headroom above the head on small screens */
  .bio-photo img { aspect-ratio: 733 / 820; object-fit: cover; object-position: center bottom; }
  .section-head { flex-direction: column; align-items: flex-start; }
  .steps { grid-template-columns: 1fr; }
  .step { display: grid; grid-template-columns: 56px 1fr; column-gap: 20px; }
  .step .dot { grid-row: span 2; margin: 0; }
  .lb-inner { grid-template-columns: 1fr; }
  .lb-media { min-height: 0; }
  .lb-media img { max-height: 50dvh; width: auto; }
}

@media (max-width: 600px) {
  body { font-size: 16px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card h3 { font-size: 16px; }
  .card .original { font-size: 13.5px; }
  .card .meta { font-size: 12.5px; }
  .contact { flex-direction: column; }
}

@media (max-width: 400px) {
  .brand { font-size: 15px; letter-spacing: .04em; }
  .nav-links { gap: 12px; }
  .nav-links a { font-size: 14px; }
  .lb-btn { padding: 0 14px; }
  .step { grid-template-columns: 44px 1fr; column-gap: 16px; }
  .dot { width: 44px; height: 44px; }
}
