*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
  :root {
    --navy: #0a0e1a; --navy-mid: #0e1421; --navy-light: #1a2335;
    --gold: #c9a84c; --gold-light: #e8c97a; --gold-dim: #7a6130;
    --cream: #f5f0e8; --cream-dim: #b8ae9a; --white: #ffffff;
  }
  html { scroll-behavior: smooth; background: #0a0e1a !important; color-scheme: dark; }
  body {
    background: #0a0e1a !important;
    color: var(--cream);
    font-family: 'EB Garamond', Georgia, serif;
    font-size: 18px;
    line-height: 1.7;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 100px 24px 60px;
    position: relative;
    overflow-x: hidden;
  }
  body::before {
    content: '';
    position: fixed; inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
    pointer-events: none; z-index: 9999; opacity: 0.4;
  }
  body::after {
    content: '';
    position: fixed; inset: 0;
    background: radial-gradient(ellipse 70% 60% at 50% 40%, rgba(201,168,76,0.06) 0%, transparent 70%);
    pointer-events: none;
  }

  .back-link {
    position: fixed; top: 24px; left: 32px;
    font-size: 0.62rem; letter-spacing: 0.35em; text-transform: uppercase;
    color: var(--gold-dim); text-decoration: none;
    transition: color 0.3s;
    z-index: 100;
  }
  .back-link:hover { color: var(--gold); }

  .container {
    width: 100%; max-width: 640px;
    position: relative; z-index: 1;
  }

  .eyebrow {
    font-size: 0.6rem; letter-spacing: 0.5em; text-transform: uppercase;
    color: var(--gold); margin-bottom: 12px; text-align: center;
  }
  h1 {
    font-family: 'Cormorant Garamond', serif; font-weight: 300;
    font-size: clamp(2.2rem, 6vw, 3.4rem);
    color: var(--white); text-align: center; line-height: 1.1;
    margin-bottom: 12px;
  }
  h1 em { color: var(--gold-light); font-style: italic; }
  .intro {
    text-align: center; font-style: italic; color: var(--cream-dim);
    font-size: 0.95rem; margin-bottom: 48px; max-width: 480px; margin-left: auto; margin-right: auto;
  }
  .gold-rule { width: 40px; height: 1px; background: var(--gold); margin: 0 auto 40px; }

  .input-panel {
    border: 1px solid rgba(201,168,76,0.2);
    background: rgba(201,168,76,0.025);
    padding: 40px;
    margin-bottom: 32px;
  }
  .field-label {
    font-size: 0.6rem; letter-spacing: 0.4em; text-transform: uppercase;
    color: var(--gold); margin-bottom: 10px; display: block;
  }
  .field-sub {
    font-size: 0.8rem; font-style: italic; color: var(--cream-dim);
    margin-bottom: 20px; margin-top: -6px;
  }
  .name-input {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(201,168,76,0.3);
    padding: 10px 0;
    color: var(--cream);
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.6rem;
    font-weight: 300;
    letter-spacing: 0.05em;
    outline: none;
    transition: border-color 0.3s;
  }
  .name-input::placeholder { color: rgba(184,174,154,0.3); }
  .name-input:focus { border-bottom-color: var(--gold); }

  .assess-btn {
    width: 100%; margin-top: 28px;
    background: transparent;
    border: 1px solid rgba(201,168,76,0.4);
    padding: 14px 28px;
    color: var(--gold);
    font-family: 'EB Garamond', serif;
    font-size: 0.72rem;
    letter-spacing: 0.35em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s;
  }
  .assess-btn:hover { background: rgba(201,168,76,0.08); border-color: var(--gold); }
  .assess-btn:disabled { opacity: 0.4; cursor: not-allowed; }

  /* Result panel */
  .result-panel {
    border: 1px solid rgba(201,168,76,0.25);
    background: rgba(201,168,76,0.03);
    padding: 40px;
    display: none;
    animation: revealPanel 0.8s ease both;
  }
  .result-panel.visible { display: block; }
  @keyframes revealPanel {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
  }

  .result-header {
    display: flex; align-items: baseline; gap: 16px;
    margin-bottom: 28px; padding-bottom: 20px;
    border-bottom: 1px solid rgba(201,168,76,0.12);
  }
  .result-surname {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.8rem; font-weight: 300;
    color: var(--gold-light); flex: 1;
  }
  .result-tier-badge {
    font-size: 0.58rem; letter-spacing: 0.3em; text-transform: uppercase;
    padding: 4px 12px; border: 1px solid;
  }

  .verdict {
    font-style: italic; font-size: 1.02rem; color: var(--cream);
    margin-bottom: 28px; line-height: 1.7;
  }

  .assessment-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
    margin-bottom: 24px;
  }
  .assessment-item { }
  .assessment-key {
    font-size: 0.58rem; letter-spacing: 0.3em; text-transform: uppercase;
    color: var(--gold-dim); margin-bottom: 4px;
  }
  .assessment-val {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.1rem; color: var(--cream-dim);
  }

  .score-bar-wrap { margin-bottom: 28px; }
  .score-bar-label {
    display: flex; justify-content: space-between;
    font-size: 0.62rem; letter-spacing: 0.25em; text-transform: uppercase;
    color: var(--gold-dim); margin-bottom: 8px;
  }
  .score-track {
    height: 6px; background: rgba(255,255,255,0.04);
  }
  .score-fill {
    height: 100%; width: 0;
    transition: width 1.4s cubic-bezier(0.16,1,0.3,1);
  }

  .footnote {
    font-size: 0.72rem; font-style: italic; color: rgba(184,174,154,0.45);
    border-top: 1px solid rgba(201,168,76,0.08); padding-top: 16px;
  }

  .try-again {
    background: transparent; border: none;
    font-family: 'EB Garamond', serif;
    font-size: 0.68rem; letter-spacing: 0.3em; text-transform: uppercase;
    color: var(--gold-dim); cursor: pointer;
    margin-top: 24px; display: block; width: 100%; text-align: center;
    transition: color 0.3s;
  }
  .try-again:hover { color: var(--gold); }

  .thinking {
    display: none; text-align: center; padding: 32px;
    font-style: italic; color: var(--cream-dim); font-size: 0.9rem;
  }
  .thinking.visible { display: block; }
  .thinking-dots::after {
    content: '';
    animation: dots 1.5s infinite;
  }
  @keyframes dots {
    0%   { content: '.'; }
    33%  { content: '..'; }
    66%  { content: '...'; }
  }

  @media (max-width: 500px) {
    .input-panel, .result-panel { padding: 28px 24px; }
    .assessment-grid { grid-template-columns: 1fr; }
  }

  nav { position: fixed; top: 0; left: 0; right: 0; padding: 20px 40px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid rgba(201,168,76,0.15); background: rgba(10,14,26,0.95); backdrop-filter: blur(12px); z-index: 200; }
  .nav-logo { font-family: 'Cormorant Garamond', serif; font-size: 1.05rem; letter-spacing: 0.3em; color: var(--cream); text-transform: lowercase; text-decoration: none; }
  .nav-logo-mail { color: var(--gold); font-style: italic; }
  .nav-links { display: flex; gap: 24px; list-style: none; font-size: 0.7rem; letter-spacing: 0.25em; text-transform: uppercase; color: var(--cream-dim); align-items: center; }
  .nav-links a { color: inherit; text-decoration: none; transition: color 0.3s; }
  .nav-links a:hover { color: var(--gold); }
  .nav-dropdown { position: relative; }
  .nav-dropdown-trigger { background: none; border: none; cursor: pointer; font-family: 'EB Garamond', serif; font-size: 0.7rem; letter-spacing: 0.25em; text-transform: uppercase; color: var(--cream-dim); display: flex; align-items: center; gap: 7px; transition: color 0.3s; padding: 0; }
  .nav-dropdown-trigger:hover, .nav-dropdown-trigger.active { color: var(--gold); }
  .nav-dropdown-trigger .chevron { width: 8px; height: 5px; position: relative; flex-shrink: 0; transition: transform 0.3s; }
  .nav-dropdown-trigger .chevron::before, .nav-dropdown-trigger .chevron::after { content: ''; position: absolute; background: currentColor; height: 1px; width: 5px; top: 2px; }
  .nav-dropdown-trigger .chevron::before { left: 0; transform: rotate(35deg); transform-origin: left; }
  .nav-dropdown-trigger .chevron::after { right: 0; transform: rotate(-35deg); transform-origin: right; }
  .nav-dropdown-trigger.active .chevron { transform: rotate(180deg); }
  .dropdown-menu { position: absolute; top: calc(100% + 20px); right: 0; width: 300px; background: rgba(10,14,26,0.98); border: 1px solid rgba(201,168,76,0.2); backdrop-filter: blur(16px); opacity: 0; transform: translateY(-8px); pointer-events: none; transition: opacity 0.25s ease, transform 0.25s ease; }
  .dropdown-menu.open { opacity: 1; transform: translateY(0); pointer-events: auto; }
  .dropdown-header { padding: 18px 24px 12px; border-bottom: 1px solid rgba(201,168,76,0.1); }
  .dropdown-header-label { font-size: 0.52rem; letter-spacing: 0.45em; text-transform: uppercase; color: var(--gold-dim); }
  .dropdown-header-sub { font-size: 0.75rem; font-style: italic; color: rgba(184,174,154,0.45); margin-top: 2px; }
  .dropdown-item { display: block; text-decoration: none; padding: 16px 24px; border-bottom: 1px solid rgba(201,168,76,0.07); transition: background 0.2s; position: relative; }
  .dropdown-item:last-child { border-bottom: none; }
  .dropdown-item:hover { background: rgba(201,168,76,0.05); }
  .dropdown-item:hover .dropdown-item-arrow { opacity: 1; transform: translateX(0) translateY(-50%); }
  .dropdown-item-num { font-size: 0.5rem; letter-spacing: 0.35em; text-transform: uppercase; color: var(--gold-dim); margin-bottom: 3px; }
  .dropdown-item-title { font-family: 'Cormorant Garamond', serif; font-weight: 300; font-size: 1.05rem; color: var(--cream); line-height: 1.2; }
  .dropdown-item-title em { color: var(--gold-light); font-style: italic; }
  .dropdown-item-desc { font-size: 0.72rem; font-style: italic; color: rgba(184,174,154,0.5); margin-top: 3px; line-height: 1.4; }
  .dropdown-item-arrow { position: absolute; right: 20px; top: 50%; transform: translateX(-4px) translateY(-50%); opacity: 0; transition: all 0.2s; font-size: 0.65rem; color: var(--gold-dim); }
  @media (max-width: 500px) { nav { padding: 16px 20px; } .dropdown-menu { width: 260px; right: -10px; } }
