/* ---- Reset & Variables ---- */

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

html {
  color-scheme: dark;
  scroll-behavior: smooth;
}

:root {
  --bg-deep: #111116;
  --bg: #19191f;
  --bg-raised: #222229;
  --bg-hover: #2a2a32;
  --stroke: rgba(255, 255, 255, 0.06);
  --stroke-bright: rgba(255, 255, 255, 0.1);
  --text: #cdcdd4;
  --text-dim: #7e7e8a;
  --text-bright: #ededf0;
  --accent: #6e56cf;
  --accent-text: #a78bfa;
  --accent-glow: rgba(110, 86, 207, 0.12);
  --green: #3dd68c;
  --sans: 'Inter', system-ui, -apple-system, sans-serif;
  --mono: 'JetBrains Mono', 'SF Mono', monospace;
  --ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --radius: 10px;
}

body {
  font-family: var(--sans);
  background: var(--bg-deep);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body.modal-open {
  overflow: hidden;
}

::selection {
  background: var(--accent);
  color: #fff;
}

/* Film grain overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  opacity: 0.018;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
}

/* ---- Skip Link ---- */

.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  z-index: 100;
  padding: 8px 16px;
  background: var(--accent);
  color: #fff;
  border-radius: 6px;
  font-size: 14px;
  text-decoration: none;
  transition: top 0.2s;
}

.skip-link:focus {
  top: 12px;
}

/* ---- Focus Visible ---- */

:focus-visible {
  outline: 2px solid var(--accent-text);
  outline-offset: 2px;
}

/* ---- Nav ---- */

nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 90;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(20px, 5vw, 64px);
  background: rgba(17, 17, 22, 0.7);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s;
}

nav.scrolled {
  border-bottom-color: var(--stroke);
}

.nav-name {
  font-weight: 600;
  font-size: 15px;
  color: var(--text-bright);
  letter-spacing: -0.02em;
}

.nav-samson {
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 400;
  font-size: 18px;
}

.nav-dot {
  color: var(--text-dim);
  margin: 0 2px;
  font-size: 18px;
}

.nav-zone {
  color: var(--text-bright);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
  font-size: 18px;
}

.nav-target {
  position: relative;
  display: inline-block;
  color: transparent;
  width: 1.1em;
  text-align: center;
}

.nav-target::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--accent-text);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.nav-target::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  background: var(--accent-text);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
}

.nav-right a,
.nav-right button {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 450;
  color: var(--text-dim);
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 6px;
  border: none;
  background: none;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
}

.nav-right a:hover,
.nav-right button:hover {
  color: var(--text-bright);
  background: var(--bg-raised);
}

.nav-right .nav-contact-btn {
  background: var(--accent);
  color: #fff;
  padding: 6px 16px;
}

.nav-right .nav-contact-btn:hover {
  background: #7c63e0;
  color: #fff;
}

/* ---- Shell ---- */

.shell {
  max-width: 1120px;
  margin: 0 auto;
  padding: 56px clamp(20px, 5vw, 64px) 0;
}

/* ---- Hero ---- */

.hero {
  padding: clamp(40px, 6vw, 72px) 0 clamp(32px, 5vw, 56px);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 28px;
  align-items: start;
}

.hero-photo {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--stroke-bright);
  margin-top: 6px;
}

.hero-text h1 {
  font-size: clamp(28px, 4.5vw, 44px);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.12;
  color: var(--text-bright);
}

.hero-accent {
  color: var(--accent-text);
  background: linear-gradient(135deg, var(--accent-text), #c4b5fd);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size: 15px;
  color: var(--text-dim);
  margin-top: 10px;
  max-width: 520px;
  line-height: 1.6;
  font-weight: 350;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 16px;
}

.htag {
  font-family: var(--mono);
  font-size: 11px;
  padding: 3px 11px;
  border-radius: 100px;
  border: 1px solid var(--stroke);
  color: var(--text-dim);
  background: var(--bg);
}

/* ---- Section Headers ---- */

.sh {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 20px;
  padding-top: clamp(32px, 5vw, 52px);
  border-top: 1px solid var(--stroke);
}

.sh h2 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-bright);
}

.sh-line {
  flex: 1;
  height: 1px;
  background: var(--stroke);
}

.sh-first {
  border-top: none;
  padding-top: 0;
}

.sh-label {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.05em;
}

/* ---- Projects ---- */

.p-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.p-card {
  background: var(--bg);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  padding: 20px;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.25s var(--ease),
              background 0.25s var(--ease),
              transform 0.25s var(--ease);
}

.p-card:hover {
  border-color: var(--accent);
  background: var(--bg-raised);
  transform: translateY(-2px);
}

.p-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.p-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-bright);
}

.p-badge {
  font-family: var(--mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 2px 8px;
  border-radius: 100px;
  background: var(--accent-glow);
  color: var(--accent-text);
}

.p-desc {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.5;
}

.p-arrow {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: auto;
  align-self: flex-end;
  transition: color 0.2s, transform 0.2s;
}

.p-card:hover .p-arrow {
  color: var(--accent-text);
  transform: translate(3px, -3px);
}

/* ---- About ---- */

.about-split {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: clamp(32px, 5vw, 64px);
}

.prose {
  font-size: 15px;
  color: var(--text);
  line-height: 1.7;
}

.prose + .prose {
  margin-top: 14px;
}

.prose strong {
  color: var(--text-bright);
  font-weight: 500;
}

.side-label {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin-bottom: 10px;
}

.focus-list {
  list-style: none;
}

.focus-list li {
  font-size: 13px;
  color: var(--text);
  padding: 7px 0;
  border-bottom: 1px solid var(--stroke);
  display: flex;
  align-items: center;
  gap: 8px;
}

.focus-list li:last-child {
  border: none;
}

.focus-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
}

/* ---- Values ---- */

.v-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.v-card {
  background: var(--bg);
  border: 1px solid var(--stroke);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 24px;
  transition: border-color 0.3s var(--ease),
              background 0.3s var(--ease),
              transform 0.3s var(--ease),
              box-shadow 0.3s var(--ease);
}

.v-card:hover {
  border-color: var(--stroke-bright);
  border-left-color: var(--accent-text);
  background: var(--bg-raised);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.v-num {
  font-family: var(--mono);
  font-size: 20px;
  color: var(--accent);
  margin-bottom: 12px;
  display: block;
  font-weight: 500;
  opacity: 0.5;
}

.v-card h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-bright);
  margin-bottom: 8px;
}

.v-card p {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.6;
}

/* ---- Civic ---- */

.civic-note {
  font-size: 14px;
  color: var(--text-dim);
  max-width: 520px;
  margin-bottom: 16px;
  line-height: 1.6;
}

.civic-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.c-chip {
  font-size: 12px;
  font-weight: 450;
  color: var(--text);
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 100px;
  border: 1px solid var(--stroke);
  background: var(--bg);
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease), background 0.2s var(--ease);
}

.c-chip:hover {
  border-color: var(--accent);
  color: var(--accent-text);
  background: var(--accent-glow);
}

/* ---- Contact Modal ---- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s var(--ease);
}

.modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  background: var(--bg);
  border: 1px solid var(--stroke-bright);
  border-radius: 14px;
  width: 100%;
  max-width: 520px;
  padding: 36px;
  position: relative;
  transform: translateY(16px) scale(0.97);
  transition: transform 0.3s var(--ease);
}

.modal-backdrop.open .modal {
  transform: translateY(0) scale(1);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border: none;
  background: var(--bg-raised);
  border-radius: 8px;
  color: var(--text-dim);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
}

.modal-close:hover {
  background: var(--bg-hover);
  color: var(--text-bright);
}

.modal h2 {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-bright);
  letter-spacing: -0.02em;
}

.modal .modal-sub {
  font-size: 14px;
  color: var(--text-dim);
  margin: 6px 0 24px;
  line-height: 1.5;
}

/* ---- Contact Form ---- */

.cf {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.cf-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.cf label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-dim);
  margin-bottom: 4px;
}

.cf input,
.cf textarea {
  width: 100%;
  padding: 10px 12px;
  font-family: var(--sans);
  font-size: 14px;
  border: 1px solid var(--stroke);
  border-radius: 8px;
  background: var(--bg-deep);
  color: var(--text-bright);
  transition: border-color 0.2s;
}

.cf input:focus,
.cf textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.cf input:focus-visible,
.cf textarea:focus-visible {
  outline: 2px solid var(--accent-text);
  outline-offset: 2px;
}

.cf input::placeholder,
.cf textarea::placeholder {
  color: var(--text-dim);
  opacity: 0.5;
}

.cf textarea {
  resize: vertical;
  min-height: 90px;
}

.cf-btn {
  align-self: flex-start;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  padding: 10px 28px;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.cf-btn:hover {
  background: #7c63e0;
}

.cf-btn:active {
  transform: scale(0.98);
}

.cf-btn.sending {
  opacity: 0.5;
  pointer-events: none;
}

.cf-status {
  font-size: 13px;
  padding: 10px 12px;
  border-radius: 8px;
  display: none;
}

.cf-status.show {
  display: block;
}

.cf-status.ok {
  background: rgba(61, 214, 140, 0.1);
  color: var(--green);
  border: 1px solid rgba(61, 214, 140, 0.2);
}

.cf-status.err {
  background: rgba(239, 68, 68, 0.1);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

/* ---- Footer ---- */

footer {
  margin-top: clamp(32px, 5vw, 52px);
  padding: 24px clamp(20px, 5vw, 64px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--stroke);
  max-width: 1120px;
  margin-left: auto;
  margin-right: auto;
  font-size: 12px;
  color: var(--text-dim);
}

footer a {
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.2s;
}

footer a:hover {
  color: var(--text-bright);
}

.f-links {
  display: flex;
  gap: 18px;
  list-style: none;
}

/* ---- Reveal Animation ---- */

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.45s var(--ease), transform 0.45s var(--ease);
}

.reveal.vis {
  opacity: 1;
  transform: translateY(0);
}

/* ---- Responsive ---- */

@media (max-width: 860px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .hero-photo {
    width: 56px;
    height: 56px;
    margin-top: 0;
  }

  .about-split {
    grid-template-columns: 1fr;
  }

  .p-grid {
    grid-template-columns: 1fr 1fr;
  }

  .v-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 600px) {
  .p-grid {
    grid-template-columns: 1fr;
  }

  .v-grid {
    grid-template-columns: 1fr;
  }

  .cf-pair {
    grid-template-columns: 1fr;
  }

  .nav-right {
    gap: 2px;
  }

  .nav-right a,
  .nav-right button {
    padding: 6px 10px;
    font-size: 12px;
  }

  footer {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }

  .modal {
    padding: 28px 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
