*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

:root {
  --cream:       #EDE4CE;
  --gold:        #C8871E;
  --gold-light:  rgba(200, 135, 30, 0.12);
  --denim:       #4E6F9B;
  --denim-light: rgba(78, 111, 155, 0.10);
  --text:        #1E1208;
  --text-muted:  #7A6548;
  --border:      #E8DEC8;
  --surface:     #FDFAF3;
}

[data-theme="dark"] {
  --cream:       #1C110A;
  --gold:        #D4942A;
  --gold-light:  rgba(212, 148, 42, 0.14);
  --denim:       #6B8FBB;
  --denim-light: rgba(107, 143, 187, 0.12);
  --text:        #EDE4CE;
  --text-muted:  #9A8060;
  --border:      #6E4C2C;
  --surface:     #4A2E14;
}

html, body { min-height: 100%; }

body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--cream);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100svh;
  padding: 40px 16px;
}

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

main {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 320px;
}

/* ── Avatar wrap ── */
.avatar-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

/* Outer icons: drift around arc position */
@keyframes drift-1 { 0%,100% { transform: translate(-99px,-36px); } 50% { transform: translate(-106px,-44px); } }
@keyframes drift-2 { 0%,100% { transform: translate(-80px,-68px); } 50% { transform: translate(-87px,-77px); } }
@keyframes drift-3 { 0%,100% { transform: translate(-53px,-91px); } 50% { transform: translate(-58px,-100px); } }
@keyframes drift-4 { 0%,100% { transform: translate(-18px,-103px); } 50% { transform: translate(-14px,-112px); } }
@keyframes drift-5 { 0%,100% { transform: translate(18px,-103px); } 50% { transform: translate(22px,-112px); } }
@keyframes drift-6 { 0%,100% { transform: translate(53px,-91px); } 50% { transform: translate(58px,-100px); } }
@keyframes drift-7 { 0%,100% { transform: translate(80px,-68px); } 50% { transform: translate(87px,-77px); } }
@keyframes drift-8 { 0%,100% { transform: translate(99px,-36px); } 50% { transform: translate(106px,-44px); } }

.topic-icon {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

/* Per-icon colours + depth-matched drop shadows */
.topic-icon--1 { color: rgba(200, 135, 30,  0.6); }
.topic-icon--2 { color: rgba(60,  110, 170, 0.6); }
.topic-icon--3 { color: rgba(196, 80,  55,  0.6); }
.topic-icon--4 { color: rgba(55,  140, 85,  0.6); }
.topic-icon--5 { color: rgba(115, 75,  175, 0.6); }
.topic-icon--6 { color: rgba(35,  140, 140, 0.6); }
.topic-icon--7 { color: rgba(185, 135, 20,  0.6); }
.topic-icon--8 { color: rgba(140, 80,  35,  0.6); }

/* Shadows scale with depth: far=faint/tight, close=soft/spread */
.topic-icon--1 .topic-icon-inner { filter: blur(var(--dof, 0px)) drop-shadow(0 3px 6px rgba(0,0,0,0.22)); }
.topic-icon--2 .topic-icon-inner { filter: blur(var(--dof, 0px)) drop-shadow(0 4px 10px rgba(0,0,0,0.28)); }
.topic-icon--3 .topic-icon-inner { filter: blur(var(--dof, 0px)) drop-shadow(0 3px 8px rgba(0,0,0,0.24)); }
.topic-icon--4 .topic-icon-inner { filter: blur(var(--dof, 0px)) drop-shadow(0 6px 16px rgba(0,0,0,0.34)); }
.topic-icon--5 .topic-icon-inner { filter: blur(var(--dof, 0px)) drop-shadow(0 3px 8px rgba(0,0,0,0.24)); }
.topic-icon--6 .topic-icon-inner { filter: blur(var(--dof, 0px)) drop-shadow(0 5px 12px rgba(0,0,0,0.30)); }
.topic-icon--7 .topic-icon-inner { filter: blur(var(--dof, 0px)) drop-shadow(0 3px 7px rgba(0,0,0,0.22)); }
.topic-icon--8 .topic-icon-inner { filter: blur(var(--dof, 0px)) drop-shadow(0 3px 6px rgba(0,0,0,0.22)); }

.topic-icon-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  scale: 0.1;
  translate: var(--px, 0px) var(--py, 0px);
  filter: blur(var(--dof, 0px));
  transition:
    opacity 0.3s ease var(--td, 0s),
    scale 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) var(--td, 0s),
    translate 0.08s ease,
    filter 0.3s ease var(--td, 0s);
}
.topic-icon-inner svg { width: 28px; height: 28px; }

/* depth-of-field & depth-scale per icon */
.topic-icon--1 .topic-icon-inner { --dof: 2px;   --ds: 0.82; --td: 0s;     }
.topic-icon--2 .topic-icon-inner { --dof: 0.8px; --ds: 1.0;  --td: 0.05s;  }
.topic-icon--3 .topic-icon-inner { --dof: 1.2px; --ds: 0.9;  --td: 0.1s;   }
.topic-icon--4 .topic-icon-inner { --dof: 0px;   --ds: 1.2;  --td: 0.15s;  }
.topic-icon--5 .topic-icon-inner { --dof: 1.0px; --ds: 0.93; --td: 0.2s;   }
.topic-icon--6 .topic-icon-inner { --dof: 0.5px; --ds: 1.06; --td: 0.25s;  }
.topic-icon--7 .topic-icon-inner { --dof: 1.6px; --ds: 0.85; --td: 0.3s;   }
.topic-icon--8 .topic-icon-inner { --dof: 1.8px; --ds: 0.83; --td: 0.05s;  }

.topic-icon--1 { animation: drift-1 5.8s ease-in-out infinite; animation-delay: -1.1s; }
.topic-icon--2 { animation: drift-2 6.4s ease-in-out infinite; animation-delay: -3.5s; }
.topic-icon--3 { animation: drift-3 5.2s ease-in-out infinite; animation-delay: -0.8s; }
.topic-icon--4 { animation: drift-4 6.9s ease-in-out infinite; animation-delay: -4.0s; }
.topic-icon--5 { animation: drift-5 5.6s ease-in-out infinite; animation-delay: -2.2s; }
.topic-icon--6 { animation: drift-6 6.1s ease-in-out infinite; animation-delay: -0.4s; }
.topic-icon--7 { animation: drift-7 5.4s ease-in-out infinite; animation-delay: -3.0s; }
.topic-icon--8 { animation: drift-8 6.2s ease-in-out infinite; animation-delay: -1.7s; }

.avatar-wrap:hover .topic-icon-inner {
  opacity: 1;
  scale: var(--ds, 1);
}

/* ── Avatar ── */
.avatar-ring {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  padding: 3px;
  background: conic-gradient(
    var(--gold) 0deg,
    #E8A832 90deg,
    var(--gold) 180deg,
    #A66912 270deg,
    var(--gold) 360deg
  );
  box-shadow: 0 0 0 5px var(--gold-light);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.35s ease;
}

.avatar-wrap:hover .avatar-ring {
  transform: translateY(-6px);
  box-shadow: 0 0 0 5px var(--gold-light), 0 16px 32px rgba(30, 18, 8, 0.22);
}

.avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  display: block;
  background: var(--border);
}

.avatar-placeholder {
  background: var(--gold-light);
  color: var(--gold);
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -1px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Name & title ── */
.name {
  font-family: 'Katahdin Round', Georgia, serif;
  font-size: 26px;
  font-weight: 400;
  letter-spacing: -0.4px;
  color: var(--text);
  text-align: center;
}

.title {
  font-family: Georgia, serif;
  font-size: 15px;
  font-weight: 400;
  color: #A87B3A;
  text-align: center;
  line-height: 1.3;
  margin-top: 6px;
  margin-bottom: 10px;
}

.disciplines {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 2px;
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--text-muted);
  opacity: 0.7;
  margin-bottom: 24px;
  max-width: 280px;
  text-align: center;
}
.disciplines span + span::before {
  content: ' · ';
  margin: 0 3px;
  opacity: 0.5;
}

/* ── Chips ── */
.chips {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
}

.chip {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, transform 0.1s, box-shadow 0.15s;
}

.chip svg { width: 18px; height: 18px; }

.chip:hover {
  background: var(--gold-light);
  border-color: var(--gold);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(200, 135, 30, 0.15);
}

.chip:active { transform: translateY(0); }

.chip.active {
  background: var(--gold-light);
  border-color: var(--gold);
}

.chip--denim {
  color: var(--denim);
}
.chip--denim:hover {
  background: var(--denim-light);
  border-color: var(--denim);
  box-shadow: 0 4px 12px rgba(78, 111, 155, 0.15);
}

.chip--muted {
  color: var(--text-muted);
  opacity: 0.45;
  cursor: default;
  pointer-events: none;
}

#theme-toggle {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 5;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-muted);
  opacity: 0.35;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s ease;
}
#theme-toggle svg { width: 16px; height: 16px; }
#theme-toggle:hover { opacity: 0.8; }

/* ── Modal ── */
#modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(30, 18, 8, 0.4);
  backdrop-filter: blur(4px);
  z-index: 10;
  animation: fade-in 0.2s ease;
}

@keyframes fade-in  { from { opacity: 0; } to { opacity: 1; } }
@keyframes slide-up { from { opacity: 0; transform: translateY(16px) scale(0.97); } to { opacity: 1; transform: none; } }

dialog#contact-modal {
  position: fixed;
  inset: 0;
  margin: auto;
  width: calc(100% - 32px);
  max-width: 480px;
  max-height: calc(100svh - 48px);
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 32px;
  z-index: 11;
  display: none;
  flex-direction: column;
  gap: 18px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.18);
  animation: slide-up 0.22s ease;
}

dialog#contact-modal[open] { display: flex; }

/* hide native backdrop */
dialog#contact-modal::backdrop { display: none; }

.modal-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.2px;
}

#modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--cream);
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}
#modal-close:hover { background: var(--border); color: var(--text); }

/* ── Contact form ── */
#contact-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.field label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
}

.field input,
.field textarea {
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  padding: 12px 14px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  resize: none;
  width: 100%;
}

.field input::placeholder,
.field textarea::placeholder { color: var(--text-muted); }

.field input:focus,
.field textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-light);
}

.btn-submit {
  width: 100%;
  padding: 11px 16px;
  background: var(--gold);
  border: none;
  border-radius: 999px;
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}
.btn-submit:hover:not(:disabled) { opacity: 0.88; }
.btn-submit:disabled { opacity: 0.5; cursor: not-allowed; }

#form-status {
  font-size: 13px;
  text-align: center;
  padding: 8px;
  border-radius: 8px;
}
.status-ok  { color: #3a7d44; background: #eaf5ec; }
.status-err { color: #b94040; background: #fdf0f0; }

/* Hide floating reCAPTCHA badge; attribution shown inline per Google policy */
.grecaptcha-badge { visibility: hidden !important; }

.recaptcha-notice {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
}
.recaptcha-notice a {
  color: var(--text-muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}
