/* ─── DARK THEME (default) ───────────────────────────── */
:root,
[data-theme="dark"] {
  --bg:      #0a0a0a;
  --dark:    #111111;
  --panel:   #161616;
  --border:  #252525;
  --muted:   #3a3a3a;
  --text:    #c8c0b8;
  --light:   #e8e0d6;
  --red:     #9b1c1c;
  --red-hi:  #c0392b;
  --gold:    #c9a84c;
  --gold-lo: #8b6914;
  --white:   #f5f0ea;

  --wrap:    1000px;
  --grid:    rgba(201,168,76,.06);

  --nav-bg:  rgba(10,10,10,.92);
  --card-bg: #161616;
  --tag-bg:  rgba(201,168,76,.04);

  --scrollbar-track: #111111;

  color-scheme: dark;
}

/* ─── LIGHT THEME ────────────────────────────────────── */
[data-theme="light"] {
  --bg:      #f5f0ea;
  --dark:    #ede7dc;
  --panel:   #e8e1d5;
  --border:  #d4ccc0;
  --muted:   #a09080;
  --text:    #4a3f35;
  --light:   #2a1f15;
  --red:     #8b1515;
  --red-hi:  #b02020;
  --gold:    #9a6e1a;
  --gold-lo: #7a5510;
  --white:   #1a1208;

  --nav-bg:  rgba(245,240,234,.94);
  --card-bg: #ede7dc;
  --tag-bg:  rgba(154,110,26,.07);
  --grid:    rgba(154,110,26,.08);

  --scrollbar-track: #ede7dc;

  color-scheme: light;
}

/* ─── RESET ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; overflow-x: hidden; overflow-x: clip; }
/* anchor targets land below the sticky nav */
[id] { scroll-margin-top: 4.5rem; }
@media (max-width: 600px) { [id] { scroll-margin-top: 6.5rem; } }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Jost', sans-serif;
  font-weight: 300;
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background .4s ease, color .4s ease;
}

/* ─── GRAIN OVERLAY ──────────────────────────────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1000;
  opacity: .025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
}

/* ─── SCROLLBAR ──────────────────────────────────────── */
::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-track { background: var(--scrollbar-track); }
::-webkit-scrollbar-thumb { background: var(--gold-lo); }

/* ─── UTILITY ────────────────────────────────────────── */
.container { max-width: var(--wrap); margin: 0 auto; padding: 0 clamp(1.5rem, 5vw, 4rem); }

/* ─── THIN TOP BAR ───────────────────────────────────── */
.topbar {
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--red) 0%, var(--gold) 60%, transparent 100%);
}

/* ─── NAV ────────────────────────────────────────────── */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  transition: background .4s;
}
nav .inner {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 1.1rem clamp(1.5rem, 5vw, 4rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.nav-name {
  font-family: 'Newsreader', Georgia, serif;
  font-size: 1.45rem;
  font-weight: 400;
  letter-spacing: .06em;
  color: var(--white);
  text-decoration: none;
  white-space: nowrap;
  transition: color .4s;
}
.nav-name span { color: var(--gold); }
/* logo: inline SVG, colors follow the theme */
.nav-name { display: block; line-height: 0; }
.nav-logo { display: block; height: 36px; width: auto; overflow: visible; }
.nav-logo text { font-family: 'Jost', sans-serif; }
.nav-logo .lg-ink  { fill: var(--white); transition: fill .4s; }
.nav-logo .lg-gold { fill: var(--gold); }
.nav-logo .lg-red  { fill: var(--red-hi); }
.nav-logo .lg-line { stroke: var(--gold); }

.nav-right {
  display: flex;
  align-items: center;
  gap: 1.4rem;
}
.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
  margin-left: auto;
  margin-right: 1rem;
}
.nav-ig {
  display: flex;
  color: var(--text);
  transition: color .25s;
}
.nav-ig:hover { color: var(--gold); }
.nav-ig svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
}
.nav-ig svg .dot { fill: currentColor; stroke: none; }
.nav-links a {
  font-size: .8rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text);
  text-decoration: none;
  transition: color .25s;
}
.nav-links a:hover { color: var(--gold); }

/* ─── THEME TOGGLE ───────────────────────────────────── */
.theme-toggle {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
  cursor: pointer;
}
.theme-toggle input {
  opacity: 0;
  width: 0; height: 0;
  position: absolute;
}
.toggle-track {
  position: absolute;
  inset: 0;
  border-radius: 12px;
  background: var(--border);
  border: 1px solid var(--muted);
  transition: background .35s, border-color .35s;
}
[data-theme="light"] .toggle-track {
  background: var(--gold-lo);
  border-color: var(--gold);
}
.toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--gold);
  transition: transform .35s cubic-bezier(.34,1.56,.64,1), background .35s;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  line-height: 1;
}
[data-theme="light"] .toggle-thumb {
  transform: translateX(20px);
  background: var(--white);
}
/* sun/moon icons inside thumb */
.toggle-thumb::after {
  content: '☽';
  color: var(--bg);
  opacity: .8;
}
[data-theme="light"] .toggle-thumb::after {
  content: '☀';
}

/* ─── HERO ───────────────────────────────────────────── */
#hero {
  min-height: 92vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2rem clamp(1.5rem, 5vw, 4rem) 3rem;
  max-width: var(--wrap);
  margin: 0 auto;
  position: relative;
}
#hero { isolation: isolate; }

/* full-bleed techy background: faint grid + animated node network (canvas, drawn in main.js).
   Radial mask keeps it on the right and fades it out under the text. */
.hero-bg {
  position: absolute;
  top: 0; bottom: 0;
  left: 50%;
  width: 100vw;
  transform: translateX(-50%);
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 56px 56px;
  /* two lobes: main one on the right, smaller one in the empty left margin (wide screens only) */
  --hero-mask-r: radial-gradient(ellipse 60% 75% at 78% 45%, #000 0%, rgba(0,0,0,.5) 45%, transparent 80%);
  --hero-mask-l: radial-gradient(ellipse 20% 60% at 4% 60%, rgba(0,0,0,.8) 0%, transparent 85%);
  -webkit-mask-image: var(--hero-mask-r), var(--hero-mask-l);
          mask-image: var(--hero-mask-r), var(--hero-mask-l);
}
@media (max-width: 1150px) {
  .hero-bg { -webkit-mask-image: var(--hero-mask-r); mask-image: var(--hero-mask-r); }
}
.hero-bg canvas { display: block; width: 100%; height: 100%; opacity: .75; }

#hero::before {
  content: '';
  position: absolute;
  left: clamp(1.5rem, 5vw, 4rem);
  top: 0; bottom: 0;
  width: 1px;
  background: linear-gradient(180deg, transparent 0%, var(--red) 30%, var(--gold) 70%, transparent 100%);
  opacity: .4;
}

.hero-eyebrow {
  font-size: .78rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1.8rem;
  padding-left: 2rem;
  position: relative;
}
   .hero-eyebrow::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  width: 1.2rem; height: 1px;
  background: var(--gold);
}

h1 {
  font-family: 'Newsreader', Georgia, serif;
  font-size: clamp(2.7rem, 8.5vw, 5.8rem);
  font-weight: 300;
  line-height: 1.05;
  letter-spacing: -.01em;
  color: var(--white);
  padding-left: 2rem;
  transition: color .4s;
}
/* small negative margin optically aligns the slanted italic letters with the upright lines above/below */
h1 em { font-style: italic; color: var(--red-hi); margin-left: -.03em; }

.hero-sub {
  margin-top: 2.2rem;
  padding-left: 2rem;
  font-size: 1.1rem;
  letter-spacing: .03em;
  color: var(--text);
  max-width: 540px;
  line-height: 1.45;
}

.hero-cta {
  margin-top: 3.5rem;
  padding-left: 2rem;
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  padding: .8rem 1.8rem;
  font-family: 'Jost', sans-serif;
  font-size: .78rem;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid;
  transition: background .25s, color .25s, border-color .25s;
  cursor: pointer;
}
.btn-primary { background: var(--red); border-color: var(--red); color: #f5f0ea; }
.btn-primary:hover { background: var(--red-hi); border-color: var(--red-hi); }
.btn-ghost { background: transparent; border-color: var(--muted); color: var(--text); }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); }

@keyframes pulse { 0%,100%{opacity:.4} 50%{opacity:1} }

/* ─── DIVIDER ────────────────────────────────────────── */
.divider { max-width: var(--wrap); margin: 0 auto; padding: 0 clamp(1.5rem, 5vw, 4rem); }
.divider hr {
  border: none; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-lo), var(--gold), var(--gold-lo), transparent);
  opacity: .5;
}

/* ─── SECTIONS ───────────────────────────────────────── */
section { padding: 6rem clamp(1.5rem, 5vw, 4rem); max-width: var(--wrap); margin: 0 auto; }

.section-label {
  font-size: .72rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: .8rem;
}
.section-label::after { content: ''; flex: 1; height: 1px; background: var(--border); }

h2 {
  font-family: 'Newsreader', Georgia, serif;
  font-size: clamp(1.8rem, 4.6vw, 2.8rem);
  font-weight: 300;
  color: var(--white);
  line-height: 1.15;
  text-wrap: balance;
  margin-bottom: 2.5rem;
  transition: color .4s;
}
h2 em { font-style: italic; color: var(--red-hi); }

/* ─── ABOUT ──────────────────────────────────────────── */
#about p { font-size: 1.12rem; line-height: 1.45; color: var(--text); max-width: 620px; }
#about p + p { margin-top: 1.2rem; }

.tech-stack { margin-top: 3rem; display: flex; flex-wrap: wrap; gap: .6rem; }
.tech-tag {
  font-size: .74rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: .4rem 1rem;
  border: 1px solid var(--border);
  color: var(--gold);
  background: var(--tag-bg);
  transition: border-color .2s, background .2s, color .4s, border-color .4s;
}
.tech-tag:hover { border-color: var(--gold-lo); background: rgba(201,168,76,.09); }

/* ─── SERVICES ───────────────────────────────────────── */
#services { background: var(--panel); max-width: 100%; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); transition: background .4s; }
#services .inner { max-width: var(--wrap); margin: 0 auto; padding: 6rem clamp(1.5rem, 5vw, 4rem); }

/* background: a calmer cousin of the hero network — neutral color, sparser, very slow (main.js),
   faded toward the bottom so it sits mostly behind the heading and around the cards */
#services { position: relative; isolation: isolate; overflow: hidden; }
.services-bg { position: absolute; inset: 0; z-index: -1; pointer-events: none;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, rgba(0,0,0,.6) 50%, transparent 100%);
          mask-image: linear-gradient(180deg, #000 0%, rgba(0,0,0,.6) 50%, transparent 100%);
}
.services-bg canvas { display: block; width: 100%; height: 100%; opacity: .5; }

.services-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  margin-top: 3rem;
}

/* ─── SERVICE CARD ───────────────────────────────────── */
.service-card {
  background: var(--card-bg);
  position: relative;
  overflow: hidden;
  transition: background .4s;
  display: flex;
  flex-direction: column;
}
/* photo */
.service-photo {
  width: 100%;
  height: 190px;
  object-fit: cover;
  display: block;
  filter: grayscale(40%) brightness(.75);
  transition: filter .4s ease, transform .5s ease;
}
.service-card:hover .service-photo {
  filter: grayscale(10%) brightness(.9);
  transform: scale(1.04);
}
.service-photo-wrap {
  overflow: hidden;
  position: relative;
}
/* red tint overlay on photo */
.service-photo-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, var(--card-bg) 100%);
  pointer-events: none;
  transition: background .4s;
}

.service-body { padding: 1.5rem 1.8rem 2rem; flex: 1; position: relative; }

/* left accent bar */
.service-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 2px;
  height: 100%;
  background: linear-gradient(180deg, var(--red), var(--gold));
  transform: scaleY(0);
  transform-origin: top;
  transition: transform .35s ease;
  z-index: 1;
}
.service-card:hover::before { transform: scaleY(1); }

.service-name {
  font-size: .9rem;
  letter-spacing: .08em;
  line-height: 1.35;
  text-transform: uppercase;
  color: var(--white);
  font-weight: 500;
  margin-bottom: .7rem;
  transition: color .4s;
}
.service-desc { font-size: 1rem; color: var(--white); line-height: 1.45; transition: color .25s; }
.service-card:hover .service-desc { color: var(--text); }

/* ─── CONTACT ────────────────────────────────────────── */
#contact { text-align: center; }
#contact h2 { margin-bottom: 1rem; }
#contact .sub { font-size: 1.08rem; color: var(--text); margin-bottom: 3rem; }

.contact-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  max-width: 600px;
  margin: 0 auto 3rem;
}
.contact-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .4rem;
  padding: 1.8rem 2.4rem;
  border: 1px solid var(--border);
  background: var(--panel);
  min-width: 180px;
  transition: border-color .25s, background .4s;
}
.contact-item:hover { border-color: var(--gold-lo); }
.contact-label { font-size: .68rem; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); }
.contact-value { font-size: 1.05rem; color: var(--white); transition: color .4s; }

.wa-btn {
  display: inline-flex;
  align-items: center;
  gap: .85rem;
  padding: 1rem 2.2rem;
  background: transparent;
  border: 1px solid #2d6a4f;
  color: #74c69d;
  font-size: .8rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background .25s, border-color .25s, color .25s;
}
.wa-btn:hover { background: rgba(116,198,157,.08); border-color: #74c69d; color: #b7e4c7; }
.wa-icon { width: 20px; height: 20px; fill: currentColor; flex-shrink: 0; }

/* ─── FLOATING WHATSAPP ──────────────────────────────── */
.wa-float {
  position: fixed;
  right: calc(1.5rem + env(safe-area-inset-right, 0px));
  bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px));
  z-index: 900;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #25d366;
  color: #fff;
  box-shadow: 0 6px 20px rgba(0,0,0,.35);
  transition: transform .25s ease, box-shadow .25s ease, background .25s;
}
.wa-float:hover { transform: scale(1.08); background: #1ebe5b; box-shadow: 0 8px 26px rgba(0,0,0,.45); }
.wa-float:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.wa-float svg { width: 30px; height: 30px; fill: currentColor; }

/* ─── FOOTER ─────────────────────────────────────────── */
footer { border-top: 1px solid var(--border); text-align: center; padding: 2.5rem clamp(1.5rem, 5vw, 4rem); transition: border-color .4s; }
footer p { font-size: .74rem; letter-spacing: .1em; color: var(--gold-lo); }
footer span { color: var(--gold); }
footer a { text-decoration: none; }
footer a:hover span { color: var(--white); }

/* ─── PROCESS ────────────────────────────────────────── */
#process { padding-bottom: 5rem; }
.steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2.5rem;
}
.step { border-top: 1px solid var(--border); padding-top: 1.4rem; transition: border-color .25s; }
.step:hover { border-color: var(--gold-lo); }
.step-name {
  display: block;
  font-size: .86rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--white);
  margin-bottom: .5rem;
}
.step p { font-size: 1.1rem; line-height: 1.45; color: var(--text); }

/* ─── INSTAGRAM ──────────────────────────────────────── */
.ig-intro { font-size: 1.08rem; color: var(--text); margin: -1.2rem 0 2.5rem; }
.ig-intro a { color: var(--gold); text-decoration: none; border-bottom: 1px solid var(--gold-lo); }
.ig-intro a:hover { color: var(--white); }
.ig-feed {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
  align-items: start;
}
/* .ig-item clips the embed's header strip (avatar, "View profile", follower count — 54px, fixed) */
.ig-item { overflow: hidden; border-radius: 3px; min-width: 0; }
.ig-feed .instagram-media { margin: 0 !important; min-width: 0 !important; width: 100% !important; }
.ig-feed iframe.instagram-media { margin-top: -54px !important; }
.ig-cta { margin-top: 2.5rem; text-align: center; }
.ig-icon { width: 16px; height: 16px; fill: currentColor; }

/* contact item used as a link */
a.contact-item { text-decoration: none; }

/* ─── ANIMATIONS ─────────────────────────────────────── */
@keyframes fadeUp { from{opacity:0;transform:translateY(24px)} to{opacity:1;transform:translateY(0)} }
.fade-up { animation: fadeUp .9s cubic-bezier(.22,1,.36,1) both; }
.delay-1 { animation-delay: .15s; }
.delay-2 { animation-delay: .3s; }
.delay-3 { animation-delay: .45s; }
.delay-4 { animation-delay: .6s; }

/* ─── RESPONSIVE ─────────────────────────────────────── */
/* tablet: services in 2 columns */
@media (max-width: 900px) {
  .services-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
  .services-grid, .ig-feed { grid-template-columns: minmax(0, 1fr); }
  /* nav: row 1 = name + IG + toggle, row 2 = links, all within viewport width */
  nav .inner { flex-wrap: wrap; row-gap: .7rem; padding-top: .9rem; padding-bottom: .8rem; }
  .nav-logo { height: 30px; }
  .nav-links {
    order: 3;
    flex: 0 0 100%;
    margin: 0;
    justify-content: space-between;
    gap: 1rem;
  }
  .nav-links a { font-size: .72rem; letter-spacing: .12em; }
  .contact-grid { grid-template-columns: 1fr; max-width: 320px; }
  .contact-item { min-width: 0; }
  #hero::before { display: none; }
  /* text spans the full width on phones: keep the network in the upper-right, fainter */
  .hero-bg {
    -webkit-mask-image: radial-gradient(ellipse 70% 45% at 85% 15%, #000 0%, transparent 85%);
            mask-image: radial-gradient(ellipse 70% 45% at 85% 15%, #000 0%, transparent 85%);
  }
  .hero-bg canvas { opacity: .45; }
  h1, .hero-sub, .hero-cta { padding-left: 0; }
  .service-photo { height: 130px; }
  .wa-float { width: 52px; height: 52px; right: calc(1rem + env(safe-area-inset-right, 0px)); bottom: calc(1rem + env(safe-area-inset-bottom, 0px)); }
  .wa-float svg { width: 28px; height: 28px; }
}
