/* =========================================================================
   Amin Izadyar — aminizadyar.github.io
   Single-page dark theme. No JavaScript, no build step.
   ========================================================================= */

:root {
  color-scheme: dark;

  /* palette */
  --bg:          #0B0F14;
  --bg-elev:     #11161D;
  --border:      #1E2630;
  --text:        #E8EAED;
  --text-soft:   #C7CFD8;
  --muted:       #9AA5B1;
  --accent:      #C9A86A;
  --accent-lift: rgba(201, 168, 106, 0.10);
  --accent-line: rgba(201, 168, 106, 0.38);

  /* type */
  --font-serif: "Newsreader", Georgia, "Times New Roman", serif;
  --font-sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                Helvetica, Arial, sans-serif;

  /* metrics */
  --measure: 44rem;
  --pad:     clamp(1.25rem, 5vw, 2rem);
  --nav-h:   3.75rem;
  --gap-y:   clamp(2.75rem, 8vw, 4.5rem);
}

/* ---------- reset ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scrollbar-color: #2A3441 var(--bg);
}

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: clamp(1rem, 0.965rem + 0.18vw, 1.0625rem);
  line-height: 1.7;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* a single soft light source behind the masthead, for depth */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(60rem 34rem at 50% -14rem, rgba(201, 168, 106, 0.09), transparent 70%),
    radial-gradient(46rem 30rem at 88% 4%,   rgba(96, 132, 176, 0.07), transparent 72%);
}

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

h1, h2, h3 { font-weight: 500; }

::selection {
  background: rgba(201, 168, 106, 0.3);
  color: #fff;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
}
.skip-link:focus {
  left: 1rem;
  top: 1rem;
  z-index: 200;
  padding: 0.6rem 1rem;
  background: var(--bg-elev);
  color: var(--text);
  border: 1px solid var(--accent);
  border-radius: 6px;
  text-decoration: none;
}

/* shared width container */
.nav__inner,
.hero,
.section,
.footer__inner {
  width: 100%;
  max-width: var(--measure);
  margin-inline: auto;
  padding-inline: var(--pad);
}

/* ---------- masthead ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11, 15, 20, 0.78);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  backdrop-filter: blur(14px) saturate(150%);
  border-bottom: 1px solid var(--border);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .nav { background: var(--bg); }
}

.nav__inner {
  min-height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.nav__name {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  letter-spacing: 0.005em;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.18s ease;
}
.nav__name:hover { color: var(--accent); }

.nav__links {
  display: flex;
  align-items: center;
  gap: clamp(0.85rem, 3.5vw, 1.75rem);
}

.nav__links a {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  padding-block: 0.35rem;
  border-bottom: 1px solid transparent;
  transition: color 0.18s ease, border-color 0.18s ease;
}
.nav__links a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent-line);
}

/* ---------- hero ---------- */

.hero {
  display: flex;
  align-items: center;
  gap: clamp(1.5rem, 5vw, 2.75rem);
  padding-top: clamp(2.75rem, 9vw, 5rem);
  padding-bottom: clamp(1.5rem, 4vw, 2.25rem);
}

.hero__photo {
  flex: 0 0 auto;
  width: clamp(7rem, 19vw, 9.5rem);
  height: auto;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  object-fit: cover;
  box-shadow:
    0 0 0 1px var(--accent-line),
    0 0 0 7px rgba(201, 168, 106, 0.06),
    0 18px 40px -18px rgba(0, 0, 0, 0.9);
}

.hero__body { min-width: 0; }

.hero__name {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(2.1rem, 8vw, 3.1rem);
  line-height: 1.06;
  letter-spacing: -0.018em;
}

.hero__role {
  margin: 0.7rem 0 0;
  font-size: clamp(0.95rem, 2.6vw, 1.05rem);
  color: var(--text-soft);
}

.hero__interests {
  margin: 0.3rem 0 0;
  font-size: 0.85rem;
  letter-spacing: 0.03em;
  color: var(--muted);
}

.dot {
  display: inline-block;
  margin-inline: 0.5em;
  color: var(--accent);
}

.hero__email {
  margin: 1.1rem 0 0;
  font-size: 0.92rem;
  overflow-wrap: anywhere;
}

.hero__email a,
.footer__email a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--accent-line);
  padding-bottom: 1px;
  transition: border-color 0.18s ease, color 0.18s ease;
}
.hero__email a:hover,
.footer__email a:hover {
  color: var(--text);
  border-bottom-color: var(--text);
}

/* ---------- social row ---------- */

.social {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 1.15rem 0 0;
  padding: 0;
  list-style: none;
}

.social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 50%;
  transition: color 0.18s ease, border-color 0.18s ease,
              background-color 0.18s ease, transform 0.18s ease;
}
.social a:hover {
  color: var(--accent);
  border-color: var(--accent-line);
  background-color: var(--accent-lift);
  transform: translateY(-2px);
}
.social svg {
  width: 1.05rem;
  height: 1.05rem;
  fill: currentColor;
}

/* ---------- sections ---------- */

.section {
  padding-top: var(--gap-y);
  scroll-margin-top: calc(var(--nav-h) + 0.5rem);
}

.section__title {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 0 0 clamp(1.5rem, 4vw, 2.1rem);
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: var(--accent);
}
.section__title::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  min-width: 1rem;
  background: linear-gradient(90deg, var(--border), transparent);
}

/* ---------- papers ---------- */

.papers {
  margin: 0;
  padding: 0;
  list-style: none;
}

.paper + .paper {
  margin-top: clamp(1.6rem, 4.5vw, 2.1rem);
  padding-top: clamp(1.6rem, 4.5vw, 2.1rem);
  border-top: 1px solid var(--border);
}

.paper__title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(1.15rem, 3.6vw, 1.4rem);
  line-height: 1.32;
  letter-spacing: -0.005em;
  text-wrap: pretty;
}

.paper__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin: 0.5rem 0 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 1.9rem;
  padding: 0.15rem 0.7rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
  border: 1px solid var(--accent-line);
  border-radius: 999px;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}
.chip:hover {
  background-color: var(--accent-lift);
  border-color: var(--accent);
  color: var(--text);
}

/* abstract disclosure — native <details>, no script */

.abstract { margin-top: 0.9rem; }

.abstract > summary {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  width: fit-content;
  padding-block: 0.15rem;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
  list-style: none;
  transition: color 0.18s ease;
}
.abstract > summary::-webkit-details-marker { display: none; }
.abstract > summary::marker { content: ""; }
.abstract > summary:hover { color: var(--accent); }

.abstract > summary::after {
  content: "";
  width: 0.38rem;
  height: 0.38rem;
  margin-top: -0.18rem;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}
.abstract[open] > summary::after {
  transform: rotate(-135deg);
  margin-top: 0.1rem;
}

.abstract__body {
  margin: 0.9rem 0 0;
  padding-left: 1.1rem;
  border-left: 1px solid var(--border);
  font-size: 0.93rem;
  line-height: 1.78;
  color: var(--muted);
  text-wrap: pretty;
}

/* ---------- long-form prose ---------- */

.prose {
  color: var(--text-soft);
  text-wrap: pretty;
}
.prose p { margin: 0 0 1.15rem; }
.prose p:last-child { margin-bottom: 0; }

/* ---------- footer / contact ---------- */

.footer {
  margin-top: var(--gap-y);
  border-top: 1px solid var(--border);
  background:
    linear-gradient(180deg, rgba(17, 22, 29, 0.55), rgba(17, 22, 29, 0));
}

.footer__inner {
  padding-top: clamp(2.25rem, 7vw, 3.25rem);
  padding-bottom: clamp(2.25rem, 6vw, 3.25rem);
  scroll-margin-top: var(--nav-h);
}
.footer { scroll-margin-top: var(--nav-h); }

.footer__lead {
  margin: 0;
  max-width: 34rem;
  color: var(--text-soft);
  text-wrap: pretty;
}

.footer__email {
  margin: 0.9rem 0 0;
  font-size: 1.02rem;
  overflow-wrap: anywhere;
}

.footer__legal {
  margin: clamp(1.75rem, 5vw, 2.5rem) 0 0;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  color: #7E8A9A;
}

/* ---------- narrow screens ---------- */

@media (max-width: 40rem) {
  .hero {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .hero__body { width: 100%; }
  .social { justify-content: center; }
  .section__title::after { display: none; }
  .section__title {
    /* keep the rule as a full underline instead of a trailing hairline */
    display: block;
    padding-bottom: 0.7rem;
    border-bottom: 1px solid var(--border);
  }
  .footer__lead { max-width: none; }
}

@media (max-width: 23.5rem) {
  .nav__name { font-size: 0.98rem; }
  .nav__links a { font-size: 0.68rem; letter-spacing: 0.06em; }
  .nav__links { gap: 0.7rem; }
}

/* ---------- motion preference ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .social a:hover { transform: none; }
}
