/* ── TOKENS ── */
:root {
  --bg: #f5f3ee;
  --bg2: #eceae3;
  --surface: #ffffff;
  --ink: #1a1714;
  --ink2: #4a4540;
  --ink3: #8a837a;
  --accent: #c8522a;
  --accent2: #e8784f;
  --border: rgba(26,23,20,0.10);
  --nav-h: 68px;
  --radius: 14px;
  --transition: 0.35s cubic-bezier(0.4,0,0.2,1);
}
[data-theme="dark"] {
  --bg: #131210;
  --bg2: #1d1b18;
  --surface: #252320;
  --ink: #f0ece5;
  --ink2: #b0a89e;
  --ink3: #6a635c;
  --accent: #e8784f;
  --accent2: #c8522a;
  --border: rgba(240,236,229,0.08);
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--ink);
  transition: background var(--transition), color var(--transition);
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
h1, h2, h3, h4 { font-family: 'Syne', sans-serif; }

/* ── NOISE TEXTURE ── */
body::before {
  content: '';
  position: fixed; inset: 0;
  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)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
  opacity: 0.4;
}

/* ── NAV ── */
nav {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 clamp(1.5rem, 5vw, 4rem);
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  transition: background var(--transition);
}
.nav-logo {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 1.3rem;
  letter-spacing: -0.03em;
  color: var(--accent);
}
.nav-links {
  display: flex; align-items: center; gap: 2rem;
}
.nav-links a {
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink2);
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--accent); }
.nav-right {
  display: flex; align-items: center; gap: 1rem;
}
.theme-btn {
  width: 42px; height: 24px;
  border-radius: 999px;
  background: var(--bg2);
  border: 1px solid var(--border);
  cursor: pointer;
  position: relative;
  transition: background var(--transition);
  flex-shrink: 0;
}
.theme-btn::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--accent);
  transition: transform var(--transition);
}
[data-theme="dark"] .theme-btn::after { transform: translateX(18px); }
.theme-label { font-size: 0.75rem; color: var(--ink3); letter-spacing: 0.03em; }

.hamburger {
  display: none;
  flex-direction: column; gap: 5px;
  cursor: pointer; padding: 4px;
  background: none; border: none;
}
.hamburger span {
  display: block; width: 22px; height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}
.mobile-nav {
  display: none;
  position: fixed; top: var(--nav-h); left: 0; right: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 1.5rem clamp(1.5rem, 5vw, 4rem);
  flex-direction: column; gap: 1.2rem;
  z-index: 99;
}
.mobile-nav.open { display: flex; }
.mobile-nav a {
  font-size: 1rem; font-weight: 500;
  color: var(--ink2); letter-spacing: 0.03em;
}

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  border-radius: 999px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s;
  border: none;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent2); transform: translateY(-2px); }
.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--ink);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }

/* ── FOOTER ── */
footer {
  border-top: 1px solid var(--border);
  padding: 2rem clamp(1.5rem, 7vw, 6rem);
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 1rem;
  position: relative; z-index: 1;
}
.footer-copy { font-size: 0.8rem; color: var(--ink3); }
.social-links { display: flex; gap: 0.75rem; }
.social-link {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem;
  color: var(--ink2);
  transition: border-color 0.2s, color 0.2s, transform 0.2s;
}
.social-link:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }

/* ── BACK TO TOP ── */
.back-top {
  position: fixed;
  bottom: 1.5rem; right: 1.5rem;
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
  border: none;
  z-index: 99;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
  box-shadow: 0 4px 20px color-mix(in srgb, var(--accent) 40%, transparent);
}
.back-top.visible { opacity: 1; pointer-events: all; }
.back-top:hover { transform: translateY(-3px); }

/* ── ANIMATIONS ── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.65s cubic-bezier(0.4,0,0.2,1), transform 0.65s cubic-bezier(0.4,0,0.2,1);
}
.reveal.visible { opacity: 1; transform: none; }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .nav-links { display: none; }
  .hamburger { display: flex; }
}
@media (max-width: 600px) {
  footer { flex-direction: column; text-align: center; }
}
