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

:root {
  --bg: #050b10;
  --text: #ffffff;
  --text-muted: rgba(255, 255, 255, 0.85);
  --accent: #1e9bff;
  --accent-2: #2fd17a;
  --field-bg: rgba(255, 255, 255, 0.06);
  --field-border: rgba(255, 255, 255, 0.18);
  --error: #ff6b6b;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Montserrat', Arial, sans-serif;
  color: var(--text);
  background: var(--bg) url('../images/bg.png') center top / cover no-repeat fixed;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

/* ---------- Hero ---------- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 16px;
}

.container {
  width: 100%;
  max-width: 680px;
  text-align: center;
}

.avatar {
  width: 202px;
  height: 202px;
  margin: 0 auto 42px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.4);
}

.eyebrow {
  margin: 0;
  font-size: 24px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.01em;
}

.title {
  margin: 4px 0 0;
  font-size: 56px;
  font-weight: 600;
  line-height: 1.15;
}

.intro {
  margin: 34px auto 0;
  max-width: 660px;
  font-size: 18px;
  line-height: 1.25;
  color: var(--text-muted);
}

/* ---------- Portfolios ---------- */
.portfolios {
  margin-top: 40px;
}

.section-label {
  margin: 0 0 18px;
  font-size: 15px;
  font-weight: 600;
}

.portfolio-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  gap: 36px;
}

.portfolio-list a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
}

.portfolio-list img {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.portfolio-list a:hover img,
.portfolio-list a:focus-visible img {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(30, 155, 255, 0.35);
}

.portfolio-list a:focus-visible {
  outline: none;
}

.portfolio-list a:focus-visible span {
  text-decoration: underline;
}

/* ---------- Contact form ---------- */
.contact {
  margin: 64px auto 0;
  max-width: 600px;
  padding: 32px;
  text-align: left;
  background: rgba(5, 14, 22, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.contact-title {
  margin: 0 0 24px;
  text-align: center;
  font-size: 26px;
  font-weight: 600;
}

.contact-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-full {
  grid-column: 1 / -1;
}

.field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.field input,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  font: inherit;
  font-size: 15px;
  color: var(--text);
  background: var(--field-bg);
  border: 1px solid var(--field-border);
  border-radius: 8px;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.field textarea {
  resize: vertical;
  min-height: 110px;
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.09);
}

.field.invalid input,
.field.invalid textarea {
  border-color: var(--error);
}

.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-error {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 14px;
  color: var(--error);
}

.btn {
  display: inline-block;
  width: 100%;
  padding: 14px 28px;
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(90deg, #1e9bff, #18b6c9);
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  transition: filter 0.2s ease, transform 0.2s ease;
}

.btn:hover {
  filter: brightness(1.1);
}

.btn:active {
  transform: translateY(1px);
}

.btn:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

.recaptcha-note {
  margin: 0;
  font-size: 11px;
  line-height: 1.5;
  text-align: center;
  color: rgba(255, 255, 255, 0.55);
}

.recaptcha-note a {
  color: inherit;
  text-decoration: underline;
}

/* The note above satisfies Google's disclosure rule, so the floating badge can be hidden */
.grecaptcha-badge {
  visibility: hidden;
}

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.lightbox[hidden] {
  display: none;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  animation: fade-in 0.25s ease;
}

.lightbox-dialog {
  position: relative;
  width: 100%;
  max-width: 420px;
  padding: 40px 32px 32px;
  text-align: center;
  background: #0b1822;
  border: 1px solid rgba(30, 155, 255, 0.35);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 40px rgba(30, 155, 255, 0.15);
  animation: pop-in 0.3s ease;
}

.lightbox-dialog h3 {
  margin: 16px 0 8px;
  font-size: 26px;
  font-weight: 600;
}

.lightbox-dialog p {
  margin: 0 0 24px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-muted);
}

.lightbox-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
}

.lightbox-close {
  position: absolute;
  top: 10px;
  right: 14px;
  padding: 4px 8px;
  font-size: 28px;
  line-height: 1;
  color: var(--text-muted);
  background: none;
  border: 0;
  cursor: pointer;
}

.lightbox-close:hover {
  color: #fff;
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes pop-in {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

/* ---------- 404 page ---------- */
.error-code {
  margin: 0 0 16px;
  font-size: 160px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.02em;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  /* drop-shadow, not text-shadow: text-shadow paints over clipped gradient text */
  filter: drop-shadow(0 0 24px rgba(30, 155, 255, 0.3));
}

.error-actions {
  margin-top: 36px;
}

.error-actions .btn {
  width: auto;
  text-decoration: none;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  body {
    /* fixed backgrounds are unreliable on mobile browsers */
    background-attachment: scroll;
  }

  .error-code {
    font-size: 120px;
  }

  .hero {
    padding: 56px 16px;
  }

  .avatar {
    width: 160px;
    height: 160px;
    margin-bottom: 32px;
  }

  .eyebrow {
    font-size: 20px;
  }

  .title {
    font-size: 44px;
  }

  .intro {
    margin-top: 24px;
    font-size: 16px;
    line-height: 1.45;
  }
}

@media (max-width: 520px) {
  .error-code {
    font-size: 96px;
  }

  .avatar {
    width: 140px;
    height: 140px;
  }

  .eyebrow {
    font-size: 17px;
  }

  .title {
    font-size: 36px;
  }

  .intro {
    font-size: 15px;
  }

  .contact {
    margin-top: 48px;
    padding: 24px 18px;
  }

  .contact-title {
    font-size: 22px;
  }

  .contact-form {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
