:root {
  color-scheme: dark;
  --surface: #17120e;
  --surface-raised: #211a14;
  --line: #3a2f26;
  --line-strong: #66503a;
  --text: #f4efe8;
  --muted: #b8a895;
  --signal: #c08e3a;
  --sans: "Trebuchet MS", "Segoe UI", Arial, sans-serif;
  --display: "Palatino Linotype", "Book Antiqua", Georgia, serif;
}

* { box-sizing: border-box; }

html {
  min-width: 320px;
  background: var(--surface);
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 78% 10%, rgba(174, 119, 61, .10), transparent 28rem),
    var(--surface);
  color: var(--text);
  font-family: var(--sans);
}

a, button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 3px;
}

.profile-shell {
  min-height: 100vh;
  padding: 0 clamp(24px, 6vw, 88px);
}

.topbar {
  display: flex;
  min-height: 82px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.wordmark {
  color: var(--text);
  font-family: var(--display);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -.065em;
  text-decoration: none;
}

.wordmark span { color: var(--signal); }

.topbar nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.topbar nav a {
  color: var(--muted);
  font-size: 13px;
  text-decoration: none;
}

.topbar nav a:hover { color: var(--text); }

.topbar nav button {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 12px;
}

.profile-login {
  max-width: 840px;
  min-height: calc(100vh - 146px);
  margin: 0 auto;
  padding: clamp(80px, 14vh, 150px) 0;
}

.eyebrow {
  margin: 0 0 14px;
  color: #d4a469;
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
}

h1, h2, p { margin-top: 0; }

.profile-login h1,
.profile-heading h1 {
  margin: 0;
  font-family: var(--display);
  font-weight: 500;
  letter-spacing: -.055em;
  line-height: .96;
}

.profile-login h1 {
  max-width: 760px;
  font-size: clamp(56px, 8vw, 104px);
}

.profile-login h1 span,
.profile-heading h1 span { color: #d9ad75; }

.profile-login > p:not(.eyebrow) {
  max-width: 480px;
  margin: 24px 0 30px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.75;
}

.primary-button {
  display: inline-flex;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  padding: 0 22px;
  border: 1px solid #d49b56;
  border-radius: 999px;
  background: #d49b56;
  color: #20150e;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.profile-content {
  max-width: 1120px;
  margin: 0 auto;
  padding: clamp(54px, 8vw, 92px) 0 100px;
}

.profile-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 34px;
}

.profile-heading h1 {
  max-width: 760px;
  font-size: clamp(52px, 8vw, 92px);
}

.subscription-state {
  display: flex;
  min-width: 190px;
  min-height: 44px;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
}

.subscription-state > span {
  width: 8px;
  height: 8px;
  border: 1px solid var(--muted);
  border-radius: 50%;
}

.subscription-state[data-active="true"] {
  border-color: #7d9867;
  color: #bed1a8;
}

.subscription-state[data-active="true"] > span {
  border-color: #99b17f;
  background: #99b17f;
  box-shadow: 0 0 18px rgba(153, 177, 127, .4);
}

.profile-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, .55fr);
  gap: 18px;
}

.skin-card,
.info-card {
  border: 1px solid var(--line);
  background: rgba(33, 26, 20, .72);
}

.skin-card {
  display: grid;
  grid-template-columns: minmax(250px, 1fr) minmax(220px, .75fr);
  min-height: 540px;
  overflow: hidden;
}

.skin-preview {
  position: relative;
  display: grid;
  min-height: 540px;
  place-items: center;
  overflow: hidden;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(rgba(216, 188, 145, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(216, 188, 145, .035) 1px, transparent 1px),
    radial-gradient(circle at 50% 46%, #6b4d34 0, #37281e 32%, #17120e 68%);
  background-size: 32px 32px, 32px 32px, auto;
}

#skin-canvas {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  max-width: 430px;
  max-height: 500px;
  filter: drop-shadow(0 28px 22px rgba(0, 0, 0, .32));
}

.skin-orbit {
  position: absolute;
  bottom: 70px;
  width: 280px;
  height: 46px;
  border: 1px solid rgba(218, 179, 130, .18);
  border-radius: 50%;
  box-shadow: 0 0 40px rgba(216, 173, 118, .08);
  transform: rotate(-4deg);
}

.skin-controls {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 14px;
  padding: 28px;
}

.skin-controls h2,
.info-card h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -.035em;
}

.model-field {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
}

.model-field select {
  width: 100%;
  height: 46px;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  background: var(--surface);
  color: var(--text);
}

.upload-button {
  display: grid;
  min-height: 48px;
  place-items: center;
  border: 1px solid #d49b56;
  border-radius: 999px;
  background: #d49b56;
  color: #20150e;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

.upload-button input { position: absolute; width: 1px; height: 1px; opacity: 0; }

.details-column {
  display: grid;
  align-content: start;
  gap: 18px;
}

.info-card {
  padding: 26px;
}

.info-card dl {
  display: grid;
  gap: 0;
  margin: 18px 0 0;
}

.info-card dl div {
  display: grid;
  grid-template-columns: 105px minmax(0, 1fr);
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.info-card dt {
  color: var(--muted);
  font-size: 11px;
}

.info-card dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 12px;
}

.card-heading { margin-bottom: 14px; }

.social-row {
  display: flex;
  min-height: 64px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
}

.social-row div {
  display: grid;
  gap: 3px;
}

.social-row strong { font-size: 13px; }

.social-state,
.binding-note,
.status {
  color: var(--muted);
  font-size: 11px;
}

.social-state[data-linked="true"] { color: #bed1a8; }

.social-row button {
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 11px;
}

.binding-note {
  margin: 14px 0 0;
  line-height: 1.55;
}

.status {
  min-height: 18px;
  margin: 12px 0 0;
}

footer {
  display: flex;
  min-height: 64px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
}

[hidden] { display: none !important; }

@media (max-width: 900px) {
  .profile-grid { grid-template-columns: 1fr; }
  .details-column { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 680px) {
  .profile-shell { padding: 0 20px; }
  .topbar { min-height: 72px; }
  .topbar nav { gap: 14px; }
  .topbar nav a:first-child { display: none; }
  .profile-heading {
    align-items: start;
    flex-direction: column;
  }
  .profile-heading h1 { font-size: clamp(48px, 14vw, 72px); }
  .subscription-state { min-width: 0; }
  .skin-card { grid-template-columns: 1fr; }
  .skin-preview {
    min-height: 430px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  #skin-canvas { max-height: 390px; }
  .details-column { grid-template-columns: 1fr; }
  footer { align-items: flex-start; flex-direction: column; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}
