/* ─────────────────────────────────────────
   A.B. Higley — Global Styles
   ───────────────────────────────────────── */

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

:root {
  --bg:            #F5F5F5;
  --ink:           #0F0F0F;
  --ink-muted:     #555555;

  --font-serif:    'Playfair Display', Georgia, serif;
  --font-sans:     'Inter', system-ui, sans-serif;

  --header-h:      70px;
  --nav-label-size: 0.65rem;

  --transition:    0.32s cubic-bezier(0.4, 0, 0.2, 1);
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  background-color: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }

/* ─────────────────────────────────────────
   HEADER
   ───────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--bg);
  height: var(--header-h);
  display: flex;
  flex-direction: column;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(1.5rem, 5vw, 3.5rem);
  flex: 1;
}

/* ── Site title ── */
.site-title {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: clamp(1rem, 2vw, 1.3rem);
  letter-spacing: 0.01em;
  color: var(--ink);
  transition: opacity 0.2s;
  white-space: nowrap;
}
.site-title:hover { opacity: 0.5; }

/* ── The rule — sits flush at bottom of header ── */
.header-rule {
  position: relative;       /* icon overlays are positioned inside here */
  width: 100%;
  height: 1px;
  background-color: var(--ink);
  flex-shrink: 0;
  overflow: visible;        /* let icons bleed above the line */
}

/*
  .nav-icon-overlay — one per nav link, injected by JS.
  Centered over each word, straddles the rule (half above, half below).
  Icon size is 28px; it sits -13px above the rule so it bridges the line.
*/
.nav-icon-overlay {
  position: absolute;
  top: 50%;
  transform: translateY(-50%) scale(0.7);
  width: 28px;
  height: 28px;
  /* The icon itself sits centered; a bg patch erases the line behind it */
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition:
    opacity var(--transition),
    transform var(--transition);
}

/* White/bg rect that "erases" the line segment behind the icon */
.nav-icon-overlay::before {
  content: '';
  position: absolute;
  inset: 0 -6px;            /* slightly wider than icon for clean gap */
  background-color: var(--bg);
  z-index: 0;
}

.nav-icon-overlay svg {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: block;
  color: var(--ink);
}

/* Active state (set by JS on hover) */
.nav-icon-overlay.is-visible {
  opacity: 1;
  transform: translateY(-50%) scale(1);
}

/* ── Nav links ── */
.primary-nav ul {
  display: flex;
  align-items: center;
  gap: clamp(1.2rem, 3vw, 2.4rem);
}

.nav-link {
  display: block;
  cursor: pointer;
  position: relative;
}

.nav-label {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: var(--nav-label-size);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink);
  transition: opacity var(--transition);
  display: block;
}

.nav-link:hover .nav-label,
.nav-link:focus-visible .nav-label {
  opacity: 0.45;
}

.nav-link:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 4px;
  border-radius: 2px;
}

/* ── Mobile hamburger ── */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 26px;
  height: 16px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 110;
}
.nav-toggle span {
  display: block;
  width: 100%;
  height: 1px;
  background-color: var(--ink);
  transition: transform 0.28s ease, opacity 0.28s ease;
  transform-origin: center;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

/* ─────────────────────────────────────────
   MAIN
   ───────────────────────────────────────── */
.site-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem clamp(1.5rem, 5vw, 3.5rem);
}

.welcome-text {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(3rem, 8vw, 7rem);
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--ink);
  width: 50vw;
  max-width: 100%;
  animation: fadeUp 0.9s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─────────────────────────────────────────
   FOOTER
   ───────────────────────────────────────── */
.site-footer {
  padding-bottom: 20px;
}

.footer-rule {
  width: 100%;
  height: 1px;
  background-color: var(--ink);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 80vw;
  margin: 0 auto;
  padding-top: 12px;
  height: 40px;
}

.footer-copy {
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
}

.footer-social {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  color: var(--ink-muted);
  transition: color 0.2s, transform 0.2s;
}
.social-link svg { width: 100%; height: 100%; display: block; }
.social-link:hover,
.social-link:focus-visible { color: var(--ink); transform: translateY(-2px); }
.social-link:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 3px; }

/* ─────────────────────────────────────────
   RESPONSIVE — MOBILE
   ───────────────────────────────────────── */
@media (max-width: 768px) {
  .nav-toggle { display: flex; }

  .primary-nav {
    position: fixed;
    inset: 0;
    background-color: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 105;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
  }
  .primary-nav.is-open { opacity: 1; pointer-events: auto; }

  .primary-nav ul {
    flex-direction: column;
    align-items: center;
    gap: 2.2rem;
  }
  .nav-label { font-size: 0.85rem; letter-spacing: 0.22em; }

  /* Hide icon overlays on mobile (nav is full-screen, no rule present) */
  .nav-icon-overlay { display: none; }

  .welcome-text { width: 90vw; }
  .footer-inner { width: 88vw; }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
