/*
Theme Name: Habib Parvin
Theme URI: https://habibparvin.ir/
Author: Kamyar Bateni
Description: Personal profile theme for Habib Parvin, Official Member of IGDS.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: habib-parvin
*/

:root {
  --graphite: #111310;
  --bone: #f0eee7;
  --sage: #aeb7a3;
  --sage-deep: #858f7c;
  --copper: #c7783f;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--graphite);
  color-scheme: dark;
}

body {
  min-height: 100%;
  margin: 0;
  background: var(--graphite);
  color: var(--bone);
  font-family: "Avenir Next", "Century Gothic", Futura, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

.profile-shell {
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(28rem, 48%) minmax(0, 1fr);
  overflow: hidden;
}

.identity-panel {
  position: relative;
  z-index: 2;
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: clamp(2rem, 5vh, 4.5rem);
  padding:
    max(clamp(1.4rem, 3vw, 3rem), env(safe-area-inset-top))
    max(clamp(1.4rem, 5vw, 5.5rem), env(safe-area-inset-right))
    max(clamp(1.5rem, 4vw, 4rem), env(safe-area-inset-bottom))
    max(clamp(1.4rem, 5vw, 5.5rem), env(safe-area-inset-left));
  background:
    radial-gradient(circle at 12% 88%, rgb(158 168 146 / 9%), transparent 32%),
    var(--graphite);
}

.brand-mark {
  width: fit-content;
  font-size: 0.78rem;
  font-weight: 760;
  letter-spacing: 0.16em;
}

.brand-mark span,
.link-arrow {
  color: var(--copper);
}

.identity-copy {
  align-self: end;
  padding-bottom: clamp(0.5rem, 3vh, 2.5rem);
}

.role {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin: 0 0 clamp(1.4rem, 3vh, 2.4rem);
  color: var(--sage);
  font-size: clamp(0.73rem, 0.9vw, 0.88rem);
  font-weight: 650;
  letter-spacing: 0.12em;
  line-height: 1.5;
  text-transform: uppercase;
  animation: rise 780ms cubic-bezier(0.16, 1, 0.3, 1) 120ms both;
}

.role-rule {
  width: clamp(1.6rem, 3.4vw, 3.1rem);
  height: 2px;
  background: var(--copper);
}

.profile-name {
  display: flex;
  flex-direction: column;
  margin: 0;
  color: var(--bone);
  font-size: clamp(4rem, 7.2vw, 6rem);
  font-weight: 680;
  letter-spacing: -0.04em;
  line-height: 0.82;
}

.profile-name span {
  animation: rise 900ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.profile-name span:last-child {
  color: transparent;
  -webkit-text-stroke: 1.5px rgb(240 238 231 / 86%);
  animation-delay: 80ms;
}

.contact-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1.3rem, 3vw, 3rem);
  border-top: 1px solid rgb(240 238 231 / 20%);
}

.contact-link {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "label arrow" "value arrow";
  align-items: center;
  gap: 0.25rem 1rem;
  min-height: 5.8rem;
  padding: 1rem 0;
  text-decoration: none;
}

.contact-link::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 2px;
  background: var(--copper);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 280ms cubic-bezier(0.16, 1, 0.3, 1);
}

.contact-link:hover::after,
.contact-link:focus-visible::after {
  transform: scaleX(1);
}

.contact-link:focus-visible {
  outline: 2px solid var(--copper);
  outline-offset: 6px;
}

.link-label {
  grid-area: label;
  color: var(--sage-deep);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.link-value {
  grid-area: value;
  overflow: hidden;
  font-size: clamp(0.82rem, 1vw, 1rem);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.link-arrow {
  grid-area: arrow;
  font-size: 1.2rem;
}

.portrait-panel {
  position: relative;
  min-width: 0;
  min-height: 100svh;
  margin: 0;
  overflow: hidden;
  background: #232722;
  isolation: isolate;
  animation: reveal 1000ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.portrait-panel::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  z-index: 3;
  width: 3px;
  background: var(--copper);
}

.portrait-backdrop {
  position: absolute;
  inset: -5%;
  z-index: -2;
  background: var(--portrait) center / cover no-repeat;
  filter: blur(24px) brightness(0.62) saturate(0.8);
  transform: scale(1.08);
}

.portrait-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgb(17 19 16 / 22%), transparent 26%),
    linear-gradient(0deg, rgb(17 19 16 / 48%), transparent 35%);
}

.portrait {
  width: 100%;
  height: 100svh;
  display: block;
  object-fit: contain;
  object-position: center;
  filter: contrast(1.06) saturate(0.88);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(2rem); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes reveal {
  from { clip-path: inset(0 0 0 100%); filter: blur(10px); }
  to { clip-path: inset(0); filter: blur(0); }
}

@media (max-width: 900px) {
  .profile-shell {
    grid-template-columns: 1fr;
    overflow: visible;
  }

  .portrait-panel {
    grid-row: 1;
    min-height: min(72svh, 46rem);
    border-bottom: 3px solid var(--copper);
  }

  .portrait-panel::before {
    display: none;
  }

  .portrait {
    height: min(72svh, 46rem);
  }

  .identity-panel {
    grid-row: 2;
    min-height: auto;
    gap: 4rem;
    padding-top: 2rem;
  }
}

@media (max-width: 560px) {
  .portrait-panel,
  .portrait {
    height: 64svh;
    min-height: 31rem;
  }

  .contact-nav {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .contact-link + .contact-link {
    border-top: 1px solid rgb(240 238 231 / 14%);
  }

  .profile-name {
    font-size: clamp(4rem, 21vw, 5.4rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.01ms !important;
  }
}
