:root {
  --ink: #f5f5f0;
  --dim: #e8e8e8;
  --rule: #d8d8d8;
  --bone: #0a0a0a;
  --ash: #4a4a4a;
  --mist: #d8d8d8;
  --accent: #c0392b;
  --verified: #2d6a4f;
  --unverified: #7a1e1e;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  background: var(--ink);
  color: var(--bone);
  font-family: 'IM Fell English', Georgia, serif;
  overflow-x: hidden;
  cursor: crosshair;
  min-height: 100vh;
}

/* NOISE */
.noise-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  pointer-events: none;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
}

/* SCROLL PROGRESS */
#progress-line {
  position: fixed;
  top: 0; left: 0;
  height: 1px;
  width: 0%;
  background: var(--accent);
  z-index: 8999;
  transition: width 0.1s linear;
}


#not-auth {
  position: fixed;
  inset: 0;
  background: #f5f5f0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.not-auth-inner {
  text-align: center;
  max-width: 400px;
  padding: 40px;
}

.not-auth-label {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(5rem, 15vw, 9rem);
  letter-spacing: 0.1em;
  color: transparent;
  -webkit-text-stroke: 1px #c0c0c0;
  line-height: 1;
  margin-bottom: 20px;
}

.not-auth-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2rem;
  letter-spacing: 0.2em;
  color: var(--bone);
  margin-bottom: 12px;
}

.not-auth-body {
  font-family: 'Space Mono', monospace;
  font-size: 0.65rem;
  color: var(--ash);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  line-height: 2;
  margin-bottom: 40px;
}

.auth-btn {
  display: inline-block;
  font-family: 'Space Mono', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--ash);
  text-decoration: none;
  border: 1px solid #c0c0c0;
  padding: 14px 36px;
  transition: all 0.3s ease;
}

.auth-btn:hover {
  color: var(--bone);
  border-color: #a0a0a0;
}


#nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 500;
  padding: 24px 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid transparent;
  transition: border-color 0.4s, background 0.4s;
}

#nav.scrolled {
  border-color: var(--rule);
  background: rgba(245,245,240,0.95);
  backdrop-filter: blur(12px);
}

.nav-logo {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.4rem;
  letter-spacing: 0.2em;
  color: var(--bone);
  text-decoration: none;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 20px;
}


.settings-menu {
  position: relative;
}

.settings-toggle {
  width: 40px;
  height: 40px;
  background: transparent;
  border: 1px solid #c0c0c0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  color: var(--ash);
}

.settings-toggle:hover,
.settings-toggle[aria-expanded="true"] {
  border-color: #a0a0a0;
  color: var(--bone);
}

.settings-dropdown {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  background: var(--dim);
  border: 1px solid var(--rule);
  padding: 24px;
  width: 280px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 600;
}

.settings-dropdown.open {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}

.dropdown-label {
  font-family: 'Space Mono', monospace;
  font-size: 0.55rem;
  color: #4a4a4a;
  letter-spacing: 0.5em;
  text-transform: uppercase;
  margin-bottom: 20px;
}

.settings-row {
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.settings-row-label {
  font-family: 'Space Mono', monospace;
  font-size: 0.55rem;
  color: var(--ash);
  letter-spacing: 0.3em;
  text-transform: uppercase;
}

.settings-row input[type="text"] {
  width: 100%;
  padding: 10px 0;
  background: transparent;
  border: none;
  border-bottom: 1px solid #d8d8d8;
  color: var(--bone);
  font-family: 'Space Mono', monospace;
  font-size: 0.75rem;
  outline: none;
  transition: border-color 0.3s;
  letter-spacing: 0.05em;
}

.settings-row input[type="text"]::placeholder { color: #b0b0b0; }
.settings-row input[type="text"]:focus { border-color: #a0a0a0; }

.settings-action-btn {
  width: 100%;
  padding: 10px 0;
  background: transparent;
  border: none;
  border-bottom: 1px solid #d8d8d8;
  color: var(--ash);
  font-family: 'Space Mono', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  cursor: pointer;
  text-align: left;
  transition: color 0.3s, border-color 0.3s;
}

.settings-action-btn:hover { color: var(--bone); border-color: #a0a0a0; }

.settings-action-btn--ghost {
  margin-bottom: 4px;
  border-bottom: 1px solid #d8d8d8;
}

.settings-action-btn--danger { color: #5a1a1a; }
.settings-action-btn--danger:hover { color: var(--accent); }

.settings-divider {
  height: 1px;
  background: var(--rule);
  margin: 16px 0;
}


#message-container {
  position: fixed;
  top: 80px;
  right: 32px;
  z-index: 700;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.msg-toast {
  font-family: 'Space Mono', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 12px 20px;
  background: var(--dim);
  border: 1px solid #d0d0d0;
  color: #4a7a5a;
  border-color: #d0d0d0;
  animation: toast-in 0.3s ease forwards;
  pointer-events: none;
}

.msg-toast--error {
  color: #7a3030;
  border-color: #e0d0d0;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateX(12px); }
  to { opacity: 1; transform: translateX(0); }
}


#profile-hero {
  padding: 160px 48px 100px;
  border-bottom: 1px solid var(--rule);
}

.profile-hero-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: flex-start;
  gap: 60px;
}

.avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.avatar {
  width: 110px;
  height: 110px;
  background: var(--dim);
  border: 1px solid var(--rule);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 3rem;
  letter-spacing: 0.05em;
  color: #b0b0b0;
  overflow: hidden;
}

.avatar-edit {
  position: absolute;
  bottom: 0; right: 0;
  width: 28px; height: 28px;
  background: var(--ink);
  border: 1px solid #d8d8d8;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--ash);
  transition: all 0.3s;
}

.avatar-edit:hover { border-color: #c0c0c0; color: var(--bone); }

.avatar-save-btn {
  margin-top: 10px;
  width: 100%;
  padding: 8px 0;
  background: transparent;
  border: 1px solid #d8d8d8;
  color: var(--ash);
  font-family: 'Space Mono', monospace;
  font-size: 0.55rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.3s;
}

.avatar-save-btn:hover { border-color: #c0c0c0; color: var(--bone); }

.profile-identity {
  flex: 1;
  padding-top: 8px;
}

.profile-num {
  font-family: 'Space Mono', monospace;
  font-size: 0.55rem;
  color: #a0a0a0;
  letter-spacing: 0.5em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.profile-name-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.profile-name {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(3rem, 7vw, 5.5rem);
  letter-spacing: 0.08em;
  color: var(--bone);
  line-height: 1;
}

.inline-edit {
  background: transparent;
  border: none;
  color: #a0a0a0;
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 4px;
  transition: color 0.3s;
}

.inline-edit:hover { color: var(--ash); }

.profile-status {
  font-family: 'Space Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ash);
}

.profile-status[data-verified="true"] { color: #2d5a3f; }
.profile-status[data-verified="false"] { color: #5a2020; }


#profile-details {
  max-width: 900px;
  margin: 0 auto;
  padding: 100px 48px;
  border-bottom: 1px solid var(--rule);
}

.section-num {
  font-family: 'Space Mono', monospace;
  font-size: 0.55rem;
  color: #a0a0a0;
  letter-spacing: 0.5em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 60px;
}

.section-num::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--rule);
}

.details-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--rule);
}

.detail-cell {
  background: var(--ink);
  padding: 40px 32px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.detail-label {
  font-family: 'Space Mono', monospace;
  font-size: 0.55rem;
  color: #a0a0a0;
  letter-spacing: 0.4em;
  text-transform: uppercase;
}

.detail-value {
  font-family: 'IM Fell English', serif;
  font-size: clamp(0.9rem, 1.5vw, 1.1rem);
  color: var(--ash);
  line-height: 1.5;
  word-break: break-all;
}

#verified-status[data-verified="true"] { color: #2d6a4f; }
#verified-status[data-verified="false"] { color: #7a1e1e; }


footer {
  max-width: 900px;
  margin: 0 auto;
  padding: 70px 48px 50px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
}

.footer-logo {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  letter-spacing: 0.08em;
  color: transparent;
  -webkit-text-stroke: 1px #d0d0d0;
  display: block;
  line-height: 1;
  margin-bottom: 16px;
}

.footer-copy {
  font-family: 'Space Mono', monospace;
  font-size: 0.55rem;
  color: #a0a0a0;
  letter-spacing: 0.3em;
  text-transform: uppercase;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-end;
}

.footer-links a {
  font-family: 'Space Mono', monospace;
  font-size: 0.55rem;
  color: #a0a0a0;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  text-decoration: none;
  transition: color 0.3s;
}

.footer-links a:hover { color: var(--ash); }


@media (max-width: 768px) {
  #nav { padding: 20px 24px; }
  #profile-hero { padding: 120px 24px 80px; }
  .profile-hero-inner { flex-direction: column; align-items: center; text-align: center; gap: 32px; }
  .profile-name-row { justify-content: center; }
  #profile-details { padding: 80px 24px; }
  .details-grid { grid-template-columns: 1fr; }
  footer { flex-direction: column; gap: 40px; padding: 60px 24px 40px; }
  .footer-right { align-self: flex-start; }
  .footer-links { align-items: flex-start; }
  .settings-dropdown { right: 0; width: calc(100vw - 48px); }
  #message-container { right: 16px; left: 16px; }
}

@media (max-width: 480px) {
  .avatar { width: 80px; height: 80px; font-size: 2.2rem; }
  .profile-name { font-size: 2.5rem; }
}