/* =========================================================
   iuwa.ir — "Signal"
   Pure black · Instrument Serif · monospace · entropy hero
   ========================================================= */

:root {
  --bg: #000000;
  --bg-2: #0a0a0a;
  --panel: #0c0c0c;
  --text: #f2f2f2;
  --muted: #9a9aa2;
  --dim: #63636b;
  --line: rgba(255, 255, 255, 0.13);
  --line-soft: rgba(255, 255, 255, 0.07);
  --spark: #c3cbe0;

  --font-display: 'Instrument Serif', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  --maxw: 1140px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; }

body {
  font-family: var(--font-body);
  font-size: 1.02rem;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

a { color: inherit; text-decoration: none; cursor: pointer; }
.mono { font-family: var(--font-mono); }
em { font-style: italic; }

/* underline-on-emphasis */
.u { color: var(--text); box-shadow: inset 0 -1px 0 rgba(255,255,255,0.35); }
.lead .u, .entry__body .u { box-shadow: inset 0 -1px 0 rgba(255,255,255,0.28); }

::selection { background: rgba(255, 255, 255, 0.16); color: #fff; }
::-webkit-scrollbar { width: 11px; }
::-webkit-scrollbar-track { background: #000; }
::-webkit-scrollbar-thumb { background: #2a2a2a; border-radius: 8px; border: 3px solid #000; }
::-webkit-scrollbar-thumb:hover { background: #3a3a3a; }

.skip-link { position: absolute; left: -999px; top: 0; z-index: 400; background: #fff; color: #000; padding: 10px 16px; font-family: var(--font-mono); font-size: 0.85rem; }
.skip-link:focus { left: 0; }
a:focus-visible, button:focus-visible { outline: 1px solid #fff; outline-offset: 3px; }

/* =========================  PRELOADER  ========================= */
.preloader { display: none; }
html.js .preloader { display: grid; place-items: center; position: fixed; inset: 0; z-index: 500; background: #000; transition: opacity 0.5s var(--ease), visibility 0.5s; }
html.js .preloader.is-done { opacity: 0; visibility: hidden; pointer-events: none; }
.preloader__mark { width: 62px; height: 62px; }
.pl-draw { fill: none; stroke-dasharray: 240; stroke-dashoffset: 240; animation: pl-draw 0.9s var(--ease) forwards; }
.pl-draw--2 { stroke-dasharray: 90; stroke-dashoffset: 90; animation-delay: 0.3s; }
.pl-dot { opacity: 0; animation: pl-pop 0.4s var(--ease) 0.8s forwards; }
@keyframes pl-draw { to { stroke-dashoffset: 0; } }
@keyframes pl-pop { from { opacity: 0; transform: scale(0); transform-origin: center; } to { opacity: 1; transform: scale(1); } }

/* =========================  PROGRESS  ========================= */
.scroll-progress { position: fixed; top: 0; left: 0; height: 1px; width: 0; background: #fff; z-index: 320; box-shadow: 0 0 8px rgba(255,255,255,0.5); }

/* =========================  NAV  ========================= */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 300;
  display: flex; align-items: center; gap: 26px;
  padding: 18px clamp(18px, 5vw, 48px);
  transition: background 0.4s, border-color 0.4s, padding 0.35s var(--ease);
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled { background: rgba(0,0,0,0.72); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom-color: var(--line-soft); padding-top: 13px; padding-bottom: 13px; }
.nav__brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-size: 1.35rem; letter-spacing: 0.01em; }
.nav__dim { color: var(--dim); }
.nav__links { display: flex; gap: 26px; margin-left: auto; }
.nav__links a { font-size: 0.82rem; letter-spacing: 0.02em; color: var(--muted); text-transform: uppercase; position: relative; transition: color 0.25s; }
.nav__links a::after { content: ""; position: absolute; left: 0; bottom: -6px; height: 1px; width: 0; background: #fff; transition: width 0.3s var(--ease); }
.nav__links a:hover, .nav__links a.is-active { color: var(--text); }
.nav__links a:hover::after, .nav__links a.is-active::after { width: 100%; }
.nav__cv { font-size: 0.76rem; letter-spacing: 0.05em; color: var(--text); border: 1px solid var(--line); padding: 7px 13px; transition: background 0.25s, color 0.25s, border-color 0.25s; }
.nav__cv:hover { background: #fff; color: #000; border-color: #fff; }
.nav__toggle { display: none; flex-direction: column; gap: 6px; background: none; border: 0; cursor: pointer; padding: 8px; margin-left: auto; }
.nav__toggle span { width: 22px; height: 1.5px; background: var(--text); transition: 0.35s var(--ease); }
.nav__toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(3.75px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] span:nth-child(2) { transform: translateY(-3.75px) rotate(-45deg); }

/* =========================  BUTTONS  ========================= */
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--font-mono); font-size: 0.82rem; letter-spacing: 0.03em;
  padding: 13px 22px; border: 1px solid #fff; background: #fff; color: #000;
  position: relative; overflow: hidden;
  transition: background 0.3s, color 0.3s, transform 0.3s var(--ease), border-color 0.3s;
}
.btn::after { content: ""; position: absolute; inset: 0; left: -80%; width: 45%; background: linear-gradient(100deg, transparent, rgba(0,0,0,0.14), transparent); transform: skewX(-20deg); transition: left 0.6s var(--ease); }
.btn:hover::after { left: 130%; }
.btn:hover { transform: translateY(-2px); }
.btn--ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn--ghost::after { background: linear-gradient(100deg, transparent, rgba(255,255,255,0.12), transparent); }
.btn--ghost:hover { border-color: #fff; }

/* =========================  HERO  ========================= */
.hero { position: relative; min-height: 100svh; display: flex; align-items: center; padding: 130px clamp(18px, 5vw, 48px) 80px; overflow: hidden; }
.hero__glow {
  position: absolute; z-index: 0; right: 6%; top: 44%; transform: translateY(-50%);
  width: 620px; height: 620px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(120,130,170,0.10), transparent 62%);
  filter: blur(20px);
}
.hero__inner {
  position: relative; z-index: 1; max-width: var(--maxw); margin: 0 auto; width: 100%;
  display: grid; grid-template-columns: 1.05fr 0.95fr; gap: clamp(36px, 6vw, 84px); align-items: center;
}
.hero__eyebrow { font-size: 0.78rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted); margin-bottom: 26px; }
.hero__title {
  font-family: var(--font-display); font-weight: 400; letter-spacing: 0.005em;
  font-size: clamp(3rem, 8vw, 6.2rem); line-height: 0.98; margin-bottom: 30px;
}
.rotator { position: relative; display: inline-block; min-width: 5ch; text-align: left; }
.rotator em { position: absolute; left: 0; top: 0; white-space: nowrap; opacity: 0; transform: translateY(0.35em); filter: blur(6px); transition: opacity 0.55s var(--ease), transform 0.55s var(--ease), filter 0.55s; color: var(--spark); }
.rotator em.is-active { position: relative; opacity: 1; transform: none; filter: none; }
.rotator em.is-leaving { opacity: 0; transform: translateY(-0.35em); filter: blur(6px); }
.hero__lede { font-size: clamp(1rem, 1.7vw, 1.16rem); color: var(--muted); max-width: 44ch; margin-bottom: 34px; }
.hero__actions { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 34px; }
.hero__meta { font-size: 0.74rem; color: var(--dim); letter-spacing: 0.03em; }

.hero__scroll { position: absolute; bottom: 24px; left: clamp(18px, 5vw, 48px); z-index: 1; font-size: 0.7rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--dim); display: inline-flex; gap: 8px; align-items: center; }
.hero__scroll span { animation: scrolldn 1.8s var(--ease) infinite; }
@keyframes scrolldn { 0%,100% { transform: translateY(0); opacity: 0.5; } 50% { transform: translateY(4px); opacity: 1; } }

/* ===== ENTROPY FIGURE ===== */
.entropy { display: flex; flex-direction: column; align-items: center; }
.entropy__frame { position: relative; width: 100%; max-width: 480px; border: 1px solid var(--line); padding: 14px; background: rgba(255,255,255,0.012); }
.entropy__frame::before, .entropy__frame::after {
  content: ""; position: absolute; width: 12px; height: 12px; border: 1px solid rgba(255,255,255,0.4); pointer-events: none;
}
.entropy__frame::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.entropy__frame::after { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }
.entropy__stage { position: relative; width: 100%; aspect-ratio: 1 / 1; background: transparent; overflow: hidden; }
.entropy__stage canvas { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); }
.entropy__axis { position: absolute; bottom: 20px; font-size: 0.64rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--dim); }
.entropy__axis--l { left: 22px; }
.entropy__axis--r { right: 22px; color: var(--muted); }
.entropy__cap { margin-top: 16px; font-size: 0.7rem; letter-spacing: 0.04em; color: var(--dim); text-align: center; }

/* =========================  TICKER  ========================= */
.ticker { overflow: hidden; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); position: relative; z-index: 1; -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.ticker__track { display: inline-flex; gap: 70px; padding: 14px 0; white-space: nowrap; animation: ticker-scroll 56s linear infinite; will-change: transform; }
.ticker__track span { color: var(--dim); font-size: 0.85rem; flex-shrink: 0; transition: color 0.3s; }
.ticker__track span:hover { color: var(--text); }
.ticker__track span sub { font-size: 0.7em; }
.ticker:hover .ticker__track { animation-play-state: paused; }
@keyframes ticker-scroll { from { transform: translateX(0); } to { transform: translateX(calc(-50% - 35px)); } }

/* =========================  SECTIONS  ========================= */
.section { max-width: var(--maxw); margin: 0 auto; padding: clamp(66px, 9vw, 118px) clamp(18px, 5vw, 48px) 0; }
.section--contact { padding-bottom: clamp(66px, 9vw, 118px); }
.section__head { display: flex; align-items: center; gap: 22px; margin-bottom: 40px; }
.section__no { font-size: 0.74rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.section__rule { flex: 1; height: 1px; background: var(--line); transform-origin: left; }
html.gsap-on .section__rule[data-line] { transform: scaleX(0); }
.section__title { font-family: var(--font-display); font-weight: 400; font-size: clamp(2rem, 5vw, 3.3rem); line-height: 1.05; margin-bottom: 44px; letter-spacing: 0.005em; }
.section__title em { color: var(--spark); }
.section__note { margin-top: 26px; font-size: 0.74rem; letter-spacing: 0.03em; color: var(--dim); }

/* ===== PROFILE ===== */
.profile { display: grid; grid-template-columns: 1fr 260px; gap: clamp(30px, 6vw, 70px); align-items: start; }
.lead { font-family: var(--font-display); font-size: clamp(1.35rem, 2.6vw, 1.85rem); line-height: 1.4; color: var(--text); margin-bottom: 22px; }
.lead em, .profile__lead em { color: var(--spark); }
.profile__lead p:not(.lead) { color: var(--muted); max-width: 60ch; }
.profile__side { border-left: 1px solid var(--line); padding-left: 28px; }
.profile__portrait { width: 100%; max-width: 200px; height: auto; display: block; margin-bottom: 22px; }
.profile__facts div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); font-size: 0.78rem; }
.profile__facts div:last-child { border-bottom: 0; }
.profile__facts dt { color: var(--dim); }
.profile__facts dd { color: var(--text); text-align: right; }

.figures { display: flex; flex-wrap: wrap; gap: 8px 40px; margin-top: 40px; padding: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 0.82rem; color: var(--muted); }
.figures b { font-family: var(--font-display); font-weight: 400; font-size: 1.7em; color: var(--text); margin-right: 6px; }

/* ===== RESEARCH ENTRIES ===== */
.entries { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border-top: 1px solid var(--line); }
.entry { padding: 30px 4px; border-bottom: 1px solid var(--line-soft); transition: background 0.3s; }
.entry:hover { background: rgba(255,255,255,0.02); }
.entry--feature { grid-column: 1 / -1; }
.entry__tag { display: inline-block; font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--dim); border: 1px solid var(--line); padding: 4px 10px; margin-bottom: 16px; }
.entry__title { font-family: var(--font-display); font-weight: 400; font-size: clamp(1.4rem, 2.6vw, 2rem); line-height: 1.12; margin-bottom: 12px; }
.entry--feature .entry__title { font-size: clamp(1.8rem, 3.4vw, 2.6rem); }
.entry__body { color: var(--muted); font-size: 0.98rem; max-width: 66ch; }
.entry__body em { color: var(--spark); font-style: italic; }
.entry--feature .entry__body { font-size: 1.06rem; }
.entry__foot { display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: center; justify-content: space-between; margin-top: 22px; }
.entry__foot .mono { font-size: 0.74rem; color: var(--dim); letter-spacing: 0.02em; }
.entry__venue { display: block; font-size: 0.72rem; color: var(--dim); margin-top: 16px; letter-spacing: 0.02em; }
.link { font-family: var(--font-mono); font-size: 0.78rem; color: var(--text); box-shadow: inset 0 -1px 0 rgba(255,255,255,0.4); transition: color 0.25s, box-shadow 0.25s; }
.link:hover { color: var(--spark); box-shadow: inset 0 -1px 0 var(--spark); }
.entry:nth-child(2) { border-right: 1px solid var(--line-soft); padding-right: 26px; }
.entry:nth-child(4) { border-right: 1px solid var(--line-soft); padding-right: 26px; }
.entry:nth-child(3), .entry:nth-child(5) { padding-left: 26px; }

/* ===== PUBLICATIONS ===== */
.pubs { list-style: none; border-top: 1px solid var(--line); }
.pub { display: grid; grid-template-columns: 76px 1fr; gap: 20px; padding: 22px 8px; border-bottom: 1px solid var(--line-soft); align-items: baseline; position: relative; transition: background 0.3s, transform 0.3s var(--ease); }
.pub::after { content: "↗"; position: absolute; right: 12px; top: 24px; color: var(--dim); opacity: 0; transform: translateX(-6px); transition: opacity 0.3s, transform 0.3s var(--ease); }
.pub:hover { background: rgba(255,255,255,0.02); transform: translateX(5px); }
.pub:hover::after { opacity: 1; transform: none; }
.pub__yr { color: var(--muted); font-size: 0.82rem; }
.pub h3 { font-family: var(--font-display); font-weight: 400; font-size: 1.28rem; line-height: 1.25; margin-bottom: 5px; }
.pub__venue { font-size: 0.72rem; color: var(--dim); letter-spacing: 0.02em; }

/* ===== EXPERIENCE ===== */
.cv { border-top: 1px solid var(--line); }
.cv__row { display: grid; grid-template-columns: 100px 1fr; gap: 20px; padding: 16px 8px; border-bottom: 1px solid var(--line-soft); align-items: baseline; transition: background 0.3s; }
.cv__row:hover { background: rgba(255,255,255,0.02); }
.cv__yr { color: var(--muted); font-size: 0.78rem; }
.cv__row h3 { font-weight: 600; font-size: 1.02rem; display: inline; }
.cv__row p { color: var(--muted); font-size: 0.92rem; }

.toolkit { margin-top: 40px; border-top: 1px solid var(--line); }
.toolkit__set { display: grid; grid-template-columns: 120px 1fr; gap: 20px; padding: 13px 8px; border-bottom: 1px solid var(--line-soft); }
.toolkit__key { color: var(--muted); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; padding-top: 3px; }
.toolkit__val { color: var(--text); font-size: 0.95rem; }

/* ===== TEACHING & HONORS ===== */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(36px, 6vw, 80px); }
.col-title { font-family: var(--font-display); font-weight: 400; font-size: 1.5rem; margin-bottom: 18px; }
.plain { list-style: none; }
.plain li { display: flex; align-items: baseline; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--line-soft); color: var(--muted); }
.plain li .mono { font-size: 0.66rem; color: var(--dim); letter-spacing: 0.06em; text-transform: uppercase; min-width: 52px; }
.honors { list-style: none; }
.honors li { padding: 11px 0 11px 20px; border-bottom: 1px solid var(--line-soft); color: var(--muted); position: relative; }
.honors li::before { content: "—"; position: absolute; left: 0; color: var(--dim); }
.honors li b { color: var(--text); font-weight: 600; }

/* ===== STUDENTS ===== */
.students { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 0 60px; }
.students li { font-family: var(--font-display); font-size: clamp(1.4rem, 2.6vw, 1.9rem); padding: 16px 4px; border-bottom: 1px solid var(--line-soft); display: flex; align-items: baseline; gap: 16px; transition: color 0.3s, transform 0.3s var(--ease); }
.students li:hover { color: var(--spark); transform: translateX(6px); }
.students li .mono { font-size: 0.74rem; color: var(--dim); min-width: 28px; }

/* ===== CONTACT ===== */
.contact { text-align: center; padding: 20px 0 6px; }
.contact__title { font-family: var(--font-display); font-weight: 400; font-size: clamp(2.2rem, 6vw, 4rem); line-height: 1.02; margin-bottom: 16px; }
.contact__title em { color: var(--spark); }
.contact__invite { color: var(--muted); max-width: 46ch; margin: 0 auto 34px; }
.contact__email { display: inline-block; font-family: var(--font-display); font-size: clamp(1.5rem, 5vw, 3rem); color: var(--text); margin-bottom: 40px; box-shadow: inset 0 -1px 0 rgba(255,255,255,0); transition: box-shadow 0.4s var(--ease), color 0.3s; }
.contact__email:hover { box-shadow: inset 0 -2px 0 var(--spark); color: var(--spark); }
.contact__actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ===== FOOTER ===== */
.footer { border-top: 1px solid var(--line); }
.footer__inner { max-width: var(--maxw); margin: 0 auto; padding: 40px clamp(18px, 5vw, 48px); display: flex; flex-wrap: wrap; gap: 16px 26px; align-items: center; justify-content: space-between; }
.footer__brand { display: flex; align-items: center; gap: 12px; font-family: var(--font-display); font-size: 1.05rem; }
.footer__meta { font-size: 0.72rem; color: var(--dim); letter-spacing: 0.02em; }
.footer__meta a { color: var(--muted); }
.footer__meta a:hover { color: var(--text); }
.footer__sign { font-size: 0.72rem; color: var(--dim); letter-spacing: 0.14em; }

/* ===== TO TOP ===== */
.to-top { position: fixed; right: 24px; bottom: 24px; z-index: 90; width: 44px; height: 44px; border: 1px solid var(--line); background: rgba(0,0,0,0.7); backdrop-filter: blur(8px); color: var(--text); font-size: 1.05rem; cursor: pointer; opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity 0.35s var(--ease), transform 0.35s var(--ease), background 0.3s, color 0.3s; }
.to-top.is-shown { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { background: #fff; color: #000; border-color: #fff; }

/* =========================  RESPONSIVE  ========================= */
@media (max-width: 960px) {
  .hero__inner { grid-template-columns: 1fr; gap: 44px; }
  .entropy { order: -1; }
  .hero__scroll { display: none; }
  .profile { grid-template-columns: 1fr; }
  .profile__side { border-left: 0; border-top: 1px solid var(--line); padding-left: 0; padding-top: 26px; display: grid; grid-template-columns: 150px 1fr; gap: 26px; align-items: start; }
  .profile__portrait { margin-bottom: 0; }
  .entries { grid-template-columns: 1fr; }
  .entry:nth-child(2), .entry:nth-child(4) { border-right: 0; padding-right: 4px; }
  .entry:nth-child(3), .entry:nth-child(5) { padding-left: 4px; }
  .two-col { grid-template-columns: 1fr; }
  .students { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .nav__links, .nav__cv { display: none; }
  .nav__toggle { display: flex; }
  .nav.is-open { background: rgba(0,0,0,0.96); backdrop-filter: blur(18px); border-bottom-color: var(--line); }
  .nav.is-open .nav__links { display: flex; flex-direction: column; gap: 4px; position: absolute; top: 100%; left: 0; right: 0; padding: 18px clamp(18px,5vw,48px) 26px; background: rgba(0,0,0,0.97); border-bottom: 1px solid var(--line); }
  .nav.is-open .nav__links a { padding: 12px 0; font-size: 1rem; }
  .profile__side { grid-template-columns: 1fr; }
  .pub { grid-template-columns: 60px 1fr; gap: 14px; }
  .cv__row { grid-template-columns: 1fr; gap: 3px; }
  .toolkit__set { grid-template-columns: 1fr; gap: 4px; }
}
