/* =========================================================
   anchor point studio — base (shared across public pages)
   ========================================================= */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

@font-face {
  font-family: 'Söhne';
  src: url('../fonts/soehne/soehne-300.otf') format('opentype');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Söhne';
  src: url('../fonts/soehne/soehne-400.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Söhne';
  src: url('../fonts/soehne/soehne-500.otf') format('opentype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Söhne';
  src: url('../fonts/soehne/soehne-600.otf') format('opentype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --color-bg:       #0a0a0a;
  --color-surface:  #161616;
  --color-text:     #FCF7F1;
  --color-muted:    #6b6b6b;
  --color-accent:   #C56A2D;
  --color-rule:     #252525;
  --page-inset:     32px;
}

.grain-overlay {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  background-image: url('../assets/images/pattern.png');
  background-repeat: repeat;
  background-size: auto;
  mix-blend-mode: hard-light;
  opacity: 0.15;
  pointer-events: none;
  z-index: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: 'Söhne', sans-serif;
  font-weight: 400;
  font-size: 1.6vh;
  line-height: 1.5;
  text-transform: lowercase;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img,
video {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  text-transform: lowercase;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

input,
textarea {
  font-family: inherit;
  text-transform: lowercase;
}

::placeholder {
  text-transform: lowercase;
}

/* =========================================================
   page wrapper — 16:9 viewport constraint
   ========================================================= */

.page-wrapper {
  width: min(100%, 233.33vh);
  margin: 0 auto;
  padding: 0 var(--page-inset);
  position: relative;
}

/* =========================================================
   utilities
   ========================================================= */

.section-label-wrapper {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  margin: 0;
  padding: 0;
  align-self: flex-start;
}
.section-label {
  font-size: 1.2vh;
  letter-spacing: 0.1em;
  color: var(--color-text);
  white-space: nowrap;
  font-weight: 300;
}
.section-rule {
  flex: 1;
  height: 1px;
  background: var(--color-rule);
}

.section-content-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 100%;
}
section[id] {
  scroll-margin-top: 80px;
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* =========================================================
   nav
   ========================================================= */

.nav {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(100%, 233.33vh);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px var(--page-inset);
}
.nav::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  z-index: -1;
  pointer-events: none;
  transition: background 0.4s ease, backdrop-filter 0.4s ease;
}
.nav.scrolled::before {
  background: rgba(14, 14, 14, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.nav-logo img {
  height: 28px;
  width: auto;
  filter: invert(1) drop-shadow(0 2px 20px rgba(0, 0, 0, 0.6));
}
.nav-links {
  display: flex;
  gap: 18px;
  list-style: none;
}
.nav-links a {
  font-size: 1.5vh;
  font-weight: 400;
  color: var(--color-text);
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.55);
  transition: opacity 0.2s ease;
}
.nav-links a:hover {
  opacity: 0.7;
}

.nav-toggle {
  display: none;
  width: 28px;
  height: 18px;
  position: relative;
  padding: 0;
}
.nav-toggle span,
.nav-toggle::before,
.nav-toggle::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--color-text);
  transition: transform 0.3s ease, opacity 0.3s ease, top 0.3s ease;
}
.nav-toggle::before { top: 0; }
.nav-toggle span    { top: 50%; transform: translateY(-50%); }
.nav-toggle::after  { top: calc(100% - 1px); }

body.menu-open .nav-toggle::before {
  top: 50%;
  transform: rotate(45deg);
}
body.menu-open .nav-toggle::after {
  top: 50%;
  transform: rotate(-45deg);
}
body.menu-open .nav-toggle span {
  opacity: 0;
}

/* =========================================================
   nav — mobile breakpoint
   ========================================================= */

@media (max-width: 767px) {
  /* reduced page inset on phones — frees ~24px of horizontal real estate */
  .page-wrapper { --page-inset: 20px; }

  /* shell type — vh is unstable on mobile, switch to vw */
  body { font-size: 4vw; }
  .section-label { font-size: 2.8vw; }

  /* strip the centering transform on phones — the nav is already 100% wide here,
     and an active transform on .nav makes it the containing block for the
     position:fixed .nav-links overlay (so inset:0 would resolve against the
     nav bar, not the viewport) */
  .nav {
    padding: 18px var(--page-inset);
    left: 0;
    width: 100%;
    transform: none;
  }
  .nav-links {
    position: fixed;
    inset: 0;
    z-index: 105;
    background: rgba(14, 14, 14, 0.88);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 28px;
    transform: translateX(100%);
    transition: transform 0.4s ease;
  }
  .nav-links a { font-size: 4.6vw; }
  body.menu-open .nav-links { transform: translateX(0); }

  /* enlarge hit area to ~44x44 while keeping bars at 28x18 visually */
  .nav-toggle {
    display: block;
    z-index: 110;
    position: relative;
    width: 44px;
    height: 44px;
  }
  .nav-toggle span,
  .nav-toggle::before,
  .nav-toggle::after {
    left: 50%;
    right: auto;
    width: 28px;
    transform: translateX(-50%);
  }
  .nav-toggle::before { top: calc(50% - 9px); }
  .nav-toggle span    { top: 50%; transform: translate(-50%, -50%); }
  .nav-toggle::after  { top: calc(50% + 8px); }
  body.menu-open .nav-toggle::before { top: 50%; transform: translateX(-50%) rotate(45deg); }
  body.menu-open .nav-toggle::after  { top: 50%; transform: translateX(-50%) rotate(-45deg); }
}
