/* Amin Amerian — modern minimal */

:root {
  --color-bg: #f7f6f3;
  --color-fg: #141413;
  --color-muted: #5c5a55;
  --color-border: #e2e0da;
  --color-accent: #0f766e;
  --color-on-accent: #ffffff;
  --color-hero-text: #fafaf8;
  --color-hero-muted: rgba(250, 250, 248, 0.82);

  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Archivo", system-ui, sans-serif;

  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 4rem;
  --space-2xl: 7rem;

  --max-width: 68rem;
  --radius: 0.25rem;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --duration: 280ms;
}

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

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--color-fg);
  background:
    radial-gradient(ellipse 80% 50% at 100% 0%, rgba(15, 118, 110, 0.06), transparent 55%),
    radial-gradient(ellipse 60% 40% at 0% 100%, rgba(20, 20, 19, 0.04), transparent 50%),
    var(--color-bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
}

.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-sm);
  z-index: 100;
  padding: 0.75rem 1rem;
  background: var(--color-fg);
  color: var(--color-bg);
  text-decoration: none;
  border-radius: var(--radius);
}

.skip-link:focus {
  top: var(--space-sm);
}

/* —— Hero —— */

.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: clamp(1.5rem, 4vw, 3rem);
  color: var(--color-hero-text);
  overflow: hidden;
  text-align: center;
  --scroll-progress: 0;
}

.hero__media {
  position: absolute;
  inset: 0;
  background-color: #1a1a18;
  background-size: cover;
  background-position: 50% 50%;
  transform: scale(calc(1.06 + var(--scroll-progress) * 0.08));
  filter: saturate(calc(1 - var(--scroll-progress) * 0.55)) brightness(calc(1 + var(--scroll-progress) * 0.12));
  animation: hero-drift 28s var(--ease) infinite alternate;
  will-change: transform, filter, background-position;
}

.hero__veil {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      180deg,
      rgba(10, 12, 11, 0.4) 0%,
      rgba(10, 12, 11, 0.5) 45%,
      rgba(10, 12, 11, 0.72) 100%
    );
  opacity: calc(1 - var(--scroll-progress) * 0.55);
  transition: opacity 80ms linear;
}

.hero__content {
  position: relative;
  z-index: 1;
  max-width: 46rem;
  width: 100%;
  opacity: calc(1 - var(--scroll-progress) * 0.85);
  transform: translate3d(0, calc(var(--scroll-progress) * -2.5rem), 0) scale(calc(1 - var(--scroll-progress) * 0.04));
  will-change: opacity, transform;
}

.hero__name {
  margin: 0 0 var(--space-md);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.75rem, 9vw, 5.25rem);
  line-height: 1;
  letter-spacing: -0.04em;
}

.hero__lede {
  margin: 0 auto var(--space-lg);
  max-width: 36rem;
  font-family: var(--font-body);
  font-size: clamp(1rem, 2.1vw, 1.15rem);
  font-weight: 300;
  line-height: 1.65;
  color: var(--color-hero-muted);
}

.hero__lede span {
  color: var(--color-hero-text);
  font-weight: 500;
}

.hero__lede #experience-years {
  font-size: 1.35em;
  font-weight: 600;
  color: var(--color-hero-text);
}

.social {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.social a {
  --mx: 0px;
  --my: 0px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid rgba(250, 250, 248, 0.35);
  border-radius: 50%;
  color: var(--color-hero-text);
  text-decoration: none;
  cursor: pointer;
  transform: translate3d(var(--mx), var(--my), 0);
  transition:
    background-color var(--duration) var(--ease),
    border-color var(--duration) var(--ease),
    transform 160ms var(--ease);
}

.social a:hover {
  background: rgba(250, 250, 248, 0.12);
  border-color: rgba(250, 250, 248, 0.75);
}

.social a:focus-visible {
  outline: 2px solid var(--color-hero-text);
  outline-offset: 3px;
}

.social svg {
  width: 1.15rem;
  height: 1.15rem;
}

.social .icon-telegram {
  width: 1.35rem;
  height: 1.35rem;
}

.hero__scroll {
  position: absolute;
  z-index: 1;
  left: 50%;
  bottom: clamp(1.25rem, 4vh, 2.25rem);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  width: 1.5rem;
  height: 3rem;
  transform: translateX(-50%);
  text-decoration: none;
}

.hero__scroll-line {
  display: block;
  width: 1px;
  height: 100%;
  background: linear-gradient(to bottom, transparent, rgba(250, 250, 248, 0.85));
  transform-origin: top;
  animation: scroll-pulse 2.2s var(--ease) infinite;
}

/* —— Lower (about + footer) —— */

.lower {
  position: relative;
  background:
    linear-gradient(180deg, #ebe8e1 0%, var(--color-bg) 18%, #f4f2ec 100%);
  overflow: hidden;
  --arrive: 0;
  opacity: calc(0.72 + var(--arrive) * 0.28);
  transform: translate3d(0, calc((1 - var(--arrive)) * 1.75rem), 0);
  will-change: opacity, transform;
}

.about {
  position: relative;
  padding: clamp(4.5rem, 12vw, 8rem) clamp(1.5rem, 4vw, 3rem) clamp(3rem, 8vw, 5rem);
  overflow: hidden;
}

.about__glow {
  position: absolute;
  inset: auto;
  top: -18%;
  right: 0;
  width: min(36rem, 70vw);
  height: min(36rem, 70vw);
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(125, 160, 145, 0.16) 0%, rgba(15, 118, 110, 0.05) 42%, transparent 70%);
  pointer-events: none;
  animation: glow-live 10s ease-in-out infinite alternate;
  will-change: transform, opacity;
}

.about__grid {
  position: relative;
  z-index: 1;
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  gap: clamp(2.5rem, 6vw, 4.5rem);
  align-items: center;
}

@media (min-width: 840px) {
  .about__grid {
    grid-template-columns: minmax(14rem, 17.5rem) minmax(0, 1fr);
    gap: clamp(3rem, 7vw, 5.5rem);
  }
}

.about__portrait {
  position: relative;
  margin: 0;
  width: min(100%, 15.5rem);
  justify-self: center;
  isolation: isolate;
}

@media (min-width: 840px) {
  .about__portrait {
    justify-self: start;
  }
}

/* Subtle continuous focus around the circular photo */
.about__ripple {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.about__ripple span {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(15, 118, 110, 0.28);
  opacity: 0;
  animation: ripple-wave 5.5s ease-out infinite;
}

.about__ripple span:nth-child(2) {
  animation-delay: 2.75s;
  border-color: rgba(15, 118, 110, 0.18);
}

/* Circular photo + drifting light */
.profile-wrap {
  position: relative;
  z-index: 1;
  border-radius: 50%;
  overflow: hidden;
  box-shadow:
    0 0 0 0.3rem rgba(247, 246, 243, 0.98),
    0 0 0 0.32rem rgba(15, 118, 110, 0.16),
    0 0.75rem 1.75rem rgba(20, 20, 19, 0.08);
}

.profile-pic {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 50%;
  background: transparent;
  display: block;
}

.profile-light {
  position: absolute;
  inset: -20%;
  border-radius: 50%;
  background:
    radial-gradient(
      circle at 30% 25%,
      rgba(255, 255, 255, 0.42) 0%,
      rgba(255, 255, 255, 0.1) 22%,
      transparent 48%
    );
  mix-blend-mode: soft-light;
  pointer-events: none;
  animation: light-drift 9s ease-in-out infinite alternate;
  will-change: transform;
}

.about__eyebrow {
  margin: 0 0 var(--space-sm);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-accent);
}

.section-title {
  margin: 0 0 var(--space-lg);
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.2vw, 3rem);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.08;
  max-width: 16ch;
}

.about__body {
  display: grid;
  gap: 1rem;
  max-width: 36rem;
  border-left: 2px solid rgba(15, 118, 110, 0.28);
  padding-left: 1.25rem;
}

.about__body p {
  margin: 0;
  color: var(--color-muted);
  font-size: 1.05rem;
  line-height: 1.7;
}

.about__body p:first-child {
  color: var(--color-fg);
  font-size: 1.125rem;
  font-weight: 500;
}

/* —— Footer —— */

.site-footer {
  position: relative;
  z-index: 1;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-md) clamp(1.5rem, 4vw, 3rem) var(--space-xl);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  border-top: 1px solid rgba(20, 20, 19, 0.08);
  font-size: 0.875rem;
  color: var(--color-muted);
  background: transparent;
}

.site-footer p {
  margin: 0;
}

.site-footer__top {
  text-decoration: none;
  color: var(--color-fg);
  font-weight: 500;
  border-bottom: 1px solid transparent;
  transition: border-color var(--duration) var(--ease), color var(--duration) var(--ease);
  cursor: pointer;
}

.site-footer__top:hover {
  color: var(--color-accent);
  border-bottom-color: var(--color-accent);
}

.site-footer__top:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

/* —— Motion —— */

.reveal {
  opacity: 0;
  transform: translateY(1.25rem);
  transition:
    opacity 0.7s var(--ease),
    transform 0.7s var(--ease);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.hero .reveal:nth-child(1) { transition-delay: 0.05s; }
.hero .reveal:nth-child(2) { transition-delay: 0.18s; }
.hero .reveal:nth-child(3) { transition-delay: 0.32s; }

.about__portrait.reveal { transition-delay: 0.05s; }
.about__copy .reveal:nth-child(1) { transition-delay: 0.1s; }
.about__copy .reveal:nth-child(2) { transition-delay: 0.18s; }
.about__copy .reveal:nth-child(3) { transition-delay: 0.26s; }
.about__copy .reveal:nth-child(4) { transition-delay: 0.34s; }

@keyframes hero-drift {
  from { background-position: 50% 50%; }
  to { background-position: 46% 54%; }
}

@keyframes scroll-pulse {
  0%, 100% { transform: scaleY(0.55); opacity: 0.45; }
  50% { transform: scaleY(1); opacity: 1; }
}

@keyframes glow-live {
  from {
    opacity: 0.55;
    transform: scale(1) translate3d(0, 0, 0);
  }
  to {
    opacity: 1;
    transform: scale(1.06) translate3d(-2%, 3%, 0);
  }
}

@keyframes ripple-wave {
  0% {
    opacity: 0.45;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(1.28);
  }
}

@keyframes light-drift {
  from { transform: translate3d(-8%, -4%, 0) rotate(0deg); }
  to { transform: translate3d(14%, 10%, 0) rotate(18deg); }
}

@media (prefers-reduced-motion: reduce) {
  .hero__media {
    animation: none;
    transform: none;
    filter: none;
    background-position: center;
  }

  .hero__veil,
  .hero__content,
  .lower {
    opacity: 1;
    transform: none;
  }

  .hero__scroll-line {
    animation: none;
  }

  .about__glow,
  .about__ripple span,
  .profile-light {
    animation: none;
  }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .social a {
    transition: background-color var(--duration) var(--ease), border-color var(--duration) var(--ease);
  }
}
