/* ==========================================================================
   Darkroom — a photography theme for LinkStack
   Dark-only, editorial type, viewfinder frame, film grain, amber safelight,
   and a layered parallax photo background.

   ┌─ SIZE KNOB ─────────────────────────────────────────────────────────┐
   │  Change --size below. 1 = default, 1.25 = everything 25% bigger,    │
   │  1.5 = 50% bigger. Text, buttons, icons and avatar all follow it.   │
   └─────────────────────────────────────────────────────────────────────┘
   ========================================================================== */

/* Table of contents
––––––––––––––––––––––––––––––––––––––––––––––––––
- Tokens & size knob
- Layout
- Background (parallax photo, scrim, grain, viewfinder frame)
- Typography
- Links & misc
- Credit footer
*/


/* Tokens & size knob
–––––––––––––––––––––––––––––––––––––––––––––––––– */
:root {
  --size: 0.65;                       /* <<< YOUR SIZE KNOB — try 1.25, 1.5 ... */
  --auto: 1;                       /* grows automatically on big monitors (below) */
  --scale: calc(var(--size) * var(--auto));
  --button-scale: var(--scale);

  --ink: #f4efe6;                  /* warm paper white */
  --ink-soft: rgba(244, 239, 230, .9);
  --ink-faint: rgba(244, 239, 230, .7);
  --line: rgba(244, 239, 230, .22);
  --glass: rgba(14, 13, 12, .52);
  --glass-strong: rgba(14, 13, 12, .74);
  --accent: #f2b632;               /* safelight amber */

  --font-display: "Cormorant Garamond", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --font-mono: "IBM Plex Mono", "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}

/* Big monitors: scale everything up so it doesn't look small on a 27" / 4K screen */
@media (min-width: 1800px) { :root { --auto: 1.3; } }
@media (min-width: 2400px) { :root { --auto: 1.7; } }
@media (min-width: 3200px) { :root { --auto: 2.2; } }

/* Mobile scaling */
@media (max-width: 549px) {
  :root {
    --size: 1.1;
    --auto: 0.8;
    --button-scale: calc(var(--scale) * 0.80);
  }
}


/* Layout
–––––––––––––––––––––––––––––––––––––––––––––––––– */
.container {
  position: relative;
  z-index: 3;
  width: 100%;
  max-width: calc(580px * var(--scale));
  text-align: center;
  margin: 0 auto;
  padding: 36px 20px 0;
  box-sizing: border-box; }
.column {
  width: 100%;
  box-sizing: border-box; }

@media (min-width: 400px) { .container { width: 100%; padding: 36px 20px 0; } }
@media (min-width: 550px) { .container { width: 100%; } }


/* Background
–––––––––––––––––––––––––––––––––––––––––––––––––– */
html { font-size: 100%; }

body {
  font-family: var(--font-mono);
  font-size: calc(20px * var(--scale));
  line-height: 1.6;
  font-weight: 500;
  color: var(--ink);
  background-color: #0c0b0a;               /* shown if the user has no photo */
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  min-height: 100vh;
  margin: 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* LAYER 1 — the photo, as its own element so it can move (parallax).
   LinkStack sets the user's background photo on <body>; "inherit" lets this
   layer pick up that exact image. It is oversized so it can shift without
   ever showing an edge. Three independent motion channels:
     translate  → scroll parallax
     scale      → slow ambient "breathing" drift
     transform  → mouse parallax (set by extra/custom-body-end.blade.php)   */
body::before {
  content: "";
  position: fixed;
  inset: -16% -6%;
  z-index: 0;
  pointer-events: none;
  background-image: inherit;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  will-change: transform, translate, scale;
  translate: 0 0;
  scale: 1.04;
  transform: translate3d(var(--dr-mx, 0px), var(--dr-my, 0px), 0);
  animation: dr-drift 40s ease-in-out infinite alternate;
}

@keyframes dr-drift { from { scale: 1.04; } to { scale: 1.13; } }

/* Scroll parallax: pure CSS where the browser supports scroll-driven animations */
@supports (animation-timeline: scroll()) {
  body::before {
    animation-name: dr-scroll, dr-drift;
    animation-duration: 1ms, 40s;
    animation-timing-function: linear, ease-in-out;
    animation-iteration-count: 1, infinite;
    animation-direction: normal, alternate;
    animation-fill-mode: both, none;
    animation-timeline: scroll(root), auto;
  }
  @keyframes dr-scroll {
    from { translate: 0 6vh; }
    to   { translate: 0 -6vh; }
  }
}
/* Everywhere else the small script in custom-body-end sets --dr-scroll (0 → 1) */
@supports not (animation-timeline: scroll()) {
  body::before { translate: 0 calc((var(--dr-scroll, .5) - .5) * -12vh); }
}

/* LAYER 2 — scrim: darkens + softly blurs the photo so text stays readable on any image */
html::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 42%, rgba(10, 9, 8, .3) 0%, rgba(10, 9, 8, .5) 55%, rgba(10, 9, 8, .78) 100%),
    linear-gradient(to bottom, rgba(10, 9, 8, .12), rgba(10, 9, 8, .3));
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
}

/* LAYER 3 — film grain (own element so it never blocks clicks) */
html::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 .14 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* LAYER 4 — viewfinder frame (hairline + corner brackets), above everything */
body::after {
  content: "";
  position: fixed;
  inset: 14px;
  z-index: 4;
  pointer-events: none;
  border: 1px solid rgba(244, 239, 230, .1);
  --b: 22px;                               /* bracket length */
  --t: 1.5px;                              /* bracket thickness */
  --c: rgba(244, 239, 230, .7);
  background:
    linear-gradient(var(--c), var(--c)) top left     / var(--b) var(--t) no-repeat,
    linear-gradient(var(--c), var(--c)) top left     / var(--t) var(--b) no-repeat,
    linear-gradient(var(--c), var(--c)) top right    / var(--b) var(--t) no-repeat,
    linear-gradient(var(--c), var(--c)) top right    / var(--t) var(--b) no-repeat,
    linear-gradient(var(--c), var(--c)) bottom left  / var(--b) var(--t) no-repeat,
    linear-gradient(var(--c), var(--c)) bottom left  / var(--t) var(--b) no-repeat,
    linear-gradient(var(--c), var(--c)) bottom right / var(--b) var(--t) no-repeat,
    linear-gradient(var(--c), var(--c)) bottom right / var(--t) var(--b) no-repeat;
}

@media (max-width: 549px) {
  body::after { inset: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  body::before { animation: none !important; translate: 0 0; scale: 1.04; transform: none; }
}


/* Typography
–––––––––––––––––––––––––––––––––––––––––––––––––– */
/* Name — forced with !important so nothing else on the page (custom CSS in the
   LinkStack admin, inline styles, other stylesheets) can shrink or thin it out. */
h1, h1 *, .container h1, .column h1, .container h1 *, .column h1 * {
  font-family: var(--font-display) !important;
  font-weight: 700 !important;
  letter-spacing: .01em !important;
}
h1 *, .container h1 *, .column h1 * {
  font-size: inherit !important;
  line-height: inherit !important;
}
h1, .container h1, .column h1 {
  margin-top: 22px;
  margin-bottom: 6px;
  font-size: calc(56px * var(--scale)) !important;
  line-height: 1.05 !important;
  color: var(--ink);
  text-wrap: balance;
  text-shadow: 0 2px 24px rgba(0, 0, 0, .55);
}
@media (min-width: 550px) {
  h1, .container h1, .column h1 {
    font-size: calc(76px * var(--scale)) !important;
    line-height: 1.05 !important;
    /* let the name run wider than the button column so it stays on one line */
    margin-left: calc(-90px * var(--scale));
    margin-right: calc(-90px * var(--scale));
  }
}
@media (max-width: 549px) {
  h1, .container h1, .column h1 { font-size: calc(44px * var(--scale)) !important; }
}
/* little amber tick under the name */
h1::after {
  content: "";
  display: block;
  width: calc(48px * var(--scale));
  height: 3px;
  margin: 18px auto 0;
  background: var(--accent);
}

/* Bio line */
p {
  margin: 14px auto 28px;
  max-width: calc(480px * var(--scale));
  font-size: calc(19px * var(--scale));
  font-weight: 500;
  line-height: 1.6;
  letter-spacing: .01em;
  color: var(--ink-soft);
  text-shadow: 0 1px 12px rgba(0, 0, 0, .6);
}
p b, p strong { color: #fff; font-weight: 700; }

/* Section headings ("Contact", "Socials") – EXIF-style labels with hairlines */
h2, h3, h4 {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 40px 0 18px;
  font-family: var(--font-mono);
  font-size: calc(18px * var(--scale));
  font-weight: 700;
  line-height: 1;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
h2::before, h2::after,
h3::before, h3::after,
h4::before, h4::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(244, 239, 230, .35);
}


/* Links & misc
–––––––––––––––––––––––––––––––––––––––––––––––––– */
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent); }

.spacing { padding: 0 10px; }

.social-icon { color: var(--ink); opacity: .85; transition: color .2s, opacity .2s; }
.social-icon:hover { color: var(--accent); opacity: 1; }

code {
  padding: .2rem .5rem;
  margin: 0 .2rem;
  font-size: 90%;
  white-space: nowrap;
  background: rgba(244, 239, 230, .08);
  border: 1px solid var(--line);
  border-radius: 2px; }
pre > code { display: block; padding: 1rem 1.5rem; white-space: pre; }

button, .button { margin-bottom: 12px; }
input, textarea, select, fieldset { margin-bottom: 1.5rem; }
pre, blockquote, dl, figure, ol { margin-bottom: 2.5rem; }

.u-full-width { width: 100%; box-sizing: border-box; }
.u-max-full-width { max-width: 100%; box-sizing: border-box; }
.u-pull-right { float: right; }
.u-pull-left { float: left; }

hr {
  margin: 2rem 0;
  border: 0;
  border-top: 1px solid var(--line); }

* { scrollbar-width: thin; scrollbar-color: #3a3631 transparent; }
*::-webkit-scrollbar { width: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background-color: #3a3631; border-radius: 30px; }

::selection { background: var(--accent); color: #0c0b0a; }


/* Credit footer
–––––––––––––––––––––––––––––––––––––––––––––––––– */
.credit-txt {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: calc(14px * var(--scale));
  letter-spacing: .12em;
  text-transform: uppercase;
  text-decoration: none;
}
.credit-txt-clr { color: var(--ink-faint) !important; }
.credit-hover:hover .credit-txt-clr { color: var(--ink) !important; }
