:root {
  --bg-top: #07102a;
  --bg-bottom: #0B183A;
  --surface: #1A1A24;
  --surface-2: #21212E;
  --ink: #F4F4F0;
  --ink-soft: #B8B8BE;
  --ink-mute: #6B6B73;
  --ink-deep: #3A3A42;
  --gold: #C9A84C;
  --gold-soft: rgba(201, 168, 76, 0.18);
  --radius: 18px;
  --radius-sm: 10px;
  --max-w: 580px;
  --pad-x: 20px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'DM Sans', system-ui, sans-serif;
  font-weight: 400;
  color: var(--ink);
  background-color: var(--bg-top);
  background-image:
    radial-gradient(1200px 600px at 50% -10%, rgba(201, 168, 76, 0.07), transparent 60%),
    radial-gradient(900px 500px at 100% 100%, rgba(201, 168, 76, 0.04), transparent 60%),
    linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: 0.005em;
  overflow-x: hidden;
}

/* Subtle grain overlay for atmosphere */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.035;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.7 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

.container {
  position: relative;
  z-index: 1;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 56px var(--pad-x) 64px;
}

/* ---------- Header ---------- */
.header {
  text-align: center;
  margin-bottom: 44px;
  animation: rise 0.9s var(--ease) both;
}

.logo-wrap {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-bottom: 22px;
}

.logo {
  width: 200px;
  height: auto;
  display: block;
}

.logo-tag {
  font-family: 'DM Sans', sans-serif;
  font-size: 8.5px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-top: -15px;
}

.name {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: clamp(32px, 8.5vw, 38px);
  letter-spacing: -0.015em;
  color: var(--ink);
  margin: 0 0 10px;
  line-height: 1.05;
}

.name::after {
  content: '';
  display: block;
  width: 28px;
  height: 1px;
  background: var(--gold);
  margin: 16px auto 0;
  opacity: 0.85;
}

.subtitle {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: var(--ink-soft);
  margin: 18px auto 0;
  line-height: 1.55;
  max-width: 320px;
  letter-spacing: 0.005em;
}

/* ---------- Cards ---------- */
.cards {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 52px;
}

.card {
  display: block;
  position: relative;
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  background-color: var(--surface);
  transition:
    transform 0.4s var(--ease),
    box-shadow 0.4s var(--ease),
    filter 0.4s var(--ease);
  cursor: pointer;
  opacity: 0;
  transform: translateY(18px);
  animation: rise 0.7s var(--ease) forwards;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.02) inset,
    0 8px 24px -16px rgba(0, 0, 0, 0.6);
  -webkit-tap-highlight-color: transparent;
}

.card:nth-child(1) { animation-delay: 0.10s; }
.card:nth-child(2) { animation-delay: 0.20s; }
.card:nth-child(3) { animation-delay: 0.30s; }
.card:nth-child(4) { animation-delay: 0.40s; }
.card:nth-child(5) { animation-delay: 0.50s; }

.card-media {
  position: relative;
  width: 100%;
  aspect-ratio: 2048 / 1429;
  background-color: var(--surface);
  overflow: hidden;
}

/* Placeholder text shown under the image (visible if image is missing/broken) */
.card-media::before {
  content: attr(data-label);
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Outfit', sans-serif;
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: #444;
  background-color: var(--surface);
  z-index: 0;
}

.card-media picture {
  display: contents;
}

.card-media img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease);
}

/* For missing files, the broken <img> becomes invisible so placeholder shows */
.card-media img:not([src]),
.card-media img[src=""] {
  display: none;
}

@media (hover: hover) {
  .card:hover {
    transform: scale(1.02) translateY(-2px);
    box-shadow:
      0 1px 0 rgba(255, 255, 255, 0.04) inset,
      0 18px 40px -18px rgba(0, 0, 0, 0.7),
      0 0 0 1px rgba(201, 168, 76, 0.08);
  }
  .card:hover .card-media img {
    transform: scale(1.025);
  }
}

.card:active {
  transform: scale(0.995);
  transition-duration: 0.15s;
}

.card:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 2px var(--bg-top),
    0 0 0 4px var(--gold);
}

/* ---------- Footer ---------- */
.footer {
  text-align: center;
  animation: rise 0.9s var(--ease) 0.6s both;
}

.avatar-wrap {
  position: relative;
  display: inline-block;
  margin-bottom: 18px;
}

.avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  border: 2px solid var(--gold);
  background-color: var(--surface-2);
}

.avatar-wrap::after {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1px solid var(--gold-soft);
  pointer-events: none;
}

.footer-name {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 18px;
  color: var(--ink);
  margin: 0 0 8px;
  letter-spacing: -0.005em;
}

.footer-bio {
  font-family: 'DM Sans', sans-serif;
  font-size: 12.5px;
  color: var(--ink-soft);
  line-height: 1.6;
  margin: 0 auto 22px;
  max-width: 340px;
  letter-spacing: 0.01em;
}

.footer-bio .dot {
  display: inline-block;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--gold);
  margin: 0 6px;
  vertical-align: middle;
  opacity: 0.7;
}

.socials {
  display: inline-flex;
  gap: 14px;
  padding: 0;
  margin: 0 0 28px;
  list-style: none;
}

.socials a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: var(--ink);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background-color: rgba(255, 255, 255, 0.02);
  transition:
    color 0.3s var(--ease),
    border-color 0.3s var(--ease),
    background-color 0.3s var(--ease),
    transform 0.3s var(--ease);
  text-decoration: none;
}

.socials a:hover {
  color: var(--gold);
  border-color: var(--gold-soft);
  background-color: rgba(201, 168, 76, 0.06);
  transform: translateY(-1px);
}

.socials svg {
  width: 20px;
  height: 20px;
  display: block;
}

.copyright {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  color: #7A7A84;
  letter-spacing: 0.04em;
  margin: 0;
}

/* ---------- Animation ---------- */
@keyframes rise {
  0% {
    opacity: 0;
    transform: translateY(18px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.001ms !important;
  }
  .card {
    opacity: 1;
    transform: none;
  }
}

/* iPhone SE friendliness — keep 20px lateral padding (no smaller, to stay readable) */
@media (max-width: 380px) {
  .container {
    padding: 44px 20px 56px;
  }
  .name {
    font-size: 30px;
  }
  .subtitle {
    font-size: 13px;
  }
}

/* ---------- Modal ---------- */
body.modal-open {
  overflow: hidden;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background-color: rgba(7, 7, 12, 0.74);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 0.3s var(--ease);
}

.modal.is-open {
  display: flex;
  opacity: 1;
}

.modal-dialog {
  position: relative;
  width: 100%;
  max-width: 460px;
  max-height: calc(100dvh - 48px);
  overflow-y: auto;
  background: linear-gradient(180deg, #1A1A26 0%, #11111B 100%);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 20px;
  padding: 36px 28px 28px;
  transform: translateY(14px) scale(0.985);
  transition: transform 0.4s var(--ease);
  box-shadow:
    0 30px 60px -20px rgba(0, 0, 0, 0.7),
    0 1px 0 rgba(255, 255, 255, 0.04) inset;
}

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

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  border-radius: 50%;
  color: var(--ink-soft);
  cursor: pointer;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease);
}

.modal-close:hover {
  background-color: rgba(255, 255, 255, 0.06);
  color: var(--ink);
}

.modal-close:focus-visible {
  outline: 2px solid #a48c55;
  outline-offset: 2px;
}

.modal-close svg {
  width: 16px;
  height: 16px;
}

.modal-title {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: clamp(19px, 4.6vw, 23px);
  color: var(--ink);
  margin: 0 0 24px;
  line-height: 1.3;
  letter-spacing: -0.005em;
  text-align: center;
  padding: 0 18px;
}

.modal-form .field {
  margin-bottom: 14px;
}

.modal-form .field label {
  display: block;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft);
  margin-bottom: 6px;
  letter-spacing: 0.01em;
}

.modal-form .field input {
  display: block;
  width: 100%;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  color: var(--ink);
  background-color: #2A2A36;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 12px 14px;
  outline: 0;
  transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease);
  -webkit-appearance: none;
  appearance: none;
}

.modal-form .field input::placeholder {
  color: var(--ink-mute);
}

.modal-form .field input:focus {
  border-color: #a48c55;
  background-color: #2F2F3C;
}

.modal-form .field.is-error input {
  border-color: #d94c4c;
  background-color: rgba(217, 76, 76, 0.06);
}

.modal-form .field-error {
  display: block;
  height: 0;
  overflow: hidden;
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  color: #ff8a8a;
  transition: height 0.2s var(--ease), padding-top 0.2s var(--ease);
}

.modal-form .field.is-error .field-error {
  height: 18px;
  padding-top: 6px;
}

.submit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 18px;
  padding: 14px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.02em;
  color: #FFFFFF;
  background-color: #a48c55;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  transition: background-color 0.2s var(--ease), transform 0.15s var(--ease);
}

.submit-btn:hover:not(:disabled) {
  background-color: #b69b62;
}

.submit-btn:active:not(:disabled) {
  transform: scale(0.99);
}

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

.submit-btn:disabled {
  opacity: 0.7;
  cursor: wait;
}

.submit-btn .spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.submit-btn.is-loading .spinner {
  display: inline-block;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.modal-success,
.modal-fail {
  display: none;
  text-align: center;
  padding: 12px 0 8px;
}

.modal.is-success .modal-form,
.modal.is-success .modal-title,
.modal.is-fail .modal-form,
.modal.is-fail .modal-title {
  display: none;
}

.modal.is-success .modal-success,
.modal.is-fail .modal-fail {
  display: block;
}

.modal-success .icon,
.modal-fail .icon {
  width: 58px;
  height: 58px;
  margin: 0 auto 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-success .icon {
  background-color: rgba(95, 204, 148, 0.14);
  color: #5fcc94;
}

.modal-fail .icon {
  background-color: rgba(255, 138, 138, 0.14);
  color: #ff8a8a;
}

.modal-success .icon svg,
.modal-fail .icon svg {
  width: 26px;
  height: 26px;
}

.modal-success h3,
.modal-fail h3 {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 20px;
  color: var(--ink);
  margin: 0 0 8px;
}

.modal-success p,
.modal-fail p {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.5;
  margin: 0;
}

@media (max-width: 480px) {
  .modal {
    padding: 16px;
  }
  .modal-dialog {
    padding: 30px 20px 22px;
    border-radius: 16px;
  }
  .modal-title {
    padding: 0 4px;
    margin-bottom: 20px;
  }
}
