@font-face {
  font-family: "Kaushan Script";
  src: url("assets/fonts/kaushan-script.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "DM Sans";
  src: url("assets/fonts/dm-sans.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: dark;
  /* Tipografía provisional: reemplazar esta variable cuando elijamos la definitiva. */
  --font-display: "Kaushan Script", "Segoe Print", cursive;
  --font-body: "DM Sans", sans-serif;
  --color-background: #200403;
  --color-text: #f4eedf;
  --color-muted: #ddd1bc;
  --color-line: #9d8153;
  --color-focus: #f0cd86;
  --content-width: 370px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 280px;
  background: var(--color-background);
}

body {
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  display: flex;
  align-items: center;
  padding: 64px clamp(40px, 8vw, 160px);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

.backdrop {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.backdrop__render {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 60% center;
}

.backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  /* Oscurecimiento localizado para el texto, sin desenfocar ni tapar el render. */
  background: linear-gradient(90deg, rgb(20 2 2 / 25%), transparent 52%);
}

.profile {
  position: relative;
  width: min(var(--content-width), 100%);
  animation: appear 650ms ease-out both;
}

.profile__header {
  margin-bottom: 34px;
}

h1 {
  margin: 0 0 23px -6px;
  font-family: var(--font-display);
  font-size: clamp(68px, 6.65vw, 104px);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.045em;
}

h1 span {
  display: block;
  white-space: nowrap;
}

.profile__subtitle {
  margin: 0;
  color: var(--color-muted);
  font-size: 15px;
  letter-spacing: 0.14em;
  line-height: 1.6;
}

.links {
  border-top: 1px solid var(--color-line);
}

.link {
  min-height: 56px;
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 20px 7px;
  border-bottom: 1px solid var(--color-line);
  color: var(--color-text);
  text-decoration: none;
  transition: background-color 180ms ease;
  -webkit-tap-highlight-color: rgb(244 238 223 / 12%);
}

.link__icon {
  width: 25px;
  height: 25px;
  flex: 0 0 25px;
}

.link__icon--artstation {
  width: 26px;
}

.link__label {
  line-height: 1.5;
}

.link__arrow {
  width: 21px;
  height: 21px;
  margin-left: auto;
  color: var(--color-muted);
  transition: transform 180ms ease;
}

.link:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 5px;
  background: rgb(244 238 223 / 7%);
}

.contact {
  position: relative;
}

.contact__toggle {
  cursor: pointer;
  list-style: none;
}

.contact__toggle::-webkit-details-marker {
  display: none;
}

.contact__toggle::marker {
  content: "";
}

.contact__chevron {
  width: 21px;
  height: 21px;
  margin-left: auto;
  color: var(--color-muted);
}

.contact[open] .contact__chevron {
  transform: rotate(180deg);
}

.contact[open] .contact__toggle {
  background: rgb(244 238 223 / 5%);
}

.contact__panel {
  position: absolute;
  z-index: 2;
  bottom: calc(100% + 9px);
  left: 0;
  width: 100%;
  padding: 10px 16px 15px;
  border: 1px solid var(--color-line);
  background: #240604;
  box-shadow: 0 10px 28px rgb(0 0 0 / 20%);
}

.contact__option {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 5px;
  color: var(--color-text);
  font-size: 14px;
  line-height: 1.5;
  text-decoration: none;
}

.contact__option svg {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  color: var(--color-muted);
}

.contact__option:focus-visible,
.contact__address:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

.contact__copy {
  margin-top: 7px;
  padding: 14px 5px 0;
  border-top: 1px solid rgb(157 129 83 / 50%);
}

.contact__copy label {
  display: block;
  margin-bottom: 2px;
  color: var(--color-muted);
  font-size: 12px;
  line-height: 1.5;
}

.contact__address {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 6px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  cursor: text;
  user-select: text;
}

@media (hover: hover) {
  .link:hover {
    background: rgb(244 238 223 / 5%);
  }

  .link:hover .link__arrow {
    transform: translate(2px, -2px);
  }

  .contact__option:hover {
    background: rgb(244 238 223 / 5%);
  }
}

/* Retrato: el render sigue de fondo, pero dejamos el rostro sobre el contenido. */
@media (max-width: 900px), (max-aspect-ratio: 6/5) {
  body {
    display: flow-root;
    padding: 0 30px max(30px, env(safe-area-inset-bottom));
  }

  .backdrop {
    position: absolute;
    height: clamp(510px, 75svh, 760px);
  }

  .backdrop__render {
    object-position: 55% top;
  }

  .backdrop::after {
    background: linear-gradient(
      180deg,
      transparent 32%,
      rgb(32 4 3 / 22%) 46%,
      rgb(32 4 3 / 88%) 72%,
      var(--color-background) 100%
    );
  }

  .profile {
    width: min(100%, 390px);
    margin: clamp(320px, 43svh, 460px) auto 0;
  }

  .profile__header {
    margin-bottom: 26px;
  }

  h1 {
    margin: 0 0 16px -3px;
    font-size: clamp(56px, 15.9vw, 78px);
    line-height: 1.08;
    letter-spacing: -0.035em;
  }

  .profile__subtitle {
    font-size: 12px;
    letter-spacing: 0.12em;
  }

  .link {
    gap: 18px;
    padding: 17px 5px;
    font-size: 14px;
  }

  .link__icon {
    width: 23px;
    height: 23px;
    flex-basis: 23px;
  }
}

@media (max-width: 350px) {
  body {
    padding-right: 22px;
    padding-left: 22px;
  }

  h1 {
    font-size: 52px;
  }

  .profile__subtitle {
    letter-spacing: 0.055em;
  }
}

@keyframes appear {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .profile { animation: none; }
  .link, .link__arrow { transition: none; }
  .link:hover .link__arrow { transform: none; }
}
