/* ---------- Reset, page shell, header/logo/nav, footer ---------- */

:root {
  --ink: #111111;
  --ink-soft: #6b6b6b;
  --hairline: rgba(17, 17, 17, 0.14);
  --bg: #ffffff;
}

* { box-sizing: border-box; }

/* Without !important, any element that also gets `display` from a class
   (e.g. .gate-overlay's `display: flex`) would silently ignore the
   `hidden` attribute — author rules beat the browser's own [hidden]
   rule on a specificity tie. This is why the gate wasn't dismissing. */
[hidden] {
  display: none !important;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', -apple-system, 'Helvetica Neue', Arial, sans-serif;
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

.wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 32px;
}

/* ---------- Header / logo / nav ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--hairline);
  transition: opacity 0.4s ease;
}

.site-header .wrap {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  height: 52px;
}

.logo-link {
  display: flex;
  align-items: center;
  justify-self: start;
}

.logo-link img {
  display: block;
  height: 24px;
  width: auto;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-self: end;
  gap: 10px;
}

.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  background: none;
  border: none;
  color: var(--ink-soft);
  cursor: pointer;
  transition: color 0.15s ease;
}

.icon-btn:hover {
  color: var(--ink);
}

.icon-btn svg {
  width: 16px;
  height: 16px;
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  background: none;
  border: none;
  color: var(--ink);
  cursor: pointer;
}

.nav-toggle svg {
  width: 18px;
  height: 18px;
}

.site-nav {
  display: flex;
  align-items: center;
  justify-self: center;
  gap: 28px;
  flex-wrap: wrap;
}

.site-nav a {
  font-size: 11.5px;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink-soft);
  transition: color 0.15s ease;
  white-space: nowrap;
}

.site-nav a:hover {
  color: var(--ink);
}

.site-nav a.is-current {
  color: var(--ink);
  font-weight: 500;
}

@media (max-width: 640px) {
  .wrap { padding: 0 20px; }

  .site-header .wrap {
    height: 48px;
  }

  .nav-toggle {
    display: flex;
  }

  .site-nav {
    position: fixed;
    top: 48px;
    left: 0;
    right: 0;
    z-index: 19;
    flex-direction: column;
    align-items: stretch;
    justify-self: auto;
    gap: 0;
    background: #ffffff;
    border-bottom: 1px solid var(--hairline);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }

  .site-nav.is-open {
    max-height: 260px;
  }

  .site-nav a {
    padding: 15px 20px;
    border-top: 1px solid var(--hairline);
    text-align: center;
  }
}

/* ---------- Page shell ---------- */

.page-main {
  min-height: calc(100vh - 52px - 140px);
}

@media (max-width: 640px) {
  .page-main {
    min-height: calc(100vh - 48px - 140px);
  }
}

/* ---------- Start / reveal animation ---------- */

@keyframes reveal-up {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes reveal-down {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.reveal {
  animation: reveal-up 0.5s ease both;
}

/* index.html only: header/main/footer stay invisible (but still laid
   out, so their positions/sizes are measurable) until the intro logo
   animation finishes and js/portfolio-gate.js removes this class. */
.page-main,
.site-footer {
  transition: opacity 0.4s ease;
}

body.pre-reveal .site-header,
body.pre-reveal .page-main,
body.pre-reveal .site-footer {
  opacity: 0;
  pointer-events: none;
}

/* ---------- Shared section headings ---------- */

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 32px;
}

.section-head h1,
.section-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--hairline);
  margin-top: 80px;
}

.site-footer .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 24px;
  padding-bottom: 24px;
  font-size: 12px;
  color: var(--ink-soft);
}

.footer-links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.footer-links a {
  text-decoration: none;
  color: var(--ink-soft);
  transition: color 0.15s ease;
}

.footer-links a:hover {
  color: var(--ink);
}
