/* ====== alnmorales.com ====== */

:root {
  --bg: #0c0a08;
  --panel: #15110d;
  --text: #ece4d4;
  --muted: #7a7367;
  --line: rgba(236, 228, 212, 0.08);
  --accent: oklch(78% 0.09 80);
  --serif: 'Cormorant Garamond', 'EB Garamond', Garamond, serif;
  --sans: 'DM Sans', 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --feed-max: 100vw;
  --feed-pad: 0;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 16px;
  line-height: 1.5;
}

body {
  min-height: 100vh;
  background: var(--bg);
}

img { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; padding: 0; }
a { color: inherit; text-decoration: none; }

::selection { background: var(--accent); color: var(--bg); }

/* ====== Nav ====== */

.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 22px 40px;
  background: linear-gradient(to bottom, rgba(12, 10, 8, 0.6) 0%, rgba(12, 10, 8, 0));
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), background 0.3s, backdrop-filter 0.3s, padding 0.25s;
}

.nav-scrolled {
  background: rgba(12, 10, 8, 0.78);
  backdrop-filter: saturate(140%) blur(18px);
  -webkit-backdrop-filter: saturate(140%) blur(18px);
  border-bottom: 1px solid var(--line);
  padding: 16px 40px;
}

.nav-hidden { transform: translateY(-100%); }

.nav-inner {
  max-width: 1840px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-mark {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.32em;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 1px;
  text-transform: none;
}

.nav-mark span { display: inline-block; }
.nav-mark-space { width: 10px; }

.nav-links {
  display: flex;
  gap: 38px;
  list-style: none;
  margin: 0; padding: 0;
}

.nav-link {
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 6px 0;
  position: relative;
  transition: color 0.25s;
}

.nav-link:hover, .nav-link.active { color: var(--text); }

.nav-link.active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -4px;
  transform: translateX(-50%);
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--accent);
}

@media (max-width: 720px) {
  .nav { padding: 16px 20px; }
  .nav-scrolled { padding: 12px 20px; }
  .nav-links { gap: 22px; }
  .nav-link { font-size: 11px; letter-spacing: 0.14em; }
  .nav-mark { font-size: 10px; letter-spacing: 0.24em; }
}

/* ====== Layout ====== */

.main { padding-top: 0; }
.page { padding-top: 140px; padding-bottom: 160px; }

/* ====== Journal ====== */

.journal-header {
  max-width: 1100px;
  margin: 0 auto 120px;
  padding: 0 clamp(24px, 4vw, 60px);
  text-align: left;
}

.journal-header-eyebrow,
.coll-header-eyebrow,
.about-eyebrow,
.coll-detail-eyebrow {
  font-size: 11px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 24px;
  font-weight: 500;
}

.journal-header-title,
.coll-header-title {
  font-family: var(--serif);
  font-size: clamp(48px, 7vw, 96px);
  font-weight: 400;
  line-height: 0.98;
  letter-spacing: -0.015em;
  margin: 0 0 32px;
  color: var(--text);
  font-style: italic;
}

.journal-header-meta,
.coll-detail-meta {
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
}

.meta-dot, .post-meta-dot, .footer-dot {
  width: 3px; height: 3px;
  border-radius: 50%;
  background: var(--muted);
  display: inline-block;
}

.feed { display: flex; flex-direction: column; gap: 9rem; }
.post { width: 100%; }

/* ====== Photo post ====== */

.post-photo .photo-frame,
.photoset-item .photo-frame,
.coll-detail-frame .photo-frame {
  max-width: var(--feed-max);
  margin: 0 auto;
  padding-left: var(--feed-pad);
  padding-right: var(--feed-pad);
}

.photo-frame {
  position: relative;
  display: block;
  width: 100%;
  height: 0;
  overflow: hidden;
  background: var(--panel);
  cursor: zoom-in;
  border: none;
}

.photo-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.6s ease, transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.photo-img.loaded { opacity: 1; }
.photo-frame:hover .photo-img { transform: scale(1.012); }

.photo-zoom-hint {
  position: absolute;
  top: 18px; right: 18px;
  width: 32px; height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(8px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.85);
  opacity: 0;
  transition: opacity 0.25s;
  pointer-events: none;
}

.photo-frame:hover .photo-zoom-hint { opacity: 1; }

.post-body-photo {
  max-width: 1100px;
  margin: 28px auto 0;
  padding: 0 clamp(24px, 4vw, 60px);
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 16px;
  font-weight: 500;
}

.post-type { color: var(--accent); }
.post-meta > span { white-space: nowrap; }
.post-date { white-space: nowrap; }

.post-title {
  font-family: var(--serif);
  font-size: clamp(28px, 3.4vw, 44px);
  font-weight: 400;
  font-style: italic;
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin: 0 0 16px;
  color: var(--text);
}

.post-title a { color: inherit; transition: color 0.25s; }
.post-title a:hover { color: var(--accent); }

.post-caption {
  font-size: 15px;
  line-height: 1.65;
  color: var(--muted);
  max-width: 680px;
  margin: 0;
  font-weight: 300;
}

.post-permalink {
  margin-top: 14px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  display: inline-block;
  transition: color 0.2s;
}
.post-permalink:hover { color: var(--accent); }

/* ====== Photoset ====== */

.photoset-header {
  max-width: 1100px;
  margin: 0 auto 56px;
  padding: 0 clamp(24px, 4vw, 60px);
}

.photoset-caption { margin-top: 12px; max-width: 720px; }

.photoset-grid {
  display: flex;
  flex-direction: column;
  gap: 4rem;
}

.photoset-item { position: relative; }

.photoset-num {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--muted);
  margin-top: 14px;
  padding: 0 clamp(24px, 4vw, 60px);
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
}

/* ====== Text post ====== */

.post-text-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 clamp(24px, 4vw, 40px);
}

.post-title-text {
  font-size: clamp(32px, 4.2vw, 52px);
  font-style: italic;
  line-height: 1.05;
  margin-bottom: 36px;
}

.post-text-body p {
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1.55;
  color: var(--text);
  margin: 0 0 1.4em;
  font-weight: 400;
  letter-spacing: 0.005em;
}

.post-text-body em { font-style: italic; color: var(--text); }
.post-text-body strong { font-weight: 600; color: var(--text); }
.post-text-body a {
  color: var(--accent);
  border-bottom: 1px solid rgba(0,0,0,0);
  transition: border-color 0.25s;
}
.post-text-body a:hover { border-bottom-color: var(--accent); }

.post-text-body p:first-of-type::first-letter {
  font-size: 1.6em;
  line-height: 1;
  vertical-align: -0.02em;
  margin-right: 0.04em;
  color: var(--accent);
  font-style: italic;
}

.post-text-end {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.32em;
  color: var(--accent);
  margin-top: 56px;
}

/* ====== Quote post ====== */

.post-quote { padding: 4rem clamp(24px, 4vw, 80px); }

.quote-inner {
  max-width: 1100px;
  margin: 0 auto;
  text-align: center;
  position: relative;
}

.quote-mark {
  font-family: var(--serif);
  font-size: 180px;
  font-style: italic;
  line-height: 0.8;
  color: var(--accent);
  opacity: 0.35;
  display: block;
  margin-bottom: -40px;
  height: 80px;
}

.quote-body {
  font-family: var(--serif);
  font-size: clamp(32px, 4.4vw, 56px);
  font-style: italic;
  font-weight: 400;
  line-height: 1.18;
  color: var(--text);
  margin: 0;
  letter-spacing: -0.005em;
  max-width: 16ch;
  margin-inline: auto;
  text-wrap: pretty;
}

.quote-attribution {
  display: block;
  margin-top: 36px;
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-style: normal;
  color: var(--text);
  font-weight: 400;
}

.quote-date {
  margin-top: 14px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--muted);
  text-transform: uppercase;
}

/* ====== Feed end / pagination ====== */

.feed-end, .feed-paging {
  margin-top: 9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--muted);
}

.feed-end-line, .end-line {
  width: 60px;
  height: 1px;
  background: var(--line);
  display: inline-block;
}

.feed-paging a {
  color: var(--muted);
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: color 0.2s, border-color 0.2s;
}
.feed-paging a:hover { color: var(--text); border-color: rgba(236, 228, 212, 0.2); }
.feed-paging .current { color: var(--accent); border-color: var(--accent); }

/* ====== Collections ====== */

.coll-header {
  max-width: 1840px;
  margin: 0 auto 100px;
  padding: 0 clamp(24px, 4vw, 60px);
}

.coll-header-lead {
  font-family: var(--serif);
  font-size: 22px;
  font-style: italic;
  line-height: 1.5;
  color: var(--muted);
  max-width: 540px;
  margin: 0;
  font-weight: 400;
}

.coll-grid {
  max-width: 1840px;
  margin: 0 auto;
  padding: 0 clamp(24px, 4vw, 60px);
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(350px, 100%), 1fr));
  grid-auto-rows: 380px;
  gap: 20px;
}

.coll-card {
  position: relative;
  display: block;
  overflow: hidden;
  background: var(--panel);
  text-decoration: none;
  cursor: pointer;
}

.coll-card-image { position: absolute; inset: 0; }
.coll-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1.2s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s;
  opacity: 0.85;
}

.coll-card:hover .coll-card-image img {
  transform: scale(1.04);
  opacity: 1;
}

.coll-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.05) 0%, rgba(0,0,0,0.0) 35%, rgba(0,0,0,0.85) 100%);
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #fff;
}

.coll-card-num {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.28em;
  color: rgba(255, 255, 255, 0.8);
  align-self: flex-start;
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 4px 10px;
  border-radius: 999px;
  backdrop-filter: blur(4px);
}

.coll-card-meta { width: 100%; }

.coll-card-title {
  font-family: var(--serif);
  font-size: clamp(28px, 3vw, 42px);
  font-weight: 400;
  font-style: italic;
  line-height: 1;
  letter-spacing: -0.01em;
  margin: 0 0 8px;
  color: #fff;
}

.coll-card-count {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.75);
  font-weight: 400;
}

.coll-card-arrow {
  font-size: 16px;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.coll-card:hover .coll-card-arrow {
  transform: translateX(6px);
  color: var(--accent);
}

@media (max-width: 720px) {
  .coll-grid { grid-auto-rows: 320px; }
}

/* ====== Collection detail ====== */

.coll-detail-header {
  max-width: 920px;
  margin: 0 auto 100px;
  padding: 0 clamp(24px, 4vw, 60px);
}

.coll-back {
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 56px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: color 0.2s;
}

.coll-back:hover { color: var(--text); }
.coll-back .arrow { transition: transform 0.3s; display: inline-block; }
.coll-back:hover .arrow { transform: translateX(-3px); }

.coll-detail-title {
  font-family: var(--serif);
  font-size: clamp(56px, 8vw, 120px);
  font-style: italic;
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: -0.02em;
  margin: 0 0 28px;
}

.coll-detail-desc {
  font-family: var(--serif);
  font-size: 22px;
  font-style: italic;
  line-height: 1.5;
  color: var(--muted);
  max-width: 600px;
  margin: 0 0 28px;
}

.coll-detail-feed {
  display: flex;
  flex-direction: column;
  gap: 7rem;
}

.coll-detail-num {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--muted);
  text-align: center;
  margin-top: 18px;
}

.coll-detail-end {
  margin-top: 8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--muted);
}

.end-line { width: 80px; height: 1px; background: var(--line); }

/* ====== About ====== */

.page-about {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 80px;
  max-width: 1300px;
  margin: 0 auto;
  padding: 140px clamp(24px, 4vw, 60px) 160px;
  align-items: start;
}

.about-portrait {
  position: sticky;
  top: 140px;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--panel);
}

.about-portrait img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: brightness(0.95);
}

.about-portrait-placeholder {
  width: 100%; height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
}

.about-title {
  font-family: var(--serif);
  font-size: clamp(56px, 7vw, 88px);
  font-style: italic;
  font-weight: 400;
  line-height: 1;
  margin: 0 0 48px;
  letter-spacing: -0.015em;
}

.about-prose p {
  font-family: var(--serif);
  font-size: 21px;
  line-height: 1.6;
  color: var(--text);
  margin: 0 0 1.3em;
  font-weight: 400;
}

.about-prose p:first-of-type {
  font-size: 24px;
  color: var(--text);
}

.about-prose a {
  color: var(--accent);
  border-bottom: 1px solid rgba(0,0,0,0);
  transition: border-color 0.25s;
}
.about-prose a:hover { border-bottom-color: var(--accent); }

.about-divider {
  height: 1px;
  background: var(--line);
  margin: 56px 0;
}

.about-meta { display: flex; flex-direction: column; gap: 14px; }

.about-meta-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  font-size: 13px;
  align-items: baseline;
}

.about-meta-label {
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.about-meta-row a { color: var(--text); border-bottom: 1px solid var(--line); }

@media (max-width: 900px) {
  .page-about { grid-template-columns: 1fr; gap: 48px; padding-top: 120px; }
  .about-portrait { position: static; aspect-ratio: 4 / 3; }
}

/* ====== Footer ====== */

.footer {
  border-top: 1px solid var(--line);
  padding: 48px clamp(24px, 4vw, 60px);
  margin-top: 60px;
}

.footer-inner {
  max-width: 1840px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-mark { font-size: 11px; letter-spacing: 0.32em; color: var(--muted); }

.footer-meta {
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--muted);
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
}

.footer-links {
  display: flex;
  gap: 14px;
}
.footer-links a { color: var(--muted); transition: color 0.2s; }
.footer-links a:hover { color: var(--text); }

/* ====== 404 ====== */

.page-404 {
  min-height: 80vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 24px;
}
.page-404-title {
  font-family: var(--serif);
  font-size: clamp(56px, 8vw, 96px);
  font-style: italic;
  font-weight: 400;
  margin: 0 0 24px;
}
.page-404-back {
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 10px 18px;
  border-radius: 999px;
  transition: color 0.2s, border-color 0.2s;
  display: inline-block;
  margin-top: 12px;
}
.page-404-back:hover { color: var(--text); border-color: rgba(236, 228, 212, 0.2); }

/* ====== Lightbox ====== */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(8, 6, 4, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: none;
  align-items: center;
  justify-content: center;
}

.lightbox.open { display: flex; animation: lb-in 0.32s cubic-bezier(0.16, 1, 0.3, 1); }

@keyframes lb-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.lb-topbar {
  position: absolute;
  top: 0; left: 0; right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px 32px;
  z-index: 2;
}

.lb-counter {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--muted);
  display: flex;
  gap: 6px;
}

.lb-counter-sep { color: var(--accent); }

.lb-controls { display: flex; gap: 12px; align-items: center; }

.lb-btn {
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: color 0.2s, border-color 0.2s;
  font-family: var(--mono);
  display: flex;
  align-items: center;
  gap: 6px;
}

.lb-btn:hover { color: var(--text); border-color: rgba(236, 228, 212, 0.2); }
.lb-btn.active { color: var(--accent); border-color: var(--accent); }
.lb-btn[hidden] { display: none; }
.lb-close { padding: 8px; }

.lb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  background: rgba(0,0,0,0.3);
  transition: color 0.25s, border-color 0.25s;
}

.lb-nav:hover { color: var(--text); border-color: rgba(236, 228, 212, 0.3); }
.lb-nav-prev { left: 32px; }
.lb-nav-next { right: 32px; }

.lb-stage {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.lb-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  cursor: zoom-in;
  user-select: none;
  -webkit-user-drag: none;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.lb-stage.zoomed { cursor: grab; }
.lb-stage.zoomed:active { cursor: grabbing; }

.lb-img.zoomed {
  max-width: none;
  max-height: none;
  width: auto;
  height: auto;
  position: absolute;
  left: 50%;
  top: 50%;
  cursor: grab;
  transition: none;
}

.lb-exif {
  position: absolute;
  bottom: 80px;
  right: 32px;
  background: rgba(15, 12, 8, 0.85);
  backdrop-filter: blur(16px);
  border: 1px solid var(--line);
  padding: 18px 22px;
  font-family: var(--mono);
  font-size: 11px;
  z-index: 2;
  min-width: 220px;
  display: none;
}

.lb-exif.open { display: block; }

.lb-exif-row {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 4px 0;
  border-bottom: 1px solid rgba(236, 228, 212, 0.04);
}

.lb-exif-row:last-child { border-bottom: none; }
.lb-exif-row .k {
  color: var(--muted);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 10px;
}
.lb-exif-row .v { color: var(--text); }

.lb-caption {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--muted);
  text-align: center;
  max-width: 60ch;
  z-index: 1;
  pointer-events: none;
}

@media (max-width: 720px) {
  .lb-nav { display: none; }
  .lb-exif { left: 16px; right: 16px; bottom: 80px; }
}

/* ====== Hide content for noscript fallback ====== */
.no-js .lightbox-trigger { cursor: default; }
