/* ── TOKENS ── */
:root {
  --bg:        #0b1622;
  --bg2:       #0f1e2e;
  --bg3:       #132030;
  --cyan:      #00d4aa;
  --cyan-dim:  #00a882;
  --yellow:    #f5c518;
  --yellow-dk: #d9a800;
  --white:     #ffffff;
  --gray:      #8b9db0;
  --gray2:     #4a5e70;
  --border:    rgba(0,212,170,0.18);
  --error:     #ff6b6b;
  --font-body: 'Space Grotesk', sans-serif;
  --font-mono: 'Space Mono', monospace;
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--white);
  font-family: var(--font-body);
  line-height: 1.6;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ── NAV ── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  background: rgba(11,22,34,0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-logo {
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--cyan);
  letter-spacing: 0.05em;
}
.nav-links {
  display: flex;
  gap: 1.8rem;
  align-items: center;
}
.nav-links a {
  font-size: 0.85rem;
  color: var(--gray);
  letter-spacing: 0.04em;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--cyan); }
.lang-toggle {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.3rem 0.7rem;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  letter-spacing: 0.05em;
}
.lang-toggle:hover {
  background: var(--cyan);
  color: var(--bg);
}
.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px;
}
.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--cyan);
  border-radius: 2px;
  transition: 0.3s;
}

/* ── DECORATIVE TRIANGLE ── */
.tri {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0.35;
  pointer-events: none;
}
.tri-right {
  border-top: 22px solid transparent;
  border-bottom: 22px solid transparent;
  border-left: 38px solid var(--cyan);
}
.tri-up {
  border-left: 18px solid transparent;
  border-right: 18px solid transparent;
  border-bottom: 30px solid var(--cyan);
}

/* ── HERO ── */
#hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 6rem 2rem 4rem;
  position: relative;
  overflow: hidden;
}
.hero-inner {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 3rem;
  align-items: center;
}
.hero-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--cyan);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}
.hero-label::before { content: '// '; }
.hero-title {
  font-size: clamp(2.4rem, 5vw, 3.8rem);
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 1.2rem;
}
.hero-title .highlight {
  display: inline-block;
  color: var(--cyan);
  border: 2px solid var(--cyan);
  padding: 0 0.25em;
  border-radius: 4px;
}
.hero-sub {
  font-size: 1rem;
  color: var(--gray);
  max-width: 460px;
  margin-bottom: 2rem;
}
.hero-checks {
  list-style: none;
  margin-bottom: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.hero-checks li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.95rem;
}
.hero-checks li::before {
  content: '';
  display: inline-flex;
  width: 20px;
  height: 20px;
  min-width: 20px;
  border: 2px solid var(--cyan);
  border-radius: 50%;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 6l3 3 5-5' stroke='%2300d4aa' stroke-width='1.8' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/14px no-repeat;
}
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2rem;
}
.tag {
  font-size: 0.78rem;
  font-family: var(--font-mono);
  border: 1px solid var(--gray2);
  color: var(--white);
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  letter-spacing: 0.03em;
}
.tag.accent {
  border-color: var(--cyan);
  color: var(--cyan);
}
.hero-skills {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  /* --title-w is set by index.js to the width of the hero title */
  max-width: var(--title-w, 460px);
  margin-bottom: 2rem;
}
.hero-skills .tag {
  text-align: center;
  white-space: nowrap;
}
/* 10th skill sits alone on the last row: center it under the middle column */
.hero-skills .tag:last-child:nth-child(3n+1) { grid-column: 2; }
.btn-yellow {
  display: inline-block;
  background: var(--yellow);
  color: #0b1622;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.7rem 1.6rem;
  border-radius: 50px;
  border: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  font-family: var(--font-mono);
  letter-spacing: 0.03em;
}
.btn-yellow:hover {
  background: var(--yellow-dk);
  transform: translateY(-2px);
}
.btn-yellow:disabled,
.btn-yellow:disabled:hover {
  cursor: wait;
  background: var(--yellow-dk);
  transform: none;
}
/* contact form while a message is on its way */
.contact-form.is-sending input,
.contact-form.is-sending textarea { opacity: 0.6; cursor: wait; }
.contact-form.is-sending .btn-yellow::before {
  content: '';
  display: inline-block;
  width: 0.9em;
  height: 0.9em;
  margin-right: 0.55em;
  vertical-align: -0.12em;
  border: 2px solid rgba(11,22,34,0.35);
  border-top-color: #0b1622;
  border-radius: 50%;
  animation: btn-spin 0.7s linear infinite;
}
@keyframes btn-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .contact-form.is-sending .btn-yellow::before { animation-duration: 2s; }
}

/* Hero card + photo */
.hero-right {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}
/* desktop: lift the name card + photo slightly */
@media (min-width: 901px) {
  .hero-right { top: -56px; }
}
.hero-card {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  padding: 1.1rem 2rem;
  text-align: center;
  width: 100%;
  position: relative;
}
.hero-card-tri {
  top: 50%;
  left: -44px;
  transform: translateY(-50%);
}
.hero-card-name {
  font-size: 1.5rem;
  font-weight: 700;
}
.hero-card-title {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--cyan);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-top: 0.3rem;
}
.hero-photo-wrap {
  width: 100%;
  max-width: 340px;
  aspect-ratio: 1/1;
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg3);
  border: 1px solid var(--border);
}
.hero-photo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}
.hero-photo-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  color: var(--gray);
  font-size: 0.85rem;
  font-family: var(--font-mono);
}
.hero-photo-placeholder svg {
  width: 80px;
  height: 80px;
  opacity: 0.3;
}

/* ── SECTION BASE ── */
section { padding: 5rem 2rem; position: relative; }
.section-inner { max-width: 1200px; margin: 0 auto; }
.section-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--cyan);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 0.6rem;
}
.section-label::before { content: '// '; }
.section-title {
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  font-weight: 700;
  margin-bottom: 1rem;
}
.section-title .highlight { color: var(--cyan); }

/* ── ABOUT ── */
#about { background: var(--bg2); }
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}
/* section label + title placed inside a column (About, Contact) */
.col-heading { margin-bottom: 1.5rem; }
.col-heading .section-title { margin-bottom: 0; }
.about-text > p {
  color: var(--gray);
  margin-bottom: 1.5rem;
  font-size: 1rem;
}
.about-text > p:last-child { margin-bottom: 0; }
.about-text > p span { color: var(--white); }
.edu-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
}
.edu-card-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--cyan);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 0.8rem;
}
.edu-card h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
}
.edu-card p {
  color: var(--gray);
  font-size: 0.9rem;
}
.edu-diploma {
  display: block;
  margin-top: 1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  transition: border-color 0.2s, transform 0.15s;
}
.edu-diploma:hover {
  border-color: var(--cyan);
  transform: translateY(-2px);
}
.edu-diploma img {
  width: 100%;
  height: auto;
}

/* ── PROJECTS ── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-top: 2.5rem;
}
.project-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.8rem;
  position: relative;
  overflow: hidden;
  transition: border-color 0.25s, transform 0.2s;
}
.project-card:hover {
  border-color: var(--cyan);
  transform: translateY(-4px);
}
.project-card-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--cyan);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 0.8rem;
}
.project-card h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
}
.project-card .client {
  font-size: 0.8rem;
  color: var(--gray);
  margin-bottom: 0.8rem;
}
.project-card p {
  font-size: 0.9rem;
  color: var(--gray);
  margin-bottom: 1.2rem;
  line-height: 1.65;
}
.project-card .tags { margin-bottom: 0; }
.project-shot {
  display: block;
  margin: -1.8rem -1.8rem 1.4rem;
  aspect-ratio: 16/10;
  background: var(--bg3);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}
.project-shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform 0.3s;
}
.project-shot:hover img { transform: scale(1.03); }
/* wide screenshots with content on the left: keep the left edge in frame */
.project-shot img.shot-left { object-position: left center; transform-origin: left center; }.project-shot-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray2);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  border: 1px dashed var(--gray2);
}
.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  padding-top: 2.2rem;
  margin-bottom: 1rem;
}
/* GitHub = filled white, Live Site = filled cyan */
.project-link {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.5rem 1.1rem;
  border-radius: 50px;
  background: var(--white);
  color: var(--bg);
  transition: background 0.2s, transform 0.15s;
}
.project-link:hover { background: #d7dee6; transform: translateY(-2px); }
.project-link.primary { background: var(--cyan); }
.project-link.primary:hover { background: var(--cyan-dim); }

/* ── SOCIAL / PROFILES ── */
#profiles { background: var(--bg2); }
.profiles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 2.5rem;
}
/* a profile left alone on the last row sits under the middle column */
.profiles-grid .profile-card:last-child:nth-child(3n+1) { grid-column: 2; }
.profile-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.2rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: border-color 0.2s, transform 0.15s;
  text-decoration: none;
  color: var(--white);
}
.profile-card:hover {
  border-color: var(--cyan);
  transform: translateY(-2px);
}
.profile-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.1rem;
}
.profile-info .name {
  font-weight: 600;
  font-size: 0.95rem;
}
.profile-info .handle {
  font-size: 0.75rem;
  color: var(--cyan);
  font-family: var(--font-mono);
}

/* ── CONTACT ── */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}
.contact-info > p {
  color: var(--gray);
  margin-bottom: 1.5rem;
}
.contact-info > p:last-child { margin-bottom: 0; }
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.form-group label {
  font-size: 0.8rem;
  font-family: var(--font-mono);
  color: var(--cyan);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.form-group input,
.form-group textarea {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--white);
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 0.7rem 1rem;
  outline: none;
  transition: border-color 0.2s;
  resize: vertical;
}
.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--cyan);
}
.form-group textarea { min-height: 120px; }
.form-group input[aria-invalid="true"],
.form-group textarea[aria-invalid="true"] { border-color: var(--error); }
.field-error {
  color: var(--error);
  font-size: 0.8rem;
  min-height: 1em;
}
.field-error:empty { display: none; }
/* anti-spam trap field: off-screen for people, still in the form for bots */
.hp-field {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ── POPUP MODAL ── */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal[hidden] { display: none; }
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(11,22,34,0.75);
  backdrop-filter: blur(6px);
  animation: modal-fade 0.2s ease-out;
}
.modal-card {
  position: relative;
  width: 100%;
  max-width: 440px;
  background: var(--bg3);
  border: 1px solid var(--cyan);
  border-radius: 10px;
  padding: 2rem 1.8rem 1.8rem;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  animation: modal-pop 0.2s ease-out;
}
.modal-title {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 1.2rem;
}
.modal-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  margin-bottom: 1.8rem;
}
.modal-list li {
  border-left: 2px solid var(--error);
  padding-left: 0.8rem;
  color: var(--gray);
  font-size: 0.9rem;
}
.modal-list strong {
  display: block;
  color: var(--white);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.15rem;
}
.modal-ok { width: 100%; }
.modal-text {
  color: var(--gray);
  font-size: 0.95rem;
  margin-bottom: 1.8rem;
}
.modal-text:empty,
.modal-list:empty { display: none; }
/* round badge above the label: ! for problems, check mark for success */
.modal-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.4rem;
  border: 2px solid var(--error);
  color: var(--error);
  background: rgba(255,107,107,0.08);
}
.modal-icon::before { content: '!'; }
.modal[data-type="success"] .modal-icon {
  border-color: var(--cyan);
  color: var(--cyan);
  background: rgba(0,212,170,0.08);
}
.modal[data-type="success"] .modal-icon::before { content: '\2713'; }
.modal-x {
  position: absolute;
  top: 0.6rem;
  right: 0.8rem;
  background: none;
  border: none;
  color: var(--gray);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  transition: color 0.2s;
}
.modal-x:hover { color: var(--cyan); }
body.modal-open { overflow: hidden; }
@keyframes modal-fade { from { opacity: 0; } }
@keyframes modal-pop { from { opacity: 0; transform: translateY(12px) scale(0.97); } }
@media (prefers-reduced-motion: reduce) {
  .modal-backdrop, .modal-card { animation: none; }
}

/* ── FOOTER ── */
footer {
  background: var(--bg2);
  border-top: 1px solid var(--border);
  padding: 2rem;
  text-align: center;
  color: var(--gray);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}
footer span { color: var(--cyan); }

/* ── MOBILE ── */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-right { order: -1; align-items: center; }
  .hero-left { text-align: center; }
  .hero-sub { margin-left: auto; margin-right: auto; }
  /* center the list as one block, but keep every checkmark on the same left edge */
  .hero-checks {
    align-items: flex-start;
    width: fit-content;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    text-align: left;
  }
  .hero-skills {
    grid-template-columns: repeat(2, 1fr);
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
  }
  .hero-skills .tag:last-child:nth-child(3n+1) { grid-column: auto; }
  .hero-card { max-width: 340px; }
  .hero-card-tri { display: none; }
  .hero-photo-wrap { max-width: 260px; }
  .about-grid,
  .contact-grid { grid-template-columns: 1fr; gap: 2rem; }
  .about-text,
  .edu-card,
  .contact-info,
  #profiles .section-label,
  #profiles .section-title { text-align: center; }
  .project-card .tags,
  .project-links { justify-content: center; }
  .projects-grid { grid-template-columns: 1fr; }
  .profiles-grid { grid-template-columns: repeat(2, 1fr); }
  .profiles-grid .profile-card:last-child:nth-child(3n+1) { grid-column: auto; }
  .profiles-grid .profile-card:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    justify-self: center;
    width: calc(50% - 0.5rem);
  }
  .nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: var(--bg2);
    border-bottom: 1px solid var(--border);
    padding: 1.2rem 2rem;
    gap: 1rem;
  }
  .nav-links.open { display: flex; }
  .nav-hamburger { display: flex; }
}
@media (min-width: 561px) and (max-width: 900px) {
  /* --col-title-w is set by index.js to the width of the section title above */
  .about-text > p,
  .contact-info > p {
    max-width: var(--col-title-w, 100%);
    margin-left: auto;
    margin-right: auto;
  }
}
@media (max-width: 560px) {
  .profiles-grid { grid-template-columns: 1fr; }
  .profiles-grid .profile-card:last-child:nth-child(odd) { grid-column: auto; width: auto; justify-self: stretch; }
  .hero-skills { grid-template-columns: 1fr; max-width: 240px; }
  section { padding: 3.5rem 1.2rem; }
  nav { padding: 1rem 1.2rem; }
}
