/* ==========================================================
   MARY MEHAN — portfolio
   Design language: dark app-like editorial (juun.j style)
   ========================================================== */

:root {
  --bg: #0e0e0e;
  --bg-raise: #161616;
  --text: #ffffff;
  --text-dim: #b5b5b5;
  --text-faint: #7a7a7a;
  --hairline: #262626;
  --font: "Helvetica Neue", Helvetica, Arial, "Segoe UI", sans-serif;
  --max: 1080px;
  --navbar-h: 64px;
  --topbar-h: 60px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  padding-bottom: var(--navbar-h);
}

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

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

/* ---------- top bar ---------- */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0));
  transition: background 0.3s ease;
}
.topbar.solid { background: rgba(14, 14, 14, 0.92); backdrop-filter: blur(8px); }
.topbar .left { display: flex; align-items: center; gap: 10px; }
.topbar .brand {
  font-size: 21px;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: none;
}
.topbar .right { display: flex; align-items: center; gap: 22px; }
.icon-btn {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  opacity: 0.95;
}
.icon-btn:hover { opacity: 0.7; }
.icon-btn svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 1.6; }

/* ---------- bottom nav ---------- */
.bottomnav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  height: var(--navbar-h);
  background: var(--bg);
  border-top: 1px solid var(--hairline);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding-bottom: env(safe-area-inset-bottom);
}
.bottomnav a, .bottomnav button {
  flex: 1;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  opacity: 0.85;
}
.bottomnav svg { width: 26px; height: 26px; stroke: currentColor; fill: none; stroke-width: 1.6; }
.bottomnav .active { opacity: 1; }
.bottomnav .active svg { stroke-width: 2.2; }
.bottomnav a:hover, .bottomnav button:hover { opacity: 1; }

/* ---------- overlay menu ---------- */
.menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(10, 10, 10, 0.97);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 28px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.menu-overlay.open { opacity: 1; pointer-events: auto; }
.menu-overlay .menu-close {
  position: absolute;
  top: 16px;
  right: 16px;
  font-size: 28px;
  font-weight: 300;
  padding: 8px;
}
.menu-overlay nav a {
  display: block;
  font-size: clamp(34px, 8vw, 54px);
  font-weight: 700;
  line-height: 1.35;
  color: var(--text-faint);
  transition: color 0.2s ease;
}
.menu-overlay nav a:hover, .menu-overlay nav a.active { color: var(--text); }
.menu-overlay .menu-foot {
  position: absolute;
  bottom: calc(var(--navbar-h) + 24px);
  left: 28px;
  font-size: 12px;
  color: var(--text-faint);
  letter-spacing: 0.04em;
}

/* ---------- hero carousel ---------- */
.hero {
  position: relative;
  overflow: hidden;
  height: calc(100dvh - var(--navbar-h));
  background: var(--bg);
}
.hero-track {
  display: flex;
  height: 100%;
  transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.hero-slide {
  flex: 0 0 100%;
  position: relative;
  display: flex;
  align-items: flex-end;
}
.hero-slide .slide-art { position: absolute; inset: 0; }
.hero-slide .slide-caption {
  position: relative;
  z-index: 2;
  padding: 0 28px 84px;
  max-width: var(--max);
  width: 100%;
  margin: 0 auto;
}
.slide-title {
  font-size: clamp(38px, 8vw, 64px);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.01em;
}
.slide-sub {
  margin-top: 18px;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--text-dim);
  max-width: 34ch;
}

/* prev / next arrows */
.hero-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 4;
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  opacity: 0.75;
}
.hero-arrow svg {
  width: 30px;
  height: 30px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
}
.hero-arrow:hover { opacity: 1; }
.hero-arrow.prev { left: 8px; }
.hero-arrow.next { right: 8px; }
.hero-arrow.next svg { transform: scaleX(-1); }

/* slide indicator — thin bars, bottom center */
.hero-progress {
  position: absolute;
  left: 50%;
  bottom: 34px;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  gap: 6px;
}
.hero-progress button {
  width: 56px;
  height: 2px;
  padding: 10px 0;
  background: none;
  position: relative;
}
.hero-progress button::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 2px;
  margin-top: -1px;
  background: rgba(255, 255, 255, 0.28);
}
.hero-progress button.on::after { background: #ffffff; }

/* photographic slide art */
.art-photo {
  background-size: cover;
  background-position: center 22%;
  background-repeat: no-repeat;
  filter: grayscale(1) brightness(0.78);
}
.art-photo.dim { filter: grayscale(1) brightness(0.6); }
@media (min-width: 900px) {
  /* portrait image on a wide screen: keep the subject right of the caption */
  .art-photo { background-position: 72% 20%; }
}

/* cutout portrait composited onto a dark studio backdrop */
.art-portrait {
  background-image:
    url("../img/hero-2.png"),
    radial-gradient(120% 90% at 50% 20%, #4e4e4e 0%, #262626 45%, #0d0d0d 100%);
  background-size: auto 88%, cover;
  background-position: center bottom, center;
  background-repeat: no-repeat;
  filter: grayscale(1);
}
@media (min-width: 900px) {
  /* keep the subject right of the caption on wide screens */
  .art-portrait {
    background-position: 68% bottom, center;
    background-size: auto 94%, cover;
  }
}

/* crouching-figure cutout on a dark studio backdrop */
.art-figure {
  background-image:
    url("../img/hero-3.png"),
    radial-gradient(130% 100% at 60% 30%, #5a5a5a 0%, #2a2a2a 50%, #0d0d0d 100%);
  background-size: auto 78%, cover;
  background-position: right -40px top 42%, center;
  background-repeat: no-repeat;
  filter: grayscale(1);
}
@media (min-width: 900px) {
  .art-figure {
    background-position: right -40px top 45%, center;
    background-size: auto 84%, cover;
  }
}

/* studio-backdrop slide art — monochrome photo feel */
.art-1 {
  background:
    radial-gradient(120% 90% at 60% 30%, #6a6a6a 0%, #3c3c3c 45%, #191919 100%);
}
.art-2 {
  background:
    radial-gradient(130% 100% at 35% 25%, #575757 0%, #303030 50%, #121212 100%);
}
.art-3 {
  background:
    radial-gradient(110% 95% at 70% 40%, #7c7c7c 0%, #424242 40%, #151515 100%);
}
.slide-art::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.72) 0%, rgba(0, 0, 0, 0) 48%);
}
.slide-art::after {
  content: attr(data-mark);
  position: absolute;
  right: 2%;
  top: 46%;
  transform: translateY(-50%);
  font-size: clamp(140px, 38vw, 420px);
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 1;
  color: rgba(255, 255, 255, 0.05);
}

/* ---------- page hero (subpages) ---------- */
.page-hero {
  padding: calc(var(--topbar-h) + 46px) 0 34px;
  border-bottom: 1px solid var(--hairline);
}
.page-hero h1 {
  font-size: clamp(34px, 7vw, 52px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.01em;
}
.page-hero p {
  margin-top: 12px;
  font-size: 14px;
  color: var(--text-dim);
}

/* ---------- sections ---------- */
.section { padding: 52px 0 8px; }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 22px;
}
.section-head h2 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.section-head .more {
  font-size: 12px;
  color: var(--text-faint);
}
.section-head .more::after { content: " \203A"; }

/* ---------- horizontal scroll row ---------- */
.scroll-row {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 24px;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.scroll-row::-webkit-scrollbar { display: none; }
.scroll-row .card { flex: 0 0 68%; scroll-snap-align: start; }
@media (min-width: 720px) {
  .scroll-row .card { flex: 0 0 31%; }
}

/* ---------- cards ---------- */
.card { display: block; }
.card .thumb {
  aspect-ratio: 3 / 4;
  position: relative;
  overflow: hidden;
  margin-bottom: 12px;
  background: var(--bg-raise);
}
.card .thumb::after {
  content: attr(data-num);
  position: absolute;
  right: 10px;
  bottom: 4px;
  font-size: 68px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.07);
  line-height: 1;
}
.card:hover .thumb { opacity: 0.85; }
.card .cat {
  font-size: 11px;
  color: var(--text-faint);
  margin-bottom: 4px;
}
.card .name {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
}
.card .meta {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-dim);
}
.card .meta .tag { color: var(--text); font-weight: 700; margin-right: 8px; }

/* thumb tone variants — studio grays */
.t-1 { background: radial-gradient(110% 90% at 60% 30%, #555, #1d1d1d) !important; }
.t-2 { background: radial-gradient(120% 100% at 30% 25%, #484848, #171717) !important; }
.t-3 { background: radial-gradient(100% 90% at 70% 45%, #616161, #202020) !important; }
.t-4 { background: radial-gradient(120% 95% at 45% 20%, #3e3e3e, #141414) !important; }
.t-dark { background: radial-gradient(120% 100% at 50% 30%, #2c2c2c, #0c0c0c) !important; }

/* ---------- two-column tiles ---------- */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.cat-tile {
  position: relative;
  aspect-ratio: 4 / 5;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}
.cat-tile .tile-label {
  position: relative;
  z-index: 2;
  padding: 18px;
  font-size: 18px;
  font-weight: 700;
}
.cat-tile .tile-label small {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: var(--text-dim);
  margin-top: 5px;
}
.cat-tile::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 100% at 60% 25%, #4a4a4a 0%, #161616 80%);
  transition: transform 0.5s ease;
}
.cat-tile:nth-child(even)::before {
  background: radial-gradient(120% 100% at 35% 30%, #3c3c3c 0%, #101010 80%);
}
.cat-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.5), transparent 45%);
}
.cat-tile:hover::before { transform: scale(1.05); }

/* ---------- projects grid ---------- */
.grid-products {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px 14px;
  padding: 8px 0 48px;
}
@media (min-width: 720px) {
  .grid-products { grid-template-columns: repeat(3, 1fr); }
}

/* filter chips */
.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 20px 0 8px;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  border: 1px solid var(--hairline);
  padding: 8px 16px;
  font-size: 12px;
  white-space: nowrap;
  color: var(--text-dim);
  border-radius: 999px;
}
.chip.on {
  background: var(--text);
  border-color: var(--text);
  color: #000;
  font-weight: 700;
}

/* ---------- statement strip ---------- */
.statement {
  border-top: 1px solid var(--hairline);
  padding: 64px 0;
  margin-top: 48px;
}
.statement .wrap { max-width: 760px; }
.statement .kicker {
  font-size: 12px;
  color: var(--text-faint);
  margin-bottom: 18px;
}
.statement p {
  font-size: clamp(22px, 4.4vw, 32px);
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.01em;
}
.statement .cta {
  display: inline-block;
  margin-top: 28px;
  border: 1px solid var(--text);
  padding: 12px 30px;
  font-size: 12px;
  border-radius: 999px;
}
.statement .cta:hover { background: var(--text); color: #000; }

/* ---------- resume ---------- */
.resume { padding-bottom: 48px; }
.resume-block { border-bottom: 1px solid var(--hairline); padding: 34px 0; }
.resume-block h3 {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-faint);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 22px;
}
.resume-item {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 18px;
  padding: 10px 0;
}
.resume-item .when {
  font-size: 12px;
  color: var(--text-faint);
  padding-top: 4px;
}
.resume-item .what strong {
  display: block;
  font-size: 16px;
  font-weight: 700;
}
.resume-item .what em {
  display: block;
  font-style: normal;
  font-size: 13px;
  color: var(--text-dim);
  margin: 3px 0 8px;
}
.resume-item .what p { font-size: 13px; color: var(--text-dim); max-width: 62ch; }
.skill-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.skill-tags span {
  border: 1px solid var(--hairline);
  padding: 8px 14px;
  font-size: 12px;
  color: var(--text-dim);
  border-radius: 999px;
}
.resume-actions { padding: 34px 0; display: flex; gap: 10px; }
.btn {
  display: inline-block;
  border: 1px solid var(--text);
  background: var(--text);
  color: #000;
  padding: 13px 30px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 999px;
}
.btn.ghost { background: transparent; color: var(--text); font-weight: 400; }
.btn:hover { opacity: 0.85; }

/* ---------- control panel ---------- */
.control { padding-bottom: 64px; }
.panel {
  border: 1px solid var(--hairline);
  background: var(--bg-raise);
  margin-top: 20px;
  border-radius: 4px;
}
.panel-head {
  border-bottom: 1px solid var(--hairline);
  padding: 16px 18px;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.panel-body { padding: 18px; }
.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-size: 11px;
  color: var(--text-faint);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.field input, .field textarea, .field select {
  width: 100%;
  border: 1px solid var(--hairline);
  background: var(--bg);
  color: var(--text);
  padding: 11px 13px;
  font-family: var(--font);
  font-size: 14px;
  border-radius: 4px;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none;
  border-color: var(--text-dim);
}
.ctl-list { list-style: none; }
.ctl-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid var(--hairline);
}
.ctl-list li:last-child { border-bottom: none; }
.ctl-list .li-name { font-size: 14px; font-weight: 700; }
.ctl-list .li-meta { font-size: 12px; color: var(--text-faint); }
.ctl-list button {
  border: 1px solid var(--hairline);
  padding: 7px 14px;
  font-size: 11px;
  color: var(--text-dim);
  border-radius: 999px;
}
.ctl-list button:hover { border-color: #ff5a5a; color: #ff5a5a; }
.notice { margin-top: 14px; font-size: 12px; color: var(--text-faint); }
.notice.ok { color: var(--text); }

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--hairline);
  margin-top: 56px;
  padding: 40px 0 56px;
}
.foot-brand {
  font-size: 19px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0.02em;
  margin-bottom: 18px;
}
.foot-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 24px;
}
.foot-fine {
  font-size: 11px;
  line-height: 1.9;
  color: var(--text-faint);
}

/* ---------- content failed to load (see mmContentError in main.js) ---------- */
body.content-failed > :not(.topbar):not(.bottomnav):not(.menu-overlay):not(.site-footer):not(.load-error) {
  display: none !important;
}
.load-error { padding: calc(var(--topbar-h) + 46px) 0 34px; border-bottom: 1px solid var(--hairline); }
.load-error h1 {
  font-size: clamp(34px, 7vw, 52px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.01em;
}
.load-error p { margin: 12px 0 26px; color: var(--text-dim); max-width: 46ch; }
