/* =========================================================================
   ui.css — shared components: nav, buttons, glass surfaces, forms, modal
   ========================================================================= */

/* ---- Page shell ---- */
.page {
  width: min(92%, 1120px);
  margin-inline: auto;
  padding-block: clamp(7rem, 6rem + 6vw, 9rem) var(--space-section);
}

/* =========================================================================
   Navbar — glass pill, kept in spirit of original but elevated
   ========================================================================= */
.nav_container {
  position: fixed;
  inset: 0 0 auto 0;
  display: flex;
  justify-content: center;
  padding-top: calc(16px + env(safe-area-inset-top));
  z-index: 1000;
  pointer-events: none;
}

.navbar {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 6px;
  border-radius: var(--radius-pill);
  background: rgba(10, 14, 22, 0.55);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(var(--glass-blur)) saturate(140%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(140%);
  box-shadow: var(--shadow-soft), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition: transform var(--dur) var(--ease-out-expo),
              box-shadow var(--dur) var(--ease-out-expo),
              background var(--dur) var(--ease-out-expo);
}
/* shrink/solidify slightly once the page is scrolled (toggled by JS) */
.nav_container.is-scrolled .navbar {
  background: rgba(8, 11, 18, 0.78);
  box-shadow: var(--shadow-lift), inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.navbar a {
  position: relative;
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--ink-soft);
  padding: 0.5rem 1.05rem;
  border-radius: var(--radius-pill);
  text-decoration: none;
  transition: color var(--dur-fast) ease, background var(--dur-fast) ease,
              box-shadow var(--dur-fast) ease;
}
.navbar a:not(.active):hover {
  color: var(--ink);
  background: rgba(47, 163, 107, 0.07);
  box-shadow: 0 0 0 1px rgba(47, 163, 107, 0.45);
}
.navbar a.active {
  color: var(--accent-ink);
  background: var(--grad-accent);
  box-shadow: 0 6px 18px -8px rgba(47, 163, 107, 0.7);
}

/* =========================================================================
   Buttons
   ========================================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.85rem 1.5rem;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  font-family: var(--font-display);
  font-size: 0.98rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  text-decoration: none;
  transition: transform var(--dur-fast) var(--ease-spring),
              box-shadow var(--dur) var(--ease-out-expo),
              background var(--dur) ease, border-color var(--dur) ease;
}
.btn svg { width: 1.1em; height: 1.1em; }

.btn--primary {
  color: var(--accent-ink);
  background: var(--grad-accent);
  background-size: 160% 160%;
  box-shadow: var(--glow-accent);
  animation: btnSheen 6s ease infinite;
}
.btn--primary:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 0 0 1px rgba(47, 163, 107, 0.4), 0 24px 60px -18px rgba(47, 163, 107, 0.6);
}
@keyframes btnSheen {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.btn--ghost {
  color: var(--ink);
  background: var(--glass);
  border-color: var(--glass-border);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.btn--ghost:hover {
  transform: translateY(-2px);
  border-color: var(--glass-border-hi);
  background: var(--glass-strong);
}

/* =========================================================================
   Glass surface — the core reusable card
   ========================================================================= */
.glass {
  position: relative;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(var(--glass-blur)) saturate(135%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(135%);
  box-shadow: var(--shadow-soft), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  overflow: hidden;
}
/* top sheen line */
.glass::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
  opacity: 0.5;
}

/* Section heading shared block */
.section-head {
  margin-bottom: clamp(1.5rem, 1rem + 2vw, 2.75rem);
}
.section-head h2 {
  font-size: var(--text-h2);
  margin-top: 0.7rem;
}
.section-head .lead {
  color: var(--ink-soft);
  font-size: var(--text-lead);
  max-width: 60ch;
  margin-top: 0.9rem;
}

/* =========================================================================
   Forms (used on contact)
   ========================================================================= */
.field {
  position: relative;
  margin-bottom: 1.1rem;
}
.field label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 0.5rem;
}
.input,
.textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 0.9rem 1rem;
  outline: none;
  transition: border-color var(--dur-fast) ease, box-shadow var(--dur-fast) ease,
              background var(--dur-fast) ease;
}
.input::placeholder,
.textarea::placeholder { color: var(--ink-faint); }
.input:focus,
.textarea:focus {
  border-color: rgba(47, 163, 107, 0.6);
  background: rgba(47, 163, 107, 0.04);
  box-shadow: 0 0 0 4px rgba(47, 163, 107, 0.12);
}
.textarea {
  min-height: 9.5rem;
  resize: vertical;
}

/* visually hidden but accessible (honeypot / sr labels) */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* form status message */
.form-status {
  min-height: 1.4rem;
  font-size: 0.92rem;
  margin-top: 0.5rem;
}
.form-status.is-ok { color: var(--accent); }
.form-status.is-err { color: #ff8d8d; }
.form-status.is-pending { color: var(--ink-soft); }

/* =========================================================================
   Social icon buttons
   ========================================================================= */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px; height: 46px;
  border-radius: 14px;
  color: var(--ink);
  background: var(--glass);
  border: 1px solid var(--glass-border);
  transition: transform var(--dur-fast) var(--ease-spring),
              border-color var(--dur-fast) ease, color var(--dur-fast) ease,
              background var(--dur-fast) ease;
}
.icon-btn svg { width: 22px; height: 22px; fill: currentColor; }
.icon-btn:hover {
  transform: translateY(-3px);
  color: var(--accent);
  border-color: rgba(47, 163, 107, 0.5);
  background: rgba(47, 163, 107, 0.08);
}

/* =========================================================================
   Project modal (dialog)
   ========================================================================= */
.project-modal {
  width: min(880px, 94vw);
  max-height: 90vh;
  padding: 0;
  border: 1px solid var(--glass-border-hi);
  border-radius: var(--radius-lg);
  background: rgba(12, 16, 24, 0.86);
  backdrop-filter: blur(24px) saturate(150%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
  color: var(--ink);
  box-shadow: var(--shadow-lift);
  overflow: hidden;
}
.project-modal::backdrop {
  background: rgba(3, 5, 9, 0.6);
  backdrop-filter: blur(4px);
}
.project-modal[open] { animation: modalIn var(--dur) var(--ease-out-expo); }
@keyframes modalIn {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}

.project-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.4rem;
  border-bottom: 1px solid var(--glass-border);
}
.project-modal__title {
  font-size: 1.3rem;
}
.project-modal__close {
  width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 1.1rem;
  transition: color var(--dur-fast) ease, background var(--dur-fast) ease, transform var(--dur-fast) ease;
}
.project-modal__close:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.08);
  transform: rotate(90deg);
}

.project-modal__body {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 1.4rem;
  padding: 1.4rem;
  overflow-y: auto;
}
@media (max-width: 760px) {
  .project-modal__body { grid-template-columns: 1fr; }
}

.project-modal__media {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--glass-border);
  aspect-ratio: 16 / 10;
  background: var(--grad-accent);
}
.project-modal__image {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.project-modal__desc { color: var(--ink-soft); line-height: 1.7; }
.project-modal__stack {
  list-style: none;
  margin: 1.2rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.project-modal__pill {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent);
  background: rgba(47, 163, 107, 0.08);
  border: 1px solid rgba(47, 163, 107, 0.25);
  padding: 0.35rem 0.7rem;
  border-radius: var(--radius-pill);
}
.project-modal__actions {
  margin-top: 1.5rem;
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
}
