/* Adrian R. Perdomo — site styles */
@view-transition { navigation: auto; }

:root {
  --ink: #1A1816;
  --ink-2: #3D3935;
  --muted: #57524C;
  --line: #E8E5E0;
  --line-2: #D9D5CF;
  --soft: #F3F1ED;
  --wall: #F6F4F1;
  --paper: #FFFFFF;
  --lime: #D4FF3A;
  --serif: 'Gloock', Georgia, 'Times New Roman', serif;
  --sans: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --pad: 18px;
  --nav-h: 58px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: env(safe-area-inset-top, 0px); }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: calc(var(--nav-h) + 44px + env(safe-area-inset-bottom, 0px));
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 6px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { max-width: 1440px; margin: 0 auto; padding: 0 var(--pad); }

/* ---------- Header & navigation ---------- */
.site-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-top: 14px; min-height: 60px; }
.brand { display: inline-flex; align-items: baseline; gap: 10px; text-decoration: none; }
.brand .mark { font-family: var(--serif); font-size: 30px; line-height: 1; letter-spacing: -0.05em; }
.brand .name { font-size: 13px; font-weight: 500; }

.nav {
  position: fixed; z-index: 20;
  left: var(--pad); right: var(--pad);
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  height: var(--nav-h);
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px;
  padding: 6px; border-radius: 999px; background: var(--ink);
  max-width: 480px; margin: 0 auto;
}
.nav a {
  display: flex; align-items: center; justify-content: center;
  border-radius: 999px; color: #FFFFFF; text-decoration: none; font-size: 14px;
  transition: background-color .2s ease, color .2s ease;
}
.nav a[aria-current="page"] { background: var(--lime); color: var(--ink); font-weight: 600; }
.nav a:not([aria-current]):hover { background: rgba(255,255,255,0.12); }
.nav a:focus-visible { outline-color: var(--lime); }

@media (min-width: 900px) {
  :root { --pad: 48px; }
  body { padding-bottom: 0; }
  .site-head { padding-top: 28px; }
  .brand .mark { font-size: 40px; }
  .brand .name { font-size: 15px; }
  .nav { position: static; display: flex; height: auto; max-width: none; margin: 0; }
  .nav a { height: 44px; padding: 0 22px; font-size: 15px; }
}

/* ---------- Shared bits ---------- */
.page-title { margin: 14px 0 0; font-weight: 600; font-size: 48px; line-height: 1; letter-spacing: -0.04em; }
@media (min-width: 900px) { .page-title { margin-top: 44px; font-size: 72px; } }

.pill {
  display: inline-flex; align-items: center; height: 38px; padding: 0 15px;
  border-radius: 999px; border: 1px solid var(--line-2); background: var(--paper);
  font-size: 14px; cursor: pointer; white-space: nowrap; flex-shrink: 0;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.pill:hover { border-color: var(--ink); }
.pill[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #FFFFFF; font-weight: 600; }

.tag { display: inline-flex; align-items: center; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; white-space: nowrap; flex-shrink: 0; }
.tag.sale { background: var(--lime); color: var(--ink); }
.tag.sold { font-weight: 500; border: 1px solid var(--line-2); color: var(--muted); padding: 3px 9px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 54px; padding: 0 24px; border-radius: 999px; border: none;
  font-weight: 600; font-size: 16px; text-decoration: none; cursor: pointer;
}
.btn.lime { background: var(--lime); color: var(--ink); }
.btn.dark { background: var(--ink); color: #FFFFFF; }
.btn.ghost { background: transparent; border: 1px solid var(--ink); color: var(--ink); height: 44px; font-weight: 500; font-size: 14px; }

.round {
  width: 52px; height: 52px; border-radius: 50%; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line-2); background: var(--paper); cursor: pointer;
}
.round svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.empty { padding: 40px 0; color: var(--muted); }
.site-foot { padding: 48px 0 24px; font-size: 13px; color: var(--muted); }

/* ---------- Home ---------- */
.hero { display: flex; align-items: flex-end; gap: 16px; margin-top: 18px; }
.hero h1 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: clamp(112px, 32vw, 230px); line-height: 0.76; letter-spacing: -0.05em; }
.hero .who { display: flex; flex-direction: column; gap: 10px; padding-bottom: 6px; }
.hero .who strong { font-weight: 600; font-size: 17px; line-height: 1.1; }
.hero .who span { font-size: 12px; line-height: 1.4; color: var(--muted); }
@media (min-width: 900px) {
  .hero { gap: 28px; margin-top: 4px; }
  .hero .who strong { font-size: 26px; }
  .hero .who span { font-size: 15px; }
}
.home-head { justify-content: flex-end; }
@media (max-width: 899px) { .home-head { min-height: 0; padding-top: 0; } }

.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 28px 0 12px; }
.section-head h2 { margin: 0; font-weight: 600; font-size: 18px; }
.section-head a { font-size: 14px; color: var(--muted); text-decoration: none; }
.section-head a:hover { color: var(--ink); text-decoration: underline; }
@media (min-width: 900px) { .section-head { padding-top: 40px; } .section-head h2 { font-size: 22px; } .section-head a { font-size: 15px; } }

.mosaic { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 31vw; grid-auto-flow: dense; gap: 10px; }
@media (min-width: 700px) { .mosaic { grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: 15vw; } }
@media (min-width: 1100px) { .mosaic { grid-template-columns: repeat(6, minmax(0, 1fr)); grid-auto-rows: min(10.5vw, 151px); gap: 14px; } }
.tile { position: relative; overflow: hidden; display: block; background: var(--soft); }
.tile img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.2,.7,.2,1); }
.tile:hover img { transform: scale(1.03); }
.tile .tag { position: absolute; left: 14px; top: 14px; font-size: 13px; padding: 6px 13px; }
.tile.f-horizontal { grid-column: span 2; grid-row: span 2; }
.tile.f-vertical { grid-column: span 1; grid-row: span 2; }
.tile.f-square { grid-column: span 1; grid-row: span 1; }
.tile.hero-tile { grid-column: span 2; grid-row: span 2; }
@media (min-width: 1100px) { .tile.hero-tile { grid-column: span 4; grid-row: span 3; } }
.tile:nth-child(8n+1) { border-radius: 28px 28px 28px 6px; }
.tile:nth-child(8n+2) { border-radius: 90px 90px 18px 18px; }
.tile:nth-child(8n+3) { border-radius: 50%; }
.tile:nth-child(8n+4) { border-radius: 18px 60px 18px 18px; }
.tile:nth-child(8n+5) { border-radius: 28px 6px 28px 28px; }
.tile:nth-child(8n+6) { border-radius: 18px 18px 90px 90px; }
.tile:nth-child(8n+7) { border-radius: 60% 40% 50% 50% / 45% 45% 55% 55%; }
.tile:nth-child(8n+8) { border-radius: 6px 28px 28px 28px; }
.tile.f-vertical:nth-child(n) { border-radius: 999px 999px 18px 18px; }
.tile.hero-tile:nth-child(n) { border-radius: 36px 36px 36px 8px; }

/* ---------- Works ---------- */
.works-head { display: flex; justify-content: space-between; align-items: baseline; }
.works-head .count { font-size: 13px; color: var(--muted); }
.filters { margin-top: 16px; padding: 14px 0 12px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.filters .row { display: flex; gap: 6px; align-items: center; overflow-x: auto; scrollbar-width: none; margin: 0 calc(var(--pad) * -1); padding: 2px var(--pad); }
.filters .row::-webkit-scrollbar { display: none; }
.filters .end { display: flex; justify-content: space-between; align-items: center; }
.sort-btn { height: 40px; padding: 0; border: none; background: transparent; font-size: 14px; font-weight: 500; cursor: pointer; }
.seg { display: flex; background: var(--soft); border-radius: 999px; padding: 3px; }
.seg button { height: 34px; padding: 0 15px; border: none; border-radius: 999px; background: transparent; color: var(--muted); font-size: 13px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--paper); color: var(--ink); font-weight: 600; box-shadow: 0 1px 3px rgba(26,24,22,.14); }
@media (min-width: 900px) {
  .filters { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 20px; margin-top: 22px; }
  .filters .row { margin: 0; padding: 2px 0; overflow: visible; }
  .filters .end { margin-left: auto; gap: 20px; }
  .filters .divider { width: 1px; height: 26px; background: var(--line-2); }
}
@media (max-width: 899px) { .filters .divider { display: none; } }

.masonry { display: flex; gap: 12px; align-items: flex-start; padding-top: 18px; }
.masonry .col { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 22px; }
@media (min-width: 900px) { .masonry { gap: 22px; padding-top: 26px; } .masonry .col { gap: 28px; } }
.card { display: block; text-decoration: none; }
.card .frame { border-radius: 12px; overflow: hidden; background: var(--soft); }
.card img { width: 100%; height: auto; transition: opacity .4s ease; }
.card img.loading { opacity: 0; }
.card .cap { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 8px; }
.card .cap b { font-weight: 600; font-size: 14px; }
.card .meta { font-size: 12px; color: var(--muted); }
@media (min-width: 900px) { .card .cap b { font-size: 15px; } .card .meta { font-size: 13px; } }

.list { list-style: none; margin: 0; padding: 0; }
.list li { border-bottom: 1px solid var(--line); }
.list a { display: flex; align-items: center; gap: 12px; padding: 10px 0; text-decoration: none; }
.list .thumb { width: 60px; height: 60px; border-radius: 12px; overflow: hidden; flex-shrink: 0; background: var(--soft); }
.list .thumb img { width: 100%; height: 100%; object-fit: cover; }
.list .txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.list .txt b { font-weight: 600; font-size: 16px; }
.list .txt span { font-size: 13px; color: var(--muted); }
.sentinel { height: 1px; }
.loader { padding: 26px 0 10px; text-align: center; font-size: 13px; color: var(--muted); }

/* ---------- Artwork view ---------- */
body.art-page { padding-bottom: 0; background: var(--paper); }
.art { min-height: 100svh; display: flex; flex-direction: column; }
.art-top { display: flex; justify-content: space-between; align-items: center; padding: 14px 14px 0; }
.art-top .round { background: var(--soft); border: none; width: 44px; height: 44px; }
.art-top .counter { font-size: 13px; color: var(--muted); }
.stage { position: relative; flex: 1; min-height: 52svh; display: flex; align-items: center; justify-content: center; padding: 18px; overflow: hidden; touch-action: none; cursor: zoom-in; user-select: none; -webkit-user-select: none; }
.stage.zoomed { cursor: grab; }
.stage img { max-width: 100%; max-height: calc(100svh - 360px); width: auto; height: auto; border-radius: 4px; box-shadow: 0 24px 40px -26px rgba(26,24,22,.55); transform-origin: 0 0; will-change: transform; view-transition-name: artwork; -webkit-user-drag: none; }
.stage .hint { position: absolute; left: 0; right: 0; bottom: 4px; text-align: center; font-size: 12px; color: var(--muted); pointer-events: none; }
.sheet { background: var(--ink); color: #FFFFFF; border-radius: 28px 28px 0 0; padding: 10px var(--pad) calc(24px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; }
.sheet .handle { align-self: center; width: 40px; height: 4px; border-radius: 2px; background: var(--muted); }
.sheet h1 { margin: 18px 0 0; font-weight: 600; font-size: 34px; line-height: 1.05; letter-spacing: -0.03em; }
.sheet .chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.sheet .chip { font-size: 13px; padding: 5px 12px; border-radius: 999px; border: 1px solid #5C5751; }
.sheet .tag { font-size: 13px; padding: 6px 13px; }
.sheet .tag.sold { border-color: #5C5751; color: #C9C4BD; }
.sheet .details { margin: 12px 0 0; font-size: 14px; color: #C9C4BD; }
.sheet .actions { display: flex; gap: 8px; align-items: center; margin-top: 26px; }
.sheet .actions .btn { flex: 1; height: 52px; font-size: 15px; }
.sheet .round { background: transparent; border-color: #5C5751; color: #FFFFFF; }
.sheet .keys { display: none; }
@media (min-width: 900px) {
  .art { flex-direction: row; height: 100svh; }
  .art-top { display: none; }
  .stage { order: 1; background: var(--wall); padding: 56px 96px; }
  .stage img { max-height: calc(100svh - 112px); }
  .stage .hint { display: none; }
  .stage .round { position: absolute; top: 50%; margin-top: -26px; z-index: 2; }
  .stage .prev { left: 20px; } .stage .next { right: 20px; }
  .sheet { order: 2; width: 400px; flex-shrink: 0; border-radius: 0; background: var(--paper); color: var(--ink); padding: 32px 40px; }
  .sheet .handle { display: none; }
  .sheet .desk-top { display: flex !important; justify-content: space-between; align-items: center; }
  .sheet .counter { margin-top: 72px; font-size: 14px; color: var(--muted); display: block !important; }
  .sheet h1 { margin-top: 8px; font-size: 48px; }
  .sheet .chip { border-color: var(--line-2); }
  .sheet .tag.sold { border-color: var(--line-2); color: var(--muted); }
  .sheet .details { color: var(--muted); }
  .sheet .actions .round { display: none; }
  .sheet .keys { display: block; margin-top: auto; font-size: 13px; color: var(--muted); }
}
@media (max-width: 899px) { .stage .round { display: none; } .sheet .desk-top, .sheet .counter { display: none; } }
.sheet .desk-top .brand .mark { font-size: 30px; }
.sheet .desk-top .round { background: var(--soft); border: none; width: 44px; height: 44px; color: var(--ink); }

/* ---------- Bio ---------- */
.portrait { margin-top: 18px; aspect-ratio: 4 / 5; max-height: 560px; border-radius: 999px 999px 20px 20px; overflow: hidden; background: var(--soft); display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 13px; }
.portrait img { width: 100%; height: 100%; object-fit: cover; }
.bio-grid { display: block; }
@media (min-width: 900px) { .bio-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 64px; align-items: start; margin-top: 32px; } .bio-grid .portrait { margin-top: 0; } }
.lead { margin: 24px 0 0; font-size: 22px; line-height: 1.3; font-weight: 500; letter-spacing: -0.01em; max-width: 34ch; }
.body-text p { margin: 14px 0 0; font-size: 16px; line-height: 1.65; color: var(--ink-2); max-width: 62ch; }
.cv-head { display: flex; justify-content: space-between; align-items: center; margin-top: 36px; }
.cv-head h2 { margin: 0; font-weight: 600; font-size: 28px; letter-spacing: -0.03em; }
.cv-head a { font-size: 14px; font-weight: 500; }
.cv-tabs { display: flex; gap: 6px; flex-wrap: wrap; padding: 8px 0 6px; }
.cv { list-style: none; margin: 0; padding: 0; }
.cv li { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.cv .yr { width: 52px; flex-shrink: 0; font-size: 14px; color: var(--muted); padding-top: 1px; }
.cv .what { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.cv .what b { font-weight: 600; }
.cv .what span { font-size: 14px; color: var(--muted); }
.cv .kind { align-self: flex-start; font-size: 12px; font-weight: 500; padding: 3px 10px; border-radius: 999px; background: var(--soft); color: var(--ink-2); }

/* ---------- Contact ---------- */
.contact-grid { display: block; }
@media (min-width: 900px) { .contact-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 80px; align-items: start; } }
.intro { margin: 12px 0 0; font-size: 17px; line-height: 1.5; color: var(--ink-2); max-width: 40ch; }
form.contact { display: flex; flex-direction: column; gap: 16px; margin-top: 24px; max-width: 620px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 500; }
.field input, .field textarea { font-family: var(--sans); font-size: 16px; color: var(--ink); background: var(--paper); border: 1px solid var(--line-2); border-radius: 14px; padding: 13px 14px; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px var(--lime); }
.field textarea { resize: vertical; min-height: 140px; }
.topics { display: flex; gap: 6px; flex-wrap: wrap; }
fieldset { border: none; margin: 0; padding: 0; }
legend { font-size: 14px; font-weight: 500; margin-bottom: 8px; padding: 0; }
.attached { display: flex; align-items: center; gap: 12px; background: var(--wall); border-radius: 16px; padding: 10px; }
.attached img { width: 56px; height: 56px; object-fit: cover; border-radius: 10px; }
.attached div { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.attached b { font-size: 15px; }
.attached span { font-size: 13px; color: var(--muted); }
.attached button { border: none; background: transparent; font-size: 13px; color: var(--muted); text-decoration: underline; cursor: pointer; min-height: 44px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.note { font-size: 13px; color: var(--muted); margin: 0; }
.form-msg { border-radius: 24px; padding: 26px 22px; margin-top: 24px; max-width: 620px; }
.form-msg.ok { background: var(--lime); }
.form-msg.err { background: var(--soft); }
.form-msg p { margin: 0; font-weight: 600; font-size: 24px; line-height: 1.15; letter-spacing: -0.02em; }
.form-msg.err p { font-size: 17px; font-weight: 500; letter-spacing: 0; }
.form-msg .btn { margin-top: 14px; }
.elsewhere { margin-top: 36px; }
.elsewhere h2 { margin: 0 0 4px; font-size: 14px; font-weight: 500; color: var(--muted); }
.elsewhere a { display: flex; justify-content: space-between; align-items: center; min-height: 56px; border-bottom: 1px solid var(--line); text-decoration: none; font-weight: 600; font-size: 19px; }
.elsewhere a span { font-size: 14px; font-weight: 400; color: var(--muted); }
.elsewhere a:hover span { color: var(--ink); }

@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
