/* ==========================================================================
   4D Creative Studio — main.css
   Design direction: dark editorial studio. A photographer's contact sheet
   meets an architect's blueprint — hairline grids, frame-corner marks, and
   a viewfinder cursor tie the "web design + photography" brief together.
   Type: Bebas Neue (display) / DM Serif Display (editorial serif, italics
   for accents) / Space Mono (labels, numerals, utility).
   Palette: near-black ground, warm champagne-gold accent, bone-white ink.
   ========================================================================== */

:root {
  --bg: #0a0908;
  --bg-elev: #131210;
  --white: #f4efe4;
  --muted: #8c8377;
  --muted-dim: #726b60;
  --accent: #c8a96e;
  --accent-soft: rgba(200, 169, 110, 0.14);
  --accent-softer: rgba(200, 169, 110, 0.07);
  --line: rgba(244, 239, 228, 0.09);
  --line-strong: rgba(244, 239, 228, 0.4);
  --serif: 'DM Serif Display', Georgia, serif;
  --display: 'Bebas Neue', Impact, sans-serif;
  --mono: 'Space Mono', 'Courier New', monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --container: 1240px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--white);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, p { margin: 0; }
button, input, select, textarea { font-family: inherit; color: inherit; }
::selection { background: var(--accent); color: var(--bg); }

a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 3px;
}

section { position: relative; padding: 8rem 3rem; max-width: var(--container); margin: 0 auto; }
@media (max-width: 780px) { section { padding: 5rem 1.5rem; } }

/* ── Custom cursor (viewfinder signature) ── */
.cursor, .cursor-ring { position: fixed; top: 0; left: 0; pointer-events: none; z-index: 9999; transform: translate(-50%, -50%); }
.cursor {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  transition: opacity .2s;
}
.cursor-ring {
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--accent);
  opacity: .6;
  transition: width .25s var(--ease), height .25s var(--ease), opacity .25s;
}
.cursor-ring::before, .cursor-ring::after {
  content: ""; position: absolute; background: var(--accent);
}
.cursor-ring::before { top: 50%; left: -5px; width: 3px; height: 1px; transform: translateY(-50%); }
.cursor-ring::after  { top: -5px; left: 50%; width: 1px; height: 3px; transform: translateX(-50%); }
body.cursor-hover .cursor-ring { width: 56px; height: 56px; opacity: 1; }
body.no-cursor .cursor, body.no-cursor .cursor-ring { display: none; }
@media (hover: none), (pointer: coarse) { .cursor, .cursor-ring { display: none; } }

/* ── Nav ── */
.site-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 500;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.6rem 3rem;
  background: linear-gradient(to bottom, rgba(10,9,8,0.85), transparent);
  backdrop-filter: blur(6px);
}
.nav-logo, .footer-logo {
  font-family: var(--display); font-size: 1.4rem; letter-spacing: .04em;
  display: inline-flex; align-items: center; gap: .15rem;
}
.nav-logo span, .footer-logo span { color: var(--accent); }
.nav-links { display: flex; gap: 2.4rem; }
.nav-links a {
  font-size: .68rem; letter-spacing: .18em; text-transform: uppercase;
  color: var(--muted); transition: color .25s;
}
.nav-links a:hover { color: var(--white); }
.nav-cta {
  font-size: .65rem; letter-spacing: .16em; text-transform: uppercase;
  border: 1px solid var(--line-strong); padding: .7rem 1.3rem; border-radius: 999px;
  transition: border-color .25s, background .25s;
}
.nav-cta:hover { border-color: var(--accent); background: var(--accent-softer); }
@media (max-width: 780px) { .nav-links { display: none; } .site-nav { padding: 1.2rem 1.5rem; } }

/* ── Hero ── */
#hero {
  min-height: 100vh; display: flex; flex-direction: column; align-items: flex-start;
  justify-content: center; padding-top: 8rem; overflow: hidden; max-width: none;
}
.hero-bg {
  position: absolute; inset: 0; z-index: -2;
  background: radial-gradient(60% 50% at 78% 28%, rgba(200,169,110,0.16), transparent 70%),
              radial-gradient(40% 40% at 15% 85%, rgba(200,169,110,0.07), transparent 70%);
}
.hero-grid {
  position: absolute; inset: 0; z-index: -1;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(80% 70% at 60% 30%, #000 30%, transparent 85%);
          mask-image: radial-gradient(80% 70% at 60% 30%, #000 30%, transparent 85%);
}
#hero::before, #hero::after {
  content: ""; position: absolute; width: 22px; height: 22px;
  border-top: 1px solid var(--accent); border-left: 1px solid var(--accent);
  top: 6.5rem; left: 3rem; opacity: .5;
}
#hero::after { left: auto; right: 3rem; border-left: none; border-right: 1px solid var(--accent); }
@media (max-width: 780px) { #hero::before, #hero::after { display: none; } }

.hero-eyebrow {
  font-size: .7rem; letter-spacing: .2em; text-transform: uppercase; color: var(--accent);
  margin: 0 3rem 1.6rem;
}
.hero-eyebrow::before { content: "— "; }
.hero-title {
  font-family: var(--display); font-weight: 400;
  font-size: clamp(3.2rem, 9vw, 7.5rem); line-height: .92; letter-spacing: .01em;
  margin: 0 3rem; color: var(--white);
}
.hero-title .line2 { color: var(--muted-dim); }
.hero-title .accent-word {
  font-family: var(--serif); font-style: italic; font-weight: 400;
  color: var(--accent); letter-spacing: 0;
}
.hero-sub {
  max-width: 480px; margin: 2.2rem 3rem 0; color: var(--muted);
  font-size: .85rem; line-height: 1.9;
}
.hero-actions { display: flex; gap: 1rem; margin: 2.8rem 3rem 0; flex-wrap: wrap; }
.btn-primary, .btn-ghost {
  font-size: .68rem; letter-spacing: .16em; text-transform: uppercase;
  padding: 1.05rem 1.9rem; border-radius: 999px; transition: all .3s var(--ease);
}
.btn-primary { background: var(--accent); color: var(--bg); border: 1px solid var(--accent); }
.btn-primary:hover { background: transparent; color: var(--accent); }
.btn-primary span::after { content: " →"; }
.btn-ghost { border: 1px solid var(--line-strong); color: var(--white); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.hero-stat-row {
  display: flex; margin: 4.5rem 3rem 0; border-top: 1px solid var(--line); max-width: 640px;
}
.hero-stat { flex: 1; padding: 1.6rem 1.6rem 0 0; border-right: 1px solid var(--line); }
.hero-stat:last-child { border-right: none; }
.hero-stat .num { font-family: var(--display); font-size: 2.1rem; color: var(--accent); }
.hero-stat .label { font-size: .62rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-top: .3rem; }
@media (max-width: 780px) {
  .hero-eyebrow, .hero-title, .hero-sub, .hero-actions, .hero-stat-row { margin-left: 1.5rem; margin-right: 1.5rem; }
  .hero-stat-row { flex-wrap: wrap; }
}

/* ── Marquee ── */
.marquee-wrap {
  overflow: hidden; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  padding: 1.4rem 0; background: var(--bg-elev);
}
.marquee-track { display: flex; width: max-content; animation: marquee 32s linear infinite; }
.marquee-wrap:hover .marquee-track { animation-play-state: paused; }
.marquee-item {
  font-family: var(--display); font-size: 1.6rem; letter-spacing: .03em;
  color: var(--muted-dim); white-space: nowrap; padding-right: 2rem;
  display: flex; align-items: center;
}
.marquee-item .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin: 0 2rem; flex: none; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .marquee-track { animation: none; } }

/* ── Section header (shared) ── */
.section-header { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 4rem; }
.section-label {
  font-size: .68rem; letter-spacing: .2em; text-transform: uppercase; color: var(--accent);
  display: flex; align-items: center; gap: .6rem; margin-bottom: .9rem;
}
.section-label::before { content: ""; width: 22px; height: 1px; background: var(--accent); }
.section-title { font-family: var(--display); font-size: clamp(2.2rem, 5vw, 3.4rem); font-weight: 400; color: var(--white); }
.section-count {
  font-family: var(--mono); font-size: 4.5rem; color: transparent;
  -webkit-text-stroke: 1px var(--line-strong);
  line-height: 1;
}
@media (max-width: 780px) { .section-count { display: none; } }

/* ── Services ── */
.services-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.service-card {
  position: relative; background: var(--bg); padding: 3rem 2.4rem; transition: background .3s;
}
.service-card:hover { background: var(--bg-elev); }
.service-card::before, .service-card::after {
  content: ""; position: absolute; width: 14px; height: 14px; opacity: 0; transition: opacity .3s;
  border-color: var(--accent); border-style: solid;
}
.service-card::before { top: 12px; left: 12px; border-width: 1px 0 0 1px; }
.service-card::after { bottom: 12px; right: 12px; border-width: 0 1px 1px 0; }
.service-card:hover::before, .service-card:hover::after { opacity: 1; }
.service-num { font-size: .8rem; color: var(--accent); margin-bottom: 1.4rem; }
.service-name { font-family: var(--serif); font-size: 1.7rem; font-weight: 400; margin-bottom: 1rem; color: var(--white); }
.service-desc { font-family: var(--serif); font-size: 1rem; line-height: 1.75; color: var(--muted); max-width: 46ch; }
.service-tags { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.8rem; }
.tag {
  font-size: .62rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
  border: 1px solid var(--line-strong); border-radius: 999px; padding: .4rem .8rem;
}
.service-arrow {
  position: absolute; top: 2.4rem; right: 2.4rem; width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--line-strong); display: flex; align-items: center; justify-content: center;
  color: var(--muted); transition: all .3s var(--ease);
}
.service-card:hover .service-arrow { border-color: var(--accent); color: var(--accent); transform: rotate(45deg); }
@media (max-width: 780px) { .services-grid { grid-template-columns: 1fr; } }

/* ── Portfolio (bento contact-sheet grid) ── */
.portfolio-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 160px; gap: 1rem;
}
.pv-1 { grid-column: span 2; grid-row: span 3; }
.pv-2 { grid-column: span 2; grid-row: span 2; }
.pv-3 { grid-column: span 1; grid-row: span 2; }
.pv-4 { grid-column: span 1; grid-row: span 2; }
.pv-5 { grid-column: span 2; grid-row: span 2; }
.port-item { position: relative; grid-column: inherit; grid-row: inherit; overflow: hidden; background: var(--bg-elev); }
.port-item .port-visual, .port-item img, .port-item canvas { width: 100%; height: 100%; object-fit: cover; display: block; }
.port-visual { position: absolute; inset: 0; }
.port-item img { transition: transform .6s var(--ease); }
.port-item:hover img { transform: scale(1.06); }
.port-overlay {
  position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end;
  padding: 1.4rem; background: linear-gradient(to top, rgba(10,9,8,0.92) 10%, transparent 70%);
  transform: translateY(6px); opacity: 0; transition: all .35s var(--ease);
}
.port-item:hover .port-overlay { transform: translateY(0); opacity: 1; }
.port-cat { font-size: .62rem; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin-bottom: .3rem; }
.port-title { font-family: var(--serif); font-size: 1.2rem; color: var(--white); }
.port-link-overlay { position: absolute; inset: 0; z-index: 2; }
@media (max-width: 900px) {
  .portfolio-grid { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 220px; }
  .pv-1, .pv-2, .pv-3, .pv-4, .pv-5 { grid-column: span 1; grid-row: span 2; }
  .port-overlay { opacity: 1; transform: none; background: linear-gradient(to top, rgba(10,9,8,0.9), transparent 75%); }
}

/* ── Process ── */
.process-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border-top: 1px solid var(--line); }
.step { position: relative; padding: 2.6rem 1.8rem 2.2rem 0; border-right: 1px solid var(--line); }
.step:last-child { border-right: none; }
.step-num {
  font-family: var(--display); font-size: 3.2rem; color: transparent;
  -webkit-text-stroke: 1px var(--line-strong); line-height: 1; margin-bottom: 1rem;
}
.step-name { font-family: var(--serif); font-size: 1.35rem; color: var(--white); margin-bottom: .8rem; }
.step-desc { font-size: .8rem; line-height: 1.8; color: var(--muted); }
.step-bar { height: 1px; background: var(--line-strong); margin-top: 1.8rem; position: relative; overflow: hidden; }
.step-bar::after {
  content: ""; position: absolute; inset: 0; background: var(--accent);
  transform: scaleX(0); transform-origin: left; transition: transform .8s var(--ease);
}
.step.is-visible .step-bar::after { transform: scaleX(1); }
@media (max-width: 900px) {
  .process-steps { grid-template-columns: 1fr 1fr; }
  .step { border-bottom: 1px solid var(--line); padding-bottom: 2rem; }
}
@media (max-width: 560px) { .process-steps { grid-template-columns: 1fr; } }

/* ── Contact ── */
#contact { text-align: center; padding-top: 7rem; padding-bottom: 8rem; }
.contact-bg {
  position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(50% 40% at 50% 0%, rgba(200,169,110,0.1), transparent 70%);
}
.contact-big {
  font-family: var(--display); font-weight: 400; font-size: clamp(2.6rem, 8vw, 5.5rem);
  line-height: .95; color: var(--white); margin-bottom: 1.4rem;
}
.contact-sub { color: var(--muted); font-size: .85rem; max-width: 460px; margin: 0 auto 2.2rem; line-height: 1.85; }
.contact-email {
  display: inline-block; font-family: var(--serif); font-style: italic; font-size: 1.4rem;
  color: var(--accent); border-bottom: 1px solid var(--accent-soft); padding-bottom: .3rem; margin-bottom: 4rem;
  transition: border-color .25s;
}
.contact-email:hover { border-color: var(--accent); }

.contact-form { max-width: 620px; margin: 0 auto; text-align: left; border: 1px solid var(--line); padding: 2.6rem; background: var(--bg-elev); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4rem; }
.field { margin-bottom: 1.4rem; }
.field label { display: block; font-size: .62rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: .6rem; }
.field input, .field select, .field textarea {
  width: 100%; background: transparent; border: none; border-bottom: 1px solid var(--line-strong);
  padding: .7rem 0; font-family: var(--mono); font-size: .88rem; color: var(--white); border-radius: 0;
}
.field select { appearance: none; -webkit-appearance: none; }
.field textarea { min-height: 100px; resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: var(--muted); }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); }
.submit-btn {
  width: 100%; margin-top: .6rem; background: var(--accent); color: var(--bg); border: 1px solid var(--accent);
  padding: 1.1rem; font-size: .7rem; letter-spacing: .16em; text-transform: uppercase; border-radius: 999px;
  cursor: pointer; transition: all .3s var(--ease);
}
.submit-btn:hover { background: transparent; color: var(--accent); }
.submit-btn:disabled { opacity: .6; cursor: not-allowed; }
@media (max-width: 560px) { .form-row { grid-template-columns: 1fr; } .contact-form { padding: 1.6rem; } }

/* ── Footer ── */
.site-footer {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.2rem;
  padding: 2.4rem 3rem; border-top: 1px solid var(--line);
}
.footer-copy { font-size: .68rem; color: var(--muted); display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.footer-socials { display: flex; gap: .9rem; }
.social-icon {
  display: flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid var(--line-strong); color: var(--accent);
  transition: all .25s var(--ease);
}
.social-icon svg { width: 19px; height: 19px; }
.social-icon:hover, .social-icon:focus-visible {
  background: var(--accent); color: var(--bg); border-color: var(--accent);
  transform: translateY(-3px);
}
@media (max-width: 780px) { .site-footer { padding: 2rem 1.5rem; justify-content: center; text-align: center; } }

/* ── Scroll reveal ── */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.reveal.is-visible { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

/* ── Cookie settings re-open link (in footer) ── */
.cookie-manage-link {
  background: none; border: none; padding: 0; margin: 0;
  font-family: var(--mono); font-size: .68rem; color: var(--muted);
  text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
  transition: color .2s;
}
.cookie-manage-link:hover, .cookie-manage-link:focus-visible { color: var(--accent); }

/* ── Cookie consent banner ── */
.cookie-consent {
  position: fixed; left: 1.2rem; right: 1.2rem; bottom: 1.2rem; z-index: 2000;
  max-width: 760px; margin: 0 auto;
  background: var(--bg-elev); border: 1px solid var(--line-strong);
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
  transform: translateY(140%); opacity: 0;
  transition: transform .5s var(--ease), opacity .5s var(--ease);
}
.cookie-consent.is-visible { transform: translateY(0); opacity: 1; }
.cookie-consent[hidden] { display: block; visibility: hidden; pointer-events: none; }
.cookie-consent-inner { padding: 1.6rem 1.8rem; display: flex; flex-wrap: wrap; align-items: center; gap: 1.4rem; }
.cookie-consent-text { flex: 1 1 320px; font-size: .8rem; line-height: 1.7; color: var(--white); }
.cookie-consent-actions { display: flex; gap: .8rem; flex-wrap: wrap; }
.cookie-btn {
  font-family: var(--mono); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase;
  padding: .8rem 1.3rem; border-radius: 999px; cursor: pointer; white-space: nowrap;
  transition: all .25s var(--ease);
}
.cookie-btn-decline { background: transparent; color: var(--white); border: 1px solid var(--line-strong); }
.cookie-btn-decline:hover, .cookie-btn-decline:focus-visible { border-color: var(--accent); color: var(--accent); }
.cookie-btn-accept { background: var(--accent); color: var(--bg); border: 1px solid var(--accent); font-weight: 700; }
.cookie-btn-accept:hover, .cookie-btn-accept:focus-visible { background: transparent; color: var(--accent); }
@media (max-width: 560px) {
  .cookie-consent { left: .8rem; right: .8rem; bottom: .8rem; }
  .cookie-consent-inner { padding: 1.3rem; }
  .cookie-consent-actions { width: 100%; }
  .cookie-btn { flex: 1; }
}
