/* =========================================================
   Magno Tattoos
   ========================================================= */

:root {
  color-scheme: dark;
  --ink: #0f0e0d;
  --ink-2: #161412;
  --ink-3: #201d1a;
  --bone: #ece5d8;
  --bone-dim: #a69e90;
  --bone-faint: #776f64;
  --line: rgba(236, 229, 216, 0.13);
  --line-strong: rgba(236, 229, 216, 0.3);
  --red: #c9472f;

  --serif: "Instrument Serif", "Times New Roman", serif;
  --sans: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "DM Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --pad: clamp(1.25rem, 4vw, 3rem);
  --max: 1280px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}
html:has(dialog[open]) { overflow: hidden; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--bone);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Paper grain, sits behind content so photos stay clean */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; }
::selection { background: var(--red); color: var(--bone); }
:focus-visible { outline: 1px solid var(--red); outline-offset: 4px; }

.wrap { max-width: var(--max); margin: 0 auto; }
.muted { color: var(--bone-dim); }

.skip {
  position: absolute;
  left: -9999px;
  top: 1rem;
  z-index: 100;
  background: var(--bone);
  color: var(--ink);
  padding: 0.5rem 1rem;
}
.skip:focus { left: 1rem; }

/* Bracketed text that still needs real content */
.todo {
  text-decoration: underline dashed var(--red);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.25em;
}

/* ---------- Type ---------- */

.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0 0 1.25rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--bone-dim);
}
.eyebrow::before {
  content: "";
  width: 1.75rem;
  height: 1px;
  background: var(--red);
}

h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.75rem, 6.5vw, 5.25rem);
  line-height: 0.95;
  letter-spacing: -0.01em;
}
h2 em, .footer-mark em { color: var(--bone-dim); }

h3 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.85rem;
  line-height: 1.1;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 1rem 1.6rem;
  border: 1px solid var(--bone);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.25s, color 0.25s, border-color 0.25s;
}
.btn-primary { background: var(--bone); color: var(--ink); }
.btn-primary:hover { background: var(--red); border-color: var(--red); color: var(--bone); }
.btn-ghost { background: transparent; color: var(--bone); border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--bone); }
.btn:disabled { opacity: 0.5; cursor: progress; }

/* ---------- Header ---------- */

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: calc(1rem + env(safe-area-inset-top, 0px)) var(--pad) 1rem;
  border-bottom: 1px solid transparent;
  transition: background 0.3s, border-color 0.3s;
}
.site-header.scrolled {
  background: rgba(15, 14, 13, 0.86);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-color: var(--line);
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  text-decoration: none;
}
.brand-mark { font-family: var(--serif); font-size: 1.65rem; line-height: 1; }
.brand-sub {
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--bone-dim);
}

.nav { display: flex; align-items: center; gap: clamp(1rem, 2.5vw, 2.25rem); }
.nav a {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--bone-dim);
  transition: color 0.2s, background 0.25s, border-color 0.25s;
}
.nav a:hover { color: var(--bone); }
.nav .nav-cta {
  color: var(--bone);
  padding: 0.6rem 1.05rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
}
.nav .nav-cta:hover { background: var(--red); border-color: var(--red); }

@media (max-width: 720px) {
  .nav a:not(.nav-cta) { display: none; }
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  align-items: end;
  padding: 8rem var(--pad) clamp(2.5rem, 7vh, 5rem);
  overflow: hidden;
}

.hero-ornament {
  position: absolute;
  top: 50%;
  right: -6vw;
  width: min(68vw, 680px);
  translate: 0 -55%;
  color: var(--bone);
  opacity: 0.2;
  pointer-events: none;
}
.hero-ornament .spin {
  transform-box: fill-box;
  transform-origin: center;
  animation: spin 140s linear infinite;
}
@keyframes spin { to { rotate: 360deg; } }

.hero-inner { position: relative; width: 100%; }

.hero-title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(5.25rem, 19vw, 17.5rem);
  line-height: 0.8;
  letter-spacing: -0.025em;
}
.hero-title span {
  display: block;
  padding-left: 0.55em;
  font-style: italic;
  color: var(--bone-dim);
}

.hero-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem 3rem;
  margin-top: clamp(2rem, 5vh, 3.5rem);
  padding-top: 1.75rem;
  border-top: 1px solid var(--line);
}
.hero-lede {
  max-width: 24rem;
  margin: 0;
  font-size: 1.15rem;
  color: var(--bone-dim);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }

/* Load-in */
.js .hero-inner > * { animation: rise 1s var(--ease) both; }
.js .hero-inner > :nth-child(2) { animation-delay: 0.08s; }
.js .hero-inner > :nth-child(3) { animation-delay: 0.22s; }
.js .hero-ornament { animation: fade 2s ease both 0.2s; }
@keyframes rise { from { opacity: 0; transform: translateY(24px); } }
@keyframes fade { from { opacity: 0; } }

/* ---------- Sections ---------- */

.section { padding: clamp(5rem, 11vw, 9rem) var(--pad); }
.section-alt { background: var(--ink-2); border-block: 1px solid var(--line); }

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: clamp(2rem, 4vw, 3rem);
  padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--line);
}

/* ---------- Guest spots (only rendered when there are upcoming ones) ---------- */

.spots {
  padding: clamp(3.5rem, 7vw, 5.5rem) var(--pad);
  background: var(--ink-2);
  border-block: 1px solid var(--line);
}
.spots-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 2rem clamp(2.5rem, 7vw, 7rem);
  align-items: start;
}
.spots h2 { font-size: clamp(2.5rem, 5vw, 4rem); }
.spots-list { margin: 0; padding: 0; list-style: none; }
.spot {
  display: grid;
  grid-template-columns: 10rem minmax(0, 1fr);
  column-gap: 1.5rem;
  align-items: baseline;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--line);
}
.spot:first-child { padding-top: 0.35rem; }
.spot-dates {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--red);
}
.spot-city { font-family: var(--serif); font-size: 1.75rem; line-height: 1.15; }
.spot-meta { grid-column: 2; margin-top: 0.15rem; color: var(--bone-dim); font-size: 0.95rem; }

@media (max-width: 760px) {
  .spots-grid { grid-template-columns: 1fr; }
  .spot { grid-template-columns: minmax(0, 1fr); }
  .spot-meta { grid-column: 1; }
}

/* Scroll reveal (only when JS is on) */
.reveal {
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
  transition-delay: var(--delay, 0ms);
}
.js .reveal:not(.in) { opacity: 0; transform: translateY(20px); }

/* ---------- Filters ---------- */

.filters { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.filter {
  display: inline-flex;
  align-items: baseline;
  gap: 0.45rem;
  padding: 0.55rem 0.95rem;
  background: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--bone-dim);
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}
.filter:hover { color: var(--bone); border-color: var(--line-strong); }
.filter .count { font-size: 0.62rem; opacity: 0.55; }
.filter[aria-pressed="true"] { background: var(--bone); border-color: var(--bone); color: var(--ink); }

/* ---------- Gallery ---------- */

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr));
  gap: clamp(1.75rem, 3vw, 2.75rem) clamp(1rem, 2vw, 1.5rem);
  margin: 0;
  padding: 0;
  list-style: none;
}
.tile[hidden] { display: none; }

.tile-btn {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  padding: 0;
  overflow: hidden;
  background: var(--ink-2);
  border: 0;
  color: inherit;
  cursor: zoom-in;
}
.tile-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s var(--ease);
}
.tile-btn:hover img { transform: scale(1.04); }
.tile-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid transparent;
  transition: border-color 0.3s;
  pointer-events: none;
}
.tile-btn:hover::after { border-color: var(--line-strong); }

.tile-cap {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 0.8rem;
  padding-top: 0.95rem;
}
.tile-num {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--red);
  padding-top: 0.45rem;
}
.tile-title { font-family: var(--serif); font-size: 1.45rem; line-height: 1.15; }
.tile-meta {
  grid-column: 2;
  margin-top: 0.2rem;
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--bone-faint);
}

/* Placeholder shown until a real photo exists */
.ph {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 1.5rem;
  padding: 1rem;
  color: var(--bone-dim);
  background:
    radial-gradient(circle at 50% 42%, var(--ink-3), transparent 70%),
    var(--ink-2);
  border: 1px solid var(--line);
}
.ph svg { width: 44%; height: auto; opacity: 0.6; }
.ph-label {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  color: var(--bone-faint);
  text-align: center;
  word-break: break-all;
}

/* ---------- About ---------- */

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(2.5rem, 7vw, 7rem);
  align-items: center;
}
.about-photo {
  position: relative;
  aspect-ratio: 4 / 5;
  background: var(--ink-3);
  overflow: hidden;
}
.about-photo img { width: 100%; height: 100%; object-fit: cover; }
.about-copy h2 { margin-bottom: 2rem; }
.about-copy p { max-width: 36rem; margin: 0 0 1.25rem; color: var(--bone-dim); font-size: 1.1rem; }
.about-copy .btn { margin-top: 1rem; }

@media (max-width: 860px) {
  .about-grid { grid-template-columns: 1fr; }
  .about-photo { max-width: 26rem; }
}

/* ---------- Booking steps ---------- */

.steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0 0 clamp(3.5rem, 7vw, 5.5rem);
  padding: 0;
  list-style: none;
}
.step {
  padding: 0.5rem clamp(1rem, 2.5vw, 2rem) 0.5rem 0;
}
.step + .step {
  padding-left: clamp(1rem, 2.5vw, 2rem);
  border-left: 1px solid var(--line);
}
.step-num {
  display: block;
  margin-bottom: 2.5rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--red);
}
.step h3 { margin-bottom: 0.75rem; }
.step p { margin: 0; color: var(--bone-dim); font-size: 0.98rem; }

@media (max-width: 960px) {
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 3rem; }
  .step:nth-child(3) { padding-left: 0; border-left: 0; }
}
@media (max-width: 560px) {
  .steps { grid-template-columns: 1fr; row-gap: 0; }
  .step, .step + .step { padding: 1.75rem 0; border-left: 0; border-top: 1px solid var(--line); }
  .step-num { margin-bottom: 1rem; }
}

.notes {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 2rem clamp(2.5rem, 7vw, 7rem);
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}
.notes ul { margin: 0; padding: 0; list-style: none; }
.notes li {
  display: flex;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
  color: var(--bone-dim);
}
.notes li:first-child { padding-top: 0.35rem; }
.notes li::before { content: "✦"; color: var(--red); font-size: 0.7rem; padding-top: 0.35rem; }
.notes a:hover { color: var(--red); }

@media (max-width: 760px) { .notes { grid-template-columns: 1fr; } }

/* ---------- Contact ---------- */

.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(3rem, 7vw, 7rem);
  align-items: start;
}
.contact-intro h2 { margin-bottom: 1.5rem; }
.contact-intro > p { max-width: 26rem; }

.contact-list { margin: 2.5rem 0 0; }
.contact-list > div {
  display: grid;
  grid-template-columns: 7rem 1fr;
  gap: 1rem;
  padding: 0.9rem 0;
  border-top: 1px solid var(--line);
}
.contact-list > div:last-child { border-bottom: 1px solid var(--line); }
.contact-list dt {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--bone-faint);
  padding-top: 0.2rem;
}
.contact-list dd { margin: 0; }
.contact-list a { text-decoration: none; }
.contact-list a:hover { color: var(--red); }

.inquiry { display: grid; gap: 1.75rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.75rem; }
@media (max-width: 560px) { .field-row { grid-template-columns: 1fr; } }

.field { display: grid; gap: 0.5rem; }
.field > span {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--bone-dim);
}
.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 0.65rem 0;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line-strong);
  border-radius: 0;
  color: var(--bone);
  font: inherit;
  transition: border-color 0.2s;
}
.field textarea { resize: vertical; min-height: 7.5rem; line-height: 1.5; }
.field select {
  appearance: none;
  cursor: pointer;
  padding-right: 1.5rem;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8' fill='none' stroke='%23a69e90'%3E%3Cpath d='M1 1l5 5 5-5'/%3E%3C/svg%3E") no-repeat right 0.15rem center / 0.7rem;
}
.field select option { background: var(--ink-2); color: var(--bone); }
.field ::placeholder { color: var(--bone-faint); opacity: 1; }
.field input:focus,
.field select:focus,
.field textarea:focus { outline: none; border-color: var(--red); }

.check {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--bone-dim);
  cursor: pointer;
}
.check input { width: 1.1rem; height: 1.1rem; accent-color: var(--red); margin: 0; }

.form-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.75rem; }
.form-hint { margin: 0; flex: 1 1 14rem; font-size: 0.88rem; color: var(--bone-faint); }
.form-status { margin: 0; min-height: 1.5em; color: var(--bone); }
.form-status.error { color: #e8826f; }
.form-status a { color: var(--bone); }

@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; } }

/* ---------- Footer ---------- */

.site-footer { padding: clamp(4rem, 9vw, 7rem) var(--pad) 2rem; overflow: hidden; }
.footer-mark {
  margin: 0 0 2.5rem;
  font-family: var(--serif);
  font-size: clamp(3.5rem, 13vw, 11rem);
  line-height: 0.9;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.footer-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--bone-faint);
}
.footer-row a { text-decoration: none; transition: color 0.2s; }
.footer-row a:hover { color: var(--bone); }

/* ---------- Lightbox ---------- */

.lightbox {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(10, 9, 8, 0.97);
  color: var(--bone);
}
.lightbox::backdrop { background: rgba(0, 0, 0, 0.7); }
.lightbox[open] {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  animation: fade 0.25s ease both;
}

.lb-figure {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  height: 100%;
  margin: 0;
  padding: 4.5rem 0 1.5rem;
}
.lb-media { display: grid; place-items: center; min-height: 0; }
.lb-media img {
  max-width: 100%;
  max-height: calc(100dvh - 13rem);
  object-fit: contain;
}
.lb-media .ph {
  position: relative;
  inset: auto;
  width: min(100%, calc((100dvh - 13rem) * 0.8));
  aspect-ratio: 4 / 5;
}

.lb-caption {
  display: grid;
  justify-items: center;
  gap: 0.3rem;
  padding-top: 1.25rem;
  text-align: center;
}
.lb-count { font-family: var(--mono); font-size: 0.68rem; color: var(--red); letter-spacing: 0.1em; }
.lb-title { font-family: var(--serif); font-size: 1.7rem; line-height: 1.1; }
.lb-meta {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--bone-faint);
}

.lb-btn {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  margin: 0 var(--pad);
  padding: 0;
  background: none;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--bone);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.lb-btn:hover { background: var(--red); border-color: var(--red); }
.lb-btn svg { width: 1.1rem; fill: none; stroke: currentColor; stroke-width: 1.5; }
.lb-close { position: absolute; top: 1rem; right: 0; z-index: 1; }
.lightbox.single .lb-prev,
.lightbox.single .lb-next { visibility: hidden; }

@media (max-width: 640px) {
  .lb-btn { width: 2.5rem; height: 2.5rem; margin: 0 0.5rem; }
  .lb-prev, .lb-next { position: absolute; bottom: 1.25rem; z-index: 1; }
  .lb-prev { left: 0.5rem; }
  .lb-next { right: 0.5rem; }
  .lightbox[open] { grid-template-columns: minmax(0, 1fr); padding: 0 0.75rem; }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal:not(.in) { opacity: 1; transform: none; }
}
