/* =========================================================
   Desentrelizd — bold & minimal
   Plain CSS, no external fonts or dependencies.
   ========================================================= */

:root {
  /* Brand accent — same in BOTH themes; change here to recolor the whole site */
  --accent:     #8e30eb;   /* nostr purple — solid fills (buttons, dots) */
  --accent-ink: #ffffff;   /* text/icon sitting ON the purple accent */

  /* Layout (theme-independent) */
  --maxw: 72rem;
  --pad: clamp(1.25rem, 4vw, 2.5rem);
  --space-section: clamp(4rem, 10vw, 8rem);
  --radius: 14px;

  /* Type */
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
          "Apple Color Emoji", "Segoe UI Emoji", sans-serif;

  /* ---- LIGHT theme surfaces (default) ---- */
  --bg:        #ffffff;
  --bg-alt:    #f5f5f3;
  --ink:       #0f0f0f;
  --ink-soft:  #5b5b55;
  --line:      #e5e5e1;
  --accent-fg: #7c22d4;                 /* accent as TEXT — readable purple on light */
  --header-bg: rgba(255, 255, 255, 0.8);
}

/* ---- DARK surfaces ---- */
/* System preference (only when the user hasn't made an explicit choice) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg:        #0a0a0a;
    --bg-alt:    #121212;
    --ink:       #f4f4f0;
    --ink-soft:  #a3a39d;
    --line:      #262626;
    --accent-fg: #b07cf0;               /* lighter purple reads well on near-black */
    --header-bg: rgba(10, 10, 10, 0.8);
  }
}
/* Explicit user choice via the toggle */
:root[data-theme="dark"] {
  --bg:        #0a0a0a;
  --bg-alt:    #121212;
  --ink:       #f4f4f0;
  --ink-soft:  #a3a39d;
  --line:      #262626;
  --accent-fg: #b07cf0;
  --header-bg: rgba(10, 10, 10, 0.8);
}

/* ---------- Reset-ish ---------- */
*, *::before, *::after { box-sizing: border-box; }

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 { line-height: 1.05; margin: 0; letter-spacing: -0.02em; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
em { color: var(--ink-soft); font-style: italic; }

.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--pad);
}

/* Accessibility helpers */
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 0.6rem 1rem;
  border-radius: 0 0 var(--radius) 0;
  z-index: 100;
  font-weight: 700;
}
.skip-link:focus { left: 0; }

:focus-visible {
  outline: 3px solid var(--accent-fg);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4.5rem;
}
.wordmark {
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.03em;
}
.wordmark .dot { color: var(--accent-fg); }
.wordmark-sm { font-size: 1.1rem; }

.primary-nav {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2.5vw, 2rem);
}
.primary-nav a {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink-soft);
  transition: color 0.15s ease;
}
.primary-nav a:hover { color: var(--ink); }

.nav-cta {
  color: var(--accent-fg) !important;
  border: 1px solid var(--line);
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
}
.nav-cta:hover { border-color: var(--accent-fg); }

/* Right-side header controls */
.header-right {
  display: flex;
  align-items: center;
  gap: clamp(0.75rem, 2vw, 1.5rem);
}

/* Theme toggle */
.theme-toggle {
  display: none; /* shown only when JS is available */
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 2.4rem;
  flex: none;
  background: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.js .theme-toggle { display: inline-flex; }
.theme-toggle:hover { color: var(--accent-fg); border-color: var(--accent-fg); }
.theme-toggle svg { width: 18px; height: 18px; }

/* Show the icon for the theme you'd switch TO: moon in light, sun in dark */
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* Hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: 0;
  padding: 0.5rem;
  cursor: pointer;
}
.nav-toggle-bar {
  width: 26px;
  height: 2px;
  background: var(--ink);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  font-weight: 700;
  padding: 0.85rem 1.5rem;
  border-radius: 999px;
  transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
}
.btn-primary:hover { background: #a14ef0; }
.btn-ghost {
  border: 1px solid var(--line);
  color: var(--ink);
}
.btn-ghost:hover { border-color: var(--ink-soft); }
.btn-lg { padding: 1.1rem 2rem; font-size: 1.15rem; }

/* ---------- Hero ---------- */
.hero {
  padding-block: clamp(5rem, 14vw, 9rem) var(--space-section);
  border-bottom: 1px solid var(--line);
}
.eyebrow {
  color: var(--accent-fg);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.8rem;
  margin-bottom: 1.5rem;
}
.hero-title {
  font-size: clamp(2.75rem, 11vw, 7rem);
  font-weight: 800;
}
.hero-title .accent { color: var(--accent-fg); }
.hero-sub {
  margin-top: 1.5rem;
  max-width: 38ch;
  font-size: clamp(1.1rem, 2.5vw, 1.4rem);
  color: var(--ink-soft);
}
.hero-actions {
  margin-top: 2.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

/* ---------- Sections ---------- */
.section { padding-block: var(--space-section); }
.section-alt { background: var(--bg-alt); }
.section-title {
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  font-weight: 800;
  margin-bottom: 2.5rem;
  display: flex;
  align-items: baseline;
  gap: 1rem;
}
.section-title .num {
  font-size: 0.9rem;
  color: var(--accent-fg);
  font-weight: 700;
  letter-spacing: 0.1em;
}

/* Grids */
.grid { display: grid; gap: 1.25rem; }
.grid-services { grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); }
.grid-work { grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); }

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.75rem;
  background: var(--bg);
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.card:hover { border-color: var(--accent-fg); transform: translateY(-3px); }
.card h3 { font-size: 1.25rem; margin-bottom: 0.6rem; }
.card p { color: var(--ink-soft); }

/* Work */
.work-item {
  border-top: 2px solid var(--accent-fg);
  padding-top: 1.25rem;
}
.work-domain {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-fg);
  margin-bottom: 0.75rem;
}
.work-item h3 { font-size: 1.2rem; margin-bottom: 0.6rem; }
/* Dropshot brand lockup (mark + wordmark) */
.dropshot-lockup {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.dropshot-mark {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  transform: translateY(-1px);
}
.piggy-mark {
  width: 40px;
  height: 40px;
  margin: -9px;
}
.dropshot-word {
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1;
}

/* "Coming soon"-style badge */
.badge {
  display: inline-block;
  vertical-align: middle;
  margin-left: 0.5rem;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
}
.work-item p { color: var(--ink-soft); }

/* About */
.about-grid { display: grid; gap: 2rem; }
.about-photo {
  width: 100%;
  max-width: 20rem;
  aspect-ratio: 1 / 1;     /* the wrapper holds the square; the grid can't stretch it into an oval */
  align-self: start;       /* don't stretch to the height of the text column */
}
.about-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  border: 1px solid var(--line);
}
.about-body { max-width: 60ch; display: grid; gap: 1.25rem; }
.lead { font-size: clamp(1.3rem, 3vw, 1.7rem); font-weight: 700; }
.about-body p { color: var(--ink-soft); }
.legal-note { font-size: 0.95rem; }

@media (min-width: 800px) {
  .about-grid {
    grid-template-columns: minmax(14rem, 20rem) 1fr;
    align-items: start;
    column-gap: 3rem;
  }
  /* Title spans the full width above the photo + text */
  .about-grid .section-title { grid-column: 1 / -1; margin-bottom: 0; }
}

/* Stack */
.stack-intro { color: var(--ink-soft); margin-bottom: 1.75rem; max-width: 50ch; }
.pill-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.pill-list li {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.55rem 1.1rem;
  font-weight: 600;
  font-size: 0.95rem;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.pill-list li:hover { border-color: var(--accent-fg); color: var(--accent-fg); }

/* ---------- Contact ---------- */
.contact {
  padding-block: var(--space-section);
  border-top: 1px solid var(--line);
  text-align: center;
}
.contact-title { font-size: clamp(2rem, 7vw, 4rem); font-weight: 800; }
.contact-sub { margin-top: 1rem; color: var(--ink-soft); font-size: 1.15rem; }
.contact-inner { display: grid; justify-items: center; gap: 2rem; }
.contact-links { margin: 0; }

/* Social links (contact + footer) */
.social-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--ink-soft);
  font-weight: 600;
  transition: color 0.15s ease;
}
.social-link:hover { color: var(--accent-fg); }
.social-link svg { width: 20px; height: 20px; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding-block: 2.5rem;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.footer-legal { color: var(--ink-soft); font-size: 0.9rem; }

/* ---------- Mobile nav ---------- */
@media (max-width: 720px) {
  .nav-toggle { display: flex; }

  .primary-nav {
    position: fixed;
    inset: 4.5rem 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--line);
    padding: 0.5rem var(--pad) 1.5rem;
    transform: translateY(-120%);
    transition: transform 0.25s ease;
    box-shadow: 0 24px 40px rgba(0, 0, 0, 0.5);
  }
  .primary-nav.open { transform: translateY(0); }

  .primary-nav a {
    padding: 1rem 0;
    border-bottom: 1px solid var(--line);
    font-size: 1.1rem;
  }
  .nav-cta {
    margin-top: 1rem;
    text-align: center;
    border: 1px solid var(--accent);
  }

  /* Animate hamburger into an X when open */
  .nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }
}
