:root {
  --color-bg: #f8f7f4;
  --color-surface: #ffffff;
  --color-text: #141414;
  --color-text-muted: #5c5c5c;
  --color-border: #e4e2dc;
  --color-accent: #c41e3a;
  --color-accent-hover: #9e1830;
  --font-display: 'Geologica', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.12);
  --nav-height: 72px;
  --max-width: 1120px;
  --transition: 0.2s ease;
}

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

html {
  height: 100%;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* ── Navigation ── */

.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: var(--nav-height);
  padding: 0 clamp(20px, 4vw, 48px);
  background: rgba(248, 247, 244, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
}

.nav-title {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2.5vw, 1.75rem);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.nav-title > a {
  text-decoration: none;
  color: var(--color-text);
  transition: color var(--transition);
}

.nav-title > a:hover {
  color: var(--color-accent);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(12px, 2vw, 28px);
}

.nav-links > a {
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--color-text-muted);
  letter-spacing: 0.01em;
  transition: color var(--transition);
  white-space: nowrap;
}

.nav-links > a:hover {
  color: var(--color-text);
}

.nav-icon {
  height: 15px;
  width: 15px;

  display: flex;
  align-items: center;
  object-fit: contain;

  /* Match --color-text-muted */
  opacity: 0.65;

  transition:
    opacity var(--transition),
    filter var(--transition);
}

.nav-icons:hover .nav-icon {
  /* Match --color-text */
  opacity: 1;
}

.nav-dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
}

/* Match the exact styling of .nav-links > a */
.nav-dropdown-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;

  background: none;
  border: 0;
  padding: 0;
  margin: 0;

  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.6;
  letter-spacing: 0.01em;

  color: var(--color-text-muted);
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;

  transition: color var(--transition);
}

.nav-dropdown-button:hover,
.nav-dropdown.open .nav-dropdown-button {
  color: var(--color-text);
  text-decoration: none;
}

/* Use a proper chevron instead of a tiny triangle */
.nav-dropdown-arrow {
  display: inline-block;
  font-size: 0.8rem;
  line-height: 1;
  transform-origin: center;
  transition: transform var(--transition);
}

.nav-dropdown:hover .nav-dropdown-arrow,
.nav-dropdown.open .nav-dropdown-arrow {
  transform: rotate(180deg);
}

/* Dropdown */

/* Keeps hover active while moving from Work into menu */
.nav-dropdown-menu::before {
  content: '';
  position: absolute;
  top: -13px;
  left: 0;
  right: 0;
  height: 13px;
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown.open .nav-dropdown-menu {
  display: block;
}

.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  left: -12px;

  min-width: 130px;
  padding: 5px;

  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);

  z-index: 1000;
}

.nav-dropdown-menu a {
  display: block;
  padding: 6px 9px;

  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0.01em;

  color: var(--color-text-muted);
  text-decoration: none;
  white-space: nowrap;

  border-radius: 4px;
}

.nav-dropdown-menu a:hover {
  color: var(--color-text);
  background: var(--color-bg);
  text-decoration: none;
}

.nav-dropdown-arrow {
  width: 7px;
  height: 7px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: transform var(--transition);
}

.nav-dropdown:hover .nav-dropdown-arrow,
.nav-dropdown.open .nav-dropdown-arrow {
  transform: rotate(225deg) translate(-1px, -1px);
}

/* ── Links ── */

a {
  color: var(--color-text);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--color-border);
  transition:
    color var(--transition),
    text-decoration-color var(--transition);
}

a:hover {
  color: var(--color-accent);
  text-decoration-color: var(--color-accent);
}

/* ── Typography utilities ── */

.title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.sub-title {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-text-muted);
  padding-bottom: 4px;
}

span {
  font-size: inherit;
}

/* ── Responsive nav ── */

@media screen and (max-width: 768px) {
  :root {
    --nav-height: auto;
  }

  .nav {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    padding: 20px;
    height: auto;
  }

  .nav-links {
    flex-wrap: wrap;
    gap: 8px 20px;
  }

  .nav-links > a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  .nav-dropdown-button {
    min-height: 44px;
  }
}

/* Devices that support hover */
@media (hover: hover) {
  .nav-dropdown:hover .nav-dropdown-menu {
    display: block;
  }

  .nav-dropdown:hover .nav-dropdown-arrow {
    transform: rotate(225deg) translate(-1px, -1px);
  }
}
