/* Site design system — buttons + layout tokens */
:root {
  --folder-bg: #F2F2F0;
  --band-bg: #F7F7F5;
  --hairline-strong: #D4D4D0;
  --brand-pink: var(--pink, #FF8FB3);
  --pink-rgb: 255, 143, 179;
  --brand-blue: #4A7EB8;
  --on-primary: #FAFAF8;
  --r-md: 8px;
  /* one cool-grey hover tint used for every subtle hover (buttons, menu items, icons).
     A touch lighter than --hairline and on the COLD/blue side, so it reads clearly
     without the warm cast some pages' --hairline has. */
  --hover-grey: #ECECF0;
}
[data-theme="dark"] {
  --folder-bg: #222220;
  --band-bg: #1C1C1B;
  --hairline-strong: #3A3A38;
  --brand-blue: #6A9ED4;
  --on-primary: #141413;
  --hover-grey: #26262A;
}

/* —— Base button —— */
.btn {
  /* 4-point grid: fixed heights (36 / 28 / 44) + horizontal padding in multiples of 4,
     so a button is always a grid-aligned box regardless of font metrics. */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-sizing: border-box;
  height: 36px;
  border: 1px solid transparent;
  border-radius: 8px;                 /* unified control radius (--r-md) */
  padding: 0 16px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;                     /* hug the text so it sits dead-centre in the button */
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}
/* sizes */
.btn-sm { height: 28px; padding: 0 12px; font-size: 12px; border-radius: 8px; }
.btn-lg { height: 44px; padding: 0 24px; font-size: 16px; }
/* secondary — soft light-gray fill */
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--hairline); }
.btn-secondary:hover { background: var(--hairline-soft); border-color: var(--hairline-strong); }
.btn-secondary:active { background: var(--hairline); }
/* outline — subtle, transparent with a hairline */
.btn-outline { background: transparent; color: var(--charcoal); border-color: var(--hairline-strong); }
.btn-outline:hover { background: var(--hover-grey); color: var(--ink); }
.btn-outline:active { background: var(--hairline-soft); }
.btn:disabled {
  cursor: not-allowed;
}
.btn.is-busy {
  animation: btn-pulse 0.9s ease-in-out infinite;
}
@keyframes btn-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}
.btn-icon {
  display: block;
  width: 14px;
  height: 14px;
  flex: none;
}

/* button-primary → solid black CTA, reserved for the most important actions */
.btn-primary {
  background: var(--ink);
  color: var(--on-primary);
  border-color: var(--ink);
}
.btn-primary:hover {
  background: var(--charcoal);
  border-color: var(--charcoal);
  color: var(--on-primary);
}
.btn-primary:active {
  background: var(--charcoal);
}
.btn-primary:disabled {
  background: var(--hairline);
  color: var(--muted);
  border-color: var(--hairline);
}

/* Compact variants (toolbar) */
.btn-primary.btn--sm,
.btn--primary.btn--sm { padding: 8px 16px; font-size: 12px; }
.btn-ghost.btn--sm,
.btn--ghost.btn--sm { padding: 6px 10px; font-size: 12px; }
.btn--primary {
  padding: 12px 24px;
  border-radius: var(--r-full);
  background: var(--ink);
  color: var(--on-primary);
}
.btn--primary:hover { background: var(--charcoal); color: var(--on-primary); }
.btn--ghost {
  padding: 8px 12px;
  border-radius: var(--r-md);
  background: transparent;
  color: var(--ink);
  border: none;
}
.btn--ghost:hover { background: var(--hover-grey); }

/* Projects header */
#projects-title {
  margin: 0 0 var(--space-lg);
  text-align: center;
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  font-size: clamp(26px, 4.4vw, 44px);
  letter-spacing: -1.5px;
  color: var(--ink);
}
/* Clickable heading — the whole title leads into My work */
#projects-title .pt-link {
  font: inherit;
  letter-spacing: inherit;
  color: inherit;
  background: none;
  border: none;
  margin: 0;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.34em;
  -webkit-tap-highlight-color: transparent;
}
#projects-title .pt-link-text {
  background-image: linear-gradient(var(--pink), var(--pink));
  background-size: 0% 2px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size 260ms ease;
}
#projects-title .pt-link-arrow {
  font-family: 'DM Sans', sans-serif;
  font-weight: 700;
  font-size: 16px;
  line-height: 1;
  width: 36px;
  height: 36px;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--folder-bg);
  color: var(--ink);
  border: 1.5px solid var(--hairline-strong);
  transition: transform 240ms ease, background 240ms ease, color 240ms ease, border-color 240ms ease;
}
#projects-title .pt-link:hover .pt-link-text,
#projects-title .pt-link:focus-visible .pt-link-text {
  background-size: 100% 2px;
}
#projects-title .pt-link:hover .pt-link-arrow,
#projects-title .pt-link:focus-visible .pt-link-arrow {
  background: var(--pink);
  color: var(--on-primary, #fff);
  border-color: var(--pink);
  transform: translateX(4px);
}
#projects-title .pt-link:focus-visible {
  outline: none;
}

/* Section band */
.section-surface {
  width: 100%;
  background: var(--folder-bg);
  padding: var(--space-section, 80px) var(--page-margin);
  box-sizing: border-box;
}
#projects .section-surface {
  background: transparent;
}
.section-surface__inner {
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
}

/* Nav */
#nav {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  padding: 0 var(--page-margin);
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 1000;
  background: rgba(247, 247, 248, 0.72);      /* translucent so the blur reads */
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: background 300ms ease, backdrop-filter 300ms ease;
}
[data-theme="dark"] #nav {
  background: rgba(20, 20, 19, 0.72);
}
#nav.scrolled {
  background: rgba(247, 247, 248, 0.8);
}
[data-theme="dark"] #nav.scrolled {
  background: rgba(20, 20, 19, 0.8);
}
#nav-logo {
  font-family: 'Ms Madi', cursive;
  font-weight: 400;
  font-size: 30px;
  line-height: 1;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
#nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
#theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: none;                   /* no container — subtle highlight on hover */
  cursor: pointer;
  color: var(--charcoal);
  transition: color 200ms ease, background 160ms ease;
}
#theme-toggle:hover {
  color: var(--ink);
  background: var(--hover-grey);
}
[data-theme="dark"] #theme-toggle {
  color: var(--ink);
}
.theme-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  line-height: 0;
}
.theme-icon svg { display: block; width: 16px; height: 16px; }
.theme-icon--sun { display: none; }
[data-theme="dark"] .theme-icon--moon { display: none; }
[data-theme="dark"] .theme-icon--sun { display: flex; }
.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
}
.nav-link {
  font-size: 14px;
  color: var(--charcoal);
  text-decoration: none;
  background: none;
  border: none;
  font-family: inherit;
  cursor: pointer;
  transition: color 200ms ease;
}
.nav-link:hover { color: var(--brand-pink); }
.nav-label-short { display: none; }
/* keep the nav identical to the home page at every width */
.nav-build { height: 32px; font-weight: 500; }   /* same nav CTA size on every page */
@media (max-width: 520px) { .nav-build { padding: 0 10px; } }
@media (max-width: 479px) {
  .nav-label-long { display: none; }
  .nav-label-short { display: inline; }
  .nav-links { gap: 10px; }
  #nav-logo { font-size: 28px; }
  .theme-icon { width: 20px; height: 20px; }
}
