/* dmlfoto.se — site styles
 * Aesthetic direction: editorial minimalism. Warm off-white paper, deep
 * espresso text, Fraunces display serif paired with Geist sans body.
 * Image-first masonry gallery. Generous negative space. Subtle motion.
 */

:root {
  --bg:        #f4f0e8;
  --bg-warm:   #ebe5d8;
  --paper:    #fbf8f1;
  --ink:       #16181d;        /* logo near-black, faintly cool */
  --ink-soft:  #3f4248;
  --muted:     #9a8f7d;        /* logo taupe */
  --hairline:  #d9d2c2;
  --accent:    #b75a3c;        /* logo terracotta, used sparingly */
  --accent-ink:#8c4128;        /* darker terracotta for text emphasis */

  --font-display: "Fraunces", "Cormorant Garamond", Georgia, serif;
  --font-body:    "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --max:   1320px;
  --gutter: clamp(20px, 4vw, 56px);
  --space-s: 12px;
  --space-m: 24px;
  --space-l: 56px;
  --space-xl: 112px;

  --radius: 2px;
  --transition: 0.4s cubic-bezier(.2,.7,.2,1);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  font-weight: 400;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }

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

/* ---------- ICONS ---------- */
.icon {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
  color: currentColor;
}
.icon path,
.icon circle,
.icon rect,
.icon line { vector-effect: non-scaling-stroke; }

/* ---------- HEADER ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition), background var(--transition);
}
.site-header.is-scrolled { border-bottom-color: var(--hairline); }

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px var(--gutter);
}

.brand {
  display: inline-flex;
  align-items: center;
  line-height: 0;
}
.brand-logo {
  height: 38px;
  width: auto;
  display: block;
  transition: opacity .25s ease;
}
.brand:hover .brand-logo { opacity: 0.72; }

.nav-links {
  list-style: none;
  display: flex;
  gap: 36px;
  margin: 0;
  padding: 0;
  font-size: 14px;
  letter-spacing: 0.04em;
}
.nav-links a {
  position: relative;
  padding: 6px 0;
  color: var(--ink-soft);
  transition: color .25s ease;
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .35s var(--transition);
}
.nav-links a:hover { color: var(--ink); }
.nav-links a:hover::after { transform: scaleX(1); }

.nav-toggle {
  display: none;
  background: none;
  border: 0;
  width: 36px;
  height: 28px;
  position: relative;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  position: absolute;
  left: 4px; right: 4px;
  height: 1.5px;
  background: var(--ink);
  transition: transform .3s, opacity .3s, top .3s;
}
.nav-toggle span:nth-child(1) { top: 8px; }
.nav-toggle span:nth-child(2) { top: 14px; }
.nav-toggle span:nth-child(3) { top: 20px; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { top: 14px; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { top: 14px; transform: rotate(-45deg); }

/* ---------- HERO ---------- */
.hero {
  position: relative;
  min-height: calc(100svh - 60px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(56px, 9vw, 104px) 0 clamp(72px, 9vw, 104px);
  overflow: hidden;
}
.hero-inner {
  position: relative;
  z-index: 2;
  width: 100%;
}
/* Viewfinder corner brackets framing the hero */
.bracket {
  position: absolute;
  color: var(--ink);
  opacity: 0;
  z-index: 2;
  pointer-events: none;
  animation: bracket-in 1.2s var(--transition) 0.9s forwards;
}
.bracket--tl { top: clamp(24px, 4vw, 56px); left:  clamp(24px, 4vw, 56px); }
.bracket--tr { top: clamp(24px, 4vw, 56px); right: clamp(24px, 4vw, 56px); }
.bracket--bl { bottom: clamp(24px, 4vw, 56px); left:  clamp(24px, 4vw, 56px); }
.bracket--br { bottom: clamp(24px, 4vw, 56px); right: clamp(24px, 4vw, 56px); }

@keyframes bracket-in {
  to { opacity: 0.28; }
}

/* Vertical index label down the right edge of the hero */
.hero-index {
  position: absolute;
  top: 50%;
  right: clamp(20px, 4vw, 52px);
  transform: translateY(-50%) rotate(180deg);
  writing-mode: vertical-rl;
  font-size: 11px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--muted);
  z-index: 2;
  opacity: 0.9;
}
.hero-index::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -28px;
  width: 1px;
  height: 64px;
  background: linear-gradient(to bottom, var(--hairline), transparent);
}

/* Scroll cue at the foot of the hero */
.hero-scroll {
  position: absolute;
  left: var(--gutter);
  bottom: clamp(28px, 5vw, 48px);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  z-index: 2;
  opacity: 0.9;
  transition: color .25s ease;
}
.hero-scroll .icon { animation: nudge 1.8s ease-in-out infinite; }
.hero-scroll:hover { color: var(--ink); }
@keyframes nudge {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(4px); }
}

/* Small crosshair on the eyebrow */
.eyebrow {
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 var(--space-m);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.eyebrow-mark { color: var(--accent); }
.hero-title {
  font-family: var(--font-display);
  font-weight: 350;
  font-size: clamp(52px, 9.5vw, 140px);
  line-height: 0.94;
  letter-spacing: -0.035em;
  margin: 0;
  font-variation-settings: "opsz" 144;
}
.hero-title .line {
  display: block;
  opacity: 0;
  transform: translateY(40px);
  animation: rise 1s var(--transition) forwards;
}
.hero-title .line:nth-child(1) { animation-delay: 0.05s; }
.hero-title .line:nth-child(2) { animation-delay: 0.20s; }
.hero-title .line:nth-child(3) { animation-delay: 0.35s; }
.hero-title em {
  font-style: italic;
  font-weight: 300;
  color: var(--accent-ink);
  font-variation-settings: "opsz" 144;
}

.hero-sub {
  font-size: clamp(16px, 1.6vw, 19px);
  color: var(--ink-soft);
  max-width: 460px;
  margin: var(--space-m) 0 var(--space-l);
  opacity: 0;
  animation: rise 1s var(--transition) 0.55s forwards;
}

.hero-meta {
  display: flex;
  align-items: center;
  gap: var(--space-l);
  opacity: 0;
  animation: rise 1s var(--transition) 0.7s forwards;
  flex-wrap: wrap;
}
.cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px 14px 26px;
  border: 1px solid var(--ink);
  border-radius: 100px;
  font-size: 14px;
  letter-spacing: 0.04em;
  color: var(--ink);
  transition: background var(--transition), color var(--transition), gap var(--transition);
}
.cta:hover { background: var(--ink); color: var(--bg); gap: 14px; }
.cta svg { transition: transform var(--transition); }
.cta:hover svg { transform: translateX(2px); }

.hero-count {
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.hero-count::before {
  content: "—";
  margin-right: 12px;
  color: var(--hairline);
}

/* Subtle paper grain + warm gradient over the hero */
.hero-grain {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background:
    url("../img/grain.png") repeat,
    radial-gradient(circle at 80% 0%, color-mix(in srgb, var(--accent) 8%, transparent), transparent 50%),
    radial-gradient(circle at 0% 100%, color-mix(in srgb, var(--bg-warm) 80%, transparent), transparent 60%);
  background-size: 128px 128px, auto, auto;
  opacity: 0.55;
  mix-blend-mode: multiply;
}

/* Body-wide paper texture, very faint */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: url("../img/paper.png");
  background-size: 256px 256px;
  opacity: 0.6;
  mix-blend-mode: multiply;
}
main, .site-footer { position: relative; z-index: 1; }

/* ---------- SECTIONS ---------- */
section.work, section.about, section.contact {
  padding: clamp(72px, 10vw, 104px) 0;
  border-top: 1px solid var(--hairline);
}

/* Editorial section break: hairline — aperture — hairline */
.strip-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: clamp(40px, 6vw, 76px) var(--gutter) 0;
  max-width: 520px;
  margin: 0 auto;
}
.brk-rule {
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--hairline) 30%, var(--hairline) 70%, transparent);
}
.brk-mark {
  color: var(--accent);
  opacity: 0.7;
  flex-shrink: 0;
}

.section-head {
  display: grid;
  grid-template-columns: max-content 1fr;
  align-items: baseline;
  gap: 24px;
  margin-bottom: var(--space-xl);
  row-gap: 8px;
}

/* Small registration mark hugging the section number */
.section-num {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 18px;
  color: var(--accent);
  letter-spacing: -0.01em;
  font-variation-settings: "opsz" 14;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.section-num::before {
  content: "";
  width: 28px;
  height: 1px;
  background: currentColor;
  opacity: 0.5;
}
.section-title {
  font-family: var(--font-display);
  font-size: clamp(40px, 6vw, 72px);
  line-height: 1;
  margin: 0;
  font-weight: 400;
  letter-spacing: -0.025em;
  font-variation-settings: "opsz" 144;
}
.section-lede {
  grid-column: 2;
  color: var(--muted);
  margin: 4px 0 0;
  max-width: 480px;
  font-size: 15px;
}

/* ---------- FILTERS ---------- */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 var(--space-l);
  padding-bottom: var(--space-m);
}
.filter {
  background: none;
  border: 1px solid var(--hairline);
  border-radius: 100px;
  padding: 8px 18px;
  font-family: inherit;
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all .25s ease;
}
.filter:hover { border-color: var(--ink-soft); color: var(--ink); }
.filter[aria-selected="true"] {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

/* ---------- GALLERY (CSS columns masonry) ---------- */
.gallery {
  column-count: 3;
  column-gap: 18px;
}
@media (max-width: 980px) { .gallery { column-count: 2; column-gap: 16px; } }
@media (max-width: 560px) { .gallery { column-count: 1; } }

.tile {
  break-inside: avoid;
  margin: 0 0 18px;
  position: relative;
  background: var(--paper);
  border-radius: var(--radius);
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .8s var(--transition), transform .8s var(--transition);
}
.tile.is-visible { opacity: 1; transform: none; }
.tile.is-hidden  { display: none; }

.tile-link {
  display: block;
  position: relative;
}

/* Contact-sheet frame number */
.tile-index {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  font-variant-numeric: tabular-nums;
  color: #f4ece0;
  padding: 3px 7px;
  background: rgba(22,24,29,0.42);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border-radius: 2px;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity .35s ease, transform .35s ease;
}
.tile-link:hover .tile-index,
.tile-link:focus-visible .tile-index { opacity: 1; transform: none; }

/* Viewfinder frame that draws in on hover */
.tile-frame {
  position: absolute;
  inset: 10px;
  z-index: 2;
  pointer-events: none;
  opacity: 0;
  transition: opacity .4s ease;
}
.tile-frame::before,
.tile-frame::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border: 1px solid rgba(244,236,224,0.85);
}
.tile-frame::before { top: 0; left: 0; border-right: 0; border-bottom: 0; }
.tile-frame::after  { bottom: 0; right: 0; border-left: 0; border-top: 0; }
.tile-link:hover .tile-frame,
.tile-link:focus-visible .tile-frame { opacity: 1; }
.tile img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 1.4s var(--transition), filter .5s ease;
  filter: contrast(1.02) saturate(1.02);
}
.tile-link:hover img { transform: scale(1.03); }

.tile-caption {
  position: absolute;
  inset: auto 0 0 0;
  padding: 60px 18px 16px;
  background: linear-gradient(to top, rgba(22,24,29,0.78), transparent);
  color: #f4ece0;
  font-size: 13px;
  letter-spacing: 0.02em;
  opacity: 0;
  transition: opacity .35s ease;
  pointer-events: none;
}
.tile-link:hover .tile-caption,
.tile-link:focus-visible .tile-caption { opacity: 1; }
.tile-caption strong {
  display: block;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: 17px;
  margin-bottom: 2px;
}
.tile-caption span {
  color: rgba(244,236,224,0.78);
}

/* On touch devices, keep captions hidden but make them readable on tap */
@media (hover: none) {
  .tile-caption { display: none; }
}

.empty {
  text-align: center;
  padding: 80px 0;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}
.empty-mark {
  color: var(--ink);
  opacity: 0.18;
  animation: aperture-spin 60s linear infinite;
}
.empty p { margin: 0; }
.text-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  border-bottom: 1px solid var(--ink);
  padding-bottom: 1px;
}

/* ---------- ABOUT ---------- */
.about-grid, .contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: clamp(40px, 8vw, 120px);
  align-items: start;
}
@media (max-width: 800px) {
  .about-grid, .contact-grid { grid-template-columns: 1fr; gap: 32px; }
  .about-grid .section-head, .contact-grid .section-head { margin-bottom: 0; }
}

.about-body, .contact-body { max-width: 60ch; }

/* About left column: heading + framed portrait */
.about-aside .section-head { margin-bottom: 28px; }
.about-portrait {
  position: relative;
  margin: 0;
  max-width: 300px;
}
.about-portrait img {
  width: 100%;
  border-radius: var(--radius);
  filter: contrast(1.02) saturate(1.02);
}
.about-portrait figcaption {
  margin-top: 12px;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}
.bracket-tick {
  position: absolute;
  width: 16px;
  height: 16px;
  z-index: 2;
  color: var(--accent);
}
.bracket-tick--tl { top: -7px;    left: -7px;    border-top: 1.5px solid currentColor; border-left: 1.5px solid currentColor; }
.bracket-tick--br { bottom: 25px; right: -7px;   border-bottom: 1.5px solid currentColor; border-right: 1.5px solid currentColor; }
@media (max-width: 800px) {
  .bracket-tick--br { bottom: 31px; }
}
.lead {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 350;
  font-size: clamp(24px, 3vw, 36px);
  line-height: 1.25;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin: 0 0 var(--space-l);
}
.about-body p { color: var(--ink-soft); margin: 0 0 1.2em; font-size: 17px; }

/* ---------- CONTACT ---------- */
.links {
  list-style: none;
  padding: 0;
  margin: 0;
  border-top: 1px solid var(--hairline);
}
.links li {
  display: grid;
  grid-template-columns: 130px 1fr;
  align-items: baseline;
  padding: 22px 0;
  border-bottom: 1px solid var(--hairline);
}
.link-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.link-label .icon { color: var(--accent); opacity: 0.85; }
.links a {
  font-family: var(--font-display);
  font-size: clamp(22px, 2.4vw, 28px);
  letter-spacing: -0.01em;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: color .25s ease, transform .25s ease;
}
.link-arrow {
  color: var(--muted);
  transition: transform .3s var(--transition), color .25s;
}
.links a:hover { color: var(--accent-ink); transform: translateX(4px); }
.links a:hover .link-arrow { color: var(--accent); transform: translate(2px, -2px); }

/* ---------- FOOTER ---------- */
.site-footer {
  border-top: 1px solid var(--hairline);
  padding: 32px 0;
  background: var(--bg-warm);
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--muted);
  gap: 20px;
  flex-wrap: wrap;
}
.footer-logo { line-height: 0; }
.footer-logo img {
  height: 52px;
  width: auto;
  display: block;
  opacity: 0.92;
  transition: opacity .25s ease;
}
.footer-logo:hover img { opacity: 1; }
.footer-copy {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--ink-soft);
}
.footer-admin {
  color: var(--muted);
  border-bottom: 1px solid transparent;
  transition: color .25s, border-color .25s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.footer-admin:hover { color: var(--ink); border-bottom-color: var(--ink); }

/* ---------- LIGHTBOX ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(22, 24, 29, 0.96);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 32px;
  opacity: 0;
  transition: opacity .35s ease;
}
.lightbox.is-open { display: flex; opacity: 1; }
.lb-figure {
  margin: 0;
  max-width: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.lb-img {
  max-width: min(94vw, 1600px);
  max-height: 86vh;
  object-fit: contain;
  box-shadow: 0 30px 80px rgba(0,0,0,.5);
  background: #0c0d11;
}
.lb-caption {
  color: rgba(244, 236, 224, 0.82);
  font-size: 13px;
  letter-spacing: 0.03em;
  margin-top: 18px;
  text-align: center;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 15px;
  max-width: 600px;
}
.lb-close, .lb-prev, .lb-next {
  position: absolute;
  background: none;
  border: 0;
  color: rgba(244, 236, 224, 0.7);
  cursor: pointer;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: color .25s, transform .25s, background .25s;
}
.lb-close:hover, .lb-prev:hover, .lb-next:hover {
  color: #fff;
  background: rgba(255,255,255,0.06);
}
.lb-close { top: 16px; right: 20px; }
.lb-prev  { left: 12px;  top: 50%; transform: translateY(-50%); }
.lb-next  { right: 12px; top: 50%; transform: translateY(-50%); }
.lb-prev:hover { transform: translateY(-50%) translateX(-3px); }
.lb-next:hover { transform: translateY(-50%) translateX(3px); }

/* ---------- ANIMATIONS ---------- */
@keyframes rise {
  to { opacity: 1; transform: none; }
}
@keyframes aperture-spin {
  to { transform: rotate(360deg); }
}
@keyframes fade-in {
  to { opacity: 1; }
}

/* ---------- MOBILE ---------- */
@media (max-width: 720px) {
  /* Drop the frosted-glass effect on mobile: a backdrop-filter ancestor
     makes the dropdown render translucent and swallows taps on iOS. */
  .site-header {
    background: var(--bg);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--paper);
    border-top: 1px solid var(--hairline);
    border-bottom: 1px solid var(--hairline);
    box-shadow: 0 16px 30px -12px rgba(22,24,29,0.28);
    flex-direction: column;
    gap: 0;
    padding: 4px 0 12px;
    z-index: 60;
    pointer-events: auto;
  }
  .nav-links.is-open { display: flex; }
  .nav-links li { padding: 0 var(--gutter); }
  .nav-links a {
    display: block;
    padding: 16px 2px;
    font-size: 17px;
    color: var(--ink);
    border-bottom: 1px solid var(--hairline);
  }
  .nav-links a::after { display: none; }
  .nav-links li:last-child a { border-bottom: 0; }
  .nav-toggle { display: block; }

  .hero-index { display: none; }

  .lb-close { top: 8px; right: 8px; }
  .lb-prev, .lb-next { width: 44px; height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .hero-title .line, .hero-sub, .hero-meta, .hero-index, .hero-scroll { opacity: 1; transform: none; }
  .hero-index { transform: translateY(-50%) rotate(180deg); }
  .bracket { opacity: 0.28; }
  .empty-mark { animation: none; }
  .hero-scroll .icon { animation: none; }
}
