/* ============================================================
   NAUTILUS TATTOO — design system
   ============================================================ */

:root {
  --paper: #E8E5DF;
  --paper-2: #DEDAD3;
  --paper-3: #D3CFC7;
  --ink: #0B0B0B;
  --ink-2: #1A1A1A;
  --ink-3: #3A3A38;
  --ink-4: #6B6963;
  --rule: rgba(11, 11, 11, 0.18);
  --rule-strong: rgba(11, 11, 11, 0.42);
  --accent: #B8492A;          /* dried-blood / rust accent, used sparingly */

  /* form input wells — a brighter writing surface that reads as "type here"
     regardless of which paper tone sits behind the form */
  --field-bg: #F2EFE9;
  --field-border: rgba(11, 11, 11, 0.26);

  --font-display: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-body: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --container-x: 56px;
}

/* ============ DARK THEME (inverted palette) ============ */
html[data-theme="dark"] {
  --paper: #131210;
  --paper-2: #1B1A17;
  --paper-3: #24221E;
  --ink: #ECE8E1;
  --ink-2: #DBD7CF;
  --ink-3: #B2ADA3;
  --ink-4: #807A6F;
  --rule: rgba(236, 232, 225, 0.16);
  --rule-strong: rgba(236, 232, 225, 0.40);
  --accent: #D2603F;          /* slightly brighter rust so it pops on dark */
  --field-bg: #0E0D0B;
  --field-border: rgba(236, 232, 225, 0.22);
}

html, body { transition: background-color .35s ease, color .35s ease; }

/* ============ TYPE VOICE (tweakable) ============ */
/* Editorial: high-contrast didone display */
html[data-typevoice="editorial"] {
  --font-display: "Playfair Display", Georgia, "Times New Roman", serif;
}
html[data-typevoice="editorial"] .hero-display,
html[data-typevoice="editorial"] .h-display,
html[data-typevoice="editorial"] .h-section,
html[data-typevoice="editorial"] .page-hero h1,
html[data-typevoice="editorial"] .final-cta h2,
html[data-typevoice="editorial"] .book-left h1,
html[data-typevoice="editorial"] .book-success h1,
html[data-typevoice="editorial"] .site-footer .ft-brand .wordmark {
  letter-spacing: -0.005em;
  font-weight: 800;
}

/* Condensed: tall poster / tattoo-flash grotesque */
html[data-typevoice="condensed"] {
  --font-display: "Oswald", "Helvetica Neue", Arial, sans-serif;
}
html[data-typevoice="condensed"] .hero-display,
html[data-typevoice="condensed"] .h-display,
html[data-typevoice="condensed"] .h-section,
html[data-typevoice="condensed"] .page-hero h1,
html[data-typevoice="condensed"] .final-cta h2,
html[data-typevoice="condensed"] .book-left h1,
html[data-typevoice="condensed"] .book-success h1,
html[data-typevoice="condensed"] .site-footer .ft-brand .wordmark {
  letter-spacing: 0.005em;
  font-weight: 700;
  text-transform: uppercase;
}

/* dark-theme hover overlays (near-black overlays are invisible on dark) */
html[data-theme="dark"] .style-card:hover,
html[data-theme="dark"] .upload-area:hover { background: rgba(236, 232, 225, 0.06); }

@media (max-width: 1200px) {
  :root { --container-x: 40px; }
}
@media (max-width: 1024px) {
  :root { --container-x: 32px; }
}
@media (max-width: 640px) {
  :root { --container-x: 20px; }
}

* { box-sizing: border-box; }

/* visually hidden but readable by search engines & screen readers */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* subtle paper grain */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: calc(0.45 * var(--grain, 1));
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.04  0 0 0 0 0.04  0 0 0 0 0.04  0 0 0 0.07 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* on dark, flip the grain to light specks via screen blend */
html[data-theme="dark"] body::before {
  mix-blend-mode: screen;
  opacity: calc(0.06 * var(--grain, 1));
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.92  0 0 0 0 0.90  0 0 0 0 0.85  0 0 0 0.6 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

#root { position: relative; z-index: 2; }

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

/* ----- typography utilities ----- */
.mono { font-family: var(--font-mono); font-feature-settings: "ss01"; }
.upper { text-transform: uppercase; letter-spacing: 0.08em; }
.tracker { letter-spacing: 0.14em; }
.t-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
}
.t-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
}

.h-display {
  font-family: var(--font-display);
  font-weight: 900;
  letter-spacing: -0.045em;
  line-height: 0.92;
  color: var(--ink);
}

.h-section {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(40px, 6vw, 88px);
  letter-spacing: -0.045em;
  line-height: 0.95;
  margin: 0;
}

/* ----- layout helpers ----- */
.page {
  position: relative;
  padding: 0 var(--container-x);
  min-height: 100vh;
}
.rule { height: 1px; background: var(--rule); width: 100%; }
.rule-strong { height: 1px; background: var(--rule-strong); width: 100%; }

/* ----- header ----- */
.site-header {
  display: grid;
  grid-template-columns: auto auto 1fr auto auto;
  align-items: center;
  gap: 32px;
  padding: 24px var(--container-x) 22px;
  position: relative;
  z-index: 50;
}
.site-header .logo {
  font-family: var(--font-display);
  font-weight: 900;
  letter-spacing: 0.06em;
  font-size: 14px;
  cursor: pointer;
}
.site-header .tagline {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  line-height: 1.45;
}
.site-header .tagline .tick {
  width: 1px; height: 26px; background: var(--ink); margin-top: 2px;
  flex-shrink: 0;
}
.site-header nav {
  display: flex; gap: 28px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.site-header nav a {
  position: relative; padding: 4px 0;
  transition: opacity .2s;
}
.site-header nav a:hover { opacity: 0.55; }
.site-header nav a.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px;
  height: 1px; background: var(--ink);
}
.site-header .corner-mark {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 14px;
}

/* theme toggle */
.header-right { display: flex; align-items: center; gap: 16px; }
.theme-toggle {
  width: 30px; height: 30px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--rule-strong);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  padding: 0;
  transition: border-color .2s, background .2s;
}
.theme-toggle:hover { border-color: var(--ink); }
.theme-toggle .tt-icon {
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 1px solid var(--ink);
  background: linear-gradient(90deg, var(--ink) 0 50%, transparent 50% 100%);
}
.theme-toggle.tt-block {
  width: auto; height: auto;
  border-radius: 0; border: none;
  gap: 12px;
  margin-top: 28px;
}
.theme-toggle.tt-block .tt-label {
  font-family: var(--font-mono);
  font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-3);
}

@media (max-width: 880px) {
  .site-header { grid-template-columns: auto auto 1fr auto auto; gap: 16px; }
  .site-header nav { display: none; }
  .site-header .corner-mark { display: none; }
  .site-header .tagline { min-width: 0; }
}
@media (max-width: 640px) {
  /* tagline duplicates the ticker info — drop it so MENU keeps its edge margin */
  .site-header .tagline { display: none; }
  .site-header { grid-template-columns: auto 1fr auto auto; }
}

.mobile-nav-toggle { display: none; }
@media (max-width: 880px) {
  .mobile-nav-toggle {
    display: inline-flex;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    padding: 8px 14px;
    border: 1px solid var(--ink);
  }
}

/* mobile overlay nav */
.mobile-nav {
  position: fixed; inset: 0;
  background: var(--paper);
  z-index: 100;
  padding: 24px var(--container-x);
  display: flex; flex-direction: column;
}
.mobile-nav .mn-top {
  display: flex; justify-content: space-between; align-items: center;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--rule);
}
.mobile-nav nav {
  display: flex; flex-direction: column; gap: 4px;
  margin-top: 40px;
}
.mobile-nav nav a {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(36px, 9vw, 64px);
  letter-spacing: -0.04em;
  padding: 8px 0;
  border-bottom: 1px solid var(--rule);
}

/* ----- side rail (barcode + coordinates) ----- */
.side-rail {
  position: absolute;
  right: 12px;
  top: 110px;
  bottom: 0;
  width: 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  pointer-events: none;
  color: var(--ink);
}
.side-rail .barcode {
  width: 28px;
  height: 110px;
}
.side-rail .coords {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  white-space: nowrap;
}
@media (max-width: 1180px) {
  .side-rail { display: none; }
}

/* ----- image placeholder ----- */
.ph {
  position: relative;
  overflow: hidden;
  background: #1a1a1a;
  color: rgba(255,255,255,0.45);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.ph::before {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(120% 80% at 30% 20%, rgba(255,255,255,0.06), transparent 60%),
    radial-gradient(80% 60% at 80% 90%, rgba(184,73,42,0.08), transparent 60%),
    linear-gradient(180deg, #1a1816 0%, #0d0c0b 100%);
}
.ph::after {
  content: "";
  position: absolute; inset: 0;
  opacity: 0.35;
  mix-blend-mode: screen;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.18 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
.ph .ph-tag {
  position: absolute;
  left: 10px; bottom: 10px;
  z-index: 2;
  display: flex; align-items: center; gap: 6px;
}
.ph .ph-tag::before {
  content: ""; width: 8px; height: 8px; border: 1px solid rgba(255,255,255,0.5);
  display: inline-block;
}
.ph[data-variant="light"] {
  background: #c9c5be;
  color: rgba(0,0,0,0.5);
}
.ph[data-variant="light"]::before {
  background:
    radial-gradient(120% 80% at 30% 20%, rgba(255,255,255,0.4), transparent 60%),
    linear-gradient(180deg, #d6d1c8 0%, #b8b2a6 100%);
}
.ph[data-variant="light"]::after { opacity: 0.5; }

.ph[data-portrait="1"]::before {
  background:
    radial-gradient(40% 50% at 50% 35%, rgba(60,52,46,0.9), rgba(10,10,10,1) 80%),
    linear-gradient(180deg, #2a2724 0%, #0a0a0a 100%);
}

/* fillable slot variant: drop the painted gradient so the drag-and-drop
   affordance (and the dropped photo) read cleanly on the page */
.ph.ph--slot { background: var(--paper-3); }
.ph.ph--slot::before,
.ph.ph--slot::after { display: none; }
.ph.ph--slot[data-portrait="1"]::before { display: none; }
.ph .ph-fill { display: block; width: 100%; height: 100%; }
image-slot.ph-fill::part(frame) { background: transparent; }
image-slot.ph-fill::part(ring) { border-color: var(--rule-strong); }

/* ----- buttons / cta ----- */
.btn {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 14px 22px;
  background: var(--ink);
  color: var(--paper);
  transition: background .15s, color .15s;
}
.btn:hover { background: var(--ink-3); }
.btn.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--ink);
}
.btn.ghost:hover { background: var(--ink); color: var(--paper); }

.link-arrow {
  display: inline-flex; align-items: center; gap: 14px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.link-arrow .arrow {
  width: 32px; height: 1px; background: currentColor;
  position: relative;
  transition: width .25s;
}
.link-arrow .arrow::after {
  content: ""; position: absolute; right: 0; top: -3px;
  width: 7px; height: 7px;
  border-right: 1px solid currentColor;
  border-top: 1px solid currentColor;
  transform: rotate(45deg);
}
.link-arrow:hover .arrow { width: 48px; }

/* ----- footer ----- */
.site-footer {
  margin-top: 120px;
  padding: 56px var(--container-x) 32px;
  border-top: 1px solid var(--rule);
  position: relative;
}
.site-footer .ft-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
}
@media (max-width: 900px) {
  .site-footer .ft-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) {
  .site-footer .ft-grid { grid-template-columns: 1fr; }
}
.site-footer h4 {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin: 0 0 18px;
  color: var(--ink-4);
}
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.site-footer ul a { font-size: 14px; }
.site-footer ul a:hover { opacity: 0.6; }
.site-footer .ft-brand .wordmark {
  font-family: var(--font-display);
  font-weight: 900;
  letter-spacing: -0.04em;
  font-size: clamp(40px, 5vw, 72px);
  line-height: 0.9;
  margin: 0 0 16px;
  color: var(--ink);
}
.site-footer .ft-brand p {
  max-width: 360px;
  font-size: 13.5px;
  color: var(--ink-3);
  margin: 0;
}
.site-footer .ft-bottom {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 56px; padding-top: 22px; border-top: 1px solid var(--rule);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-4);
}
.site-footer .ft-bottom > * { display: flex; gap: 18px; }
@media (max-width: 640px) {
  .site-footer .ft-bottom {
    gap: 16px;
    align-items: flex-start;
  }
  .site-footer .ft-bottom > * {
    flex-direction: column;
    gap: 4px;
  }
  .site-footer .ft-bottom > *:last-child {
    text-align: right;
    align-items: flex-end;
  }
}
@media (max-width: 430px) {
  .site-footer .ft-bottom { font-size: 9.5px; letter-spacing: 0.08em; gap: 12px; }
}
@media (max-width: 340px) {
  /* too narrow for two columns even at 9.5px — stack vertically */
  .site-footer .ft-bottom { flex-direction: column; }
  .site-footer .ft-bottom > *:last-child {
    text-align: left;
    align-items: flex-start;
  }
}

/* ----- common section heading ----- */
.section-heading {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 24px;
  margin-bottom: 32px;
}
.section-heading h2 { margin: 0; }
.section-heading .meta {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-4);
  display: flex; gap: 18px;
  align-items: center;
}

/* ----- small ticks/markers ----- */
.tick-mark {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
}

/* corner ticks (L-shaped marks around photos) */
.tick-tl, .tick-tr, .tick-bl, .tick-br {
  position: absolute; width: 14px; height: 14px;
}
.tick-tl { top: -1px; left: -1px; border-top: 1px solid var(--ink); border-left: 1px solid var(--ink); }
.tick-tr { top: -1px; right: -1px; border-top: 1px solid var(--ink); border-right: 1px solid var(--ink); }
.tick-bl { bottom: -1px; left: -1px; border-bottom: 1px solid var(--ink); border-left: 1px solid var(--ink); }
.tick-br { bottom: -1px; right: -1px; border-bottom: 1px solid var(--ink); border-right: 1px solid var(--ink); }

/* selection */
::selection { background: var(--ink); color: var(--paper); }
