/* ---------- Font: Irancell Light (drop the font files into /fonts) ---------- */
@font-face {
  font-family: "Irancell";
  src: local("Irancell Light"), local("Irancell-Light"),
       url("fonts/Irancell-Light.woff2") format("woff2"),
       url("fonts/Irancell-Light.woff") format("woff"),
       url("fonts/Irancell-Light.ttf") format("truetype");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --turq: #40E0D0;
  --turq-deep: #14a99c;
  --teal: #0b5b63;
  --lapis: #0a2a43;
  --lapis-2: #0d3b57;
  --cream: #FAF3E0;
  --cream-2: #F1E6C8;
  --ink: #12323b;
  --muted: #4d6a70;
  --gold: #c9a45c;
  --radius: 18px;
  --font: "Irancell", "Vazirmatn", "Segoe UI", Tahoma, system-ui, sans-serif;
  --tile: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='84' height='84' viewBox='0 0 84 84'%3E%3Cg fill='none' stroke='%2340E0D0' stroke-opacity='.22' stroke-width='1.2'%3E%3Crect x='21' y='21' width='42' height='42'/%3E%3Crect x='21' y='21' width='42' height='42' transform='rotate(45 42 42)'/%3E%3Ccircle cx='42' cy='42' r='9'/%3E%3Cpath d='M0 0l21 21M84 0L63 21M0 84l21-21M84 84L63 63'/%3E%3C/g%3E%3C/svg%3E");
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  font-family: var(--font);
  font-weight: 300;
  background: var(--cream);
  color: var(--ink);
  line-height: 1.9;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
b, h1, h2, h3 { font-weight: 600; }
.wrap { width: min(1080px, 92%); margin-inline: auto; }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 1.2rem;
  padding: .55rem clamp(1rem, 4vw, 2.5rem);
  background: rgba(250, 243, 224, .88);
  backdrop-filter: blur(10px);
  border-bottom: 2px solid var(--turq);
}
.brand { display: flex; align-items: center; gap: .7rem; margin-inline-end: auto; }
.logo-badge {
  width: 46px; height: 46px; border-radius: 50%;
  background: #fff; border: 2px solid var(--turq);
  display: grid; place-items: center; overflow: hidden;
  font-weight: 600; color: var(--teal); font-size: .95rem;
}
.logo-badge img { width: 84%; height: 84%; object-fit: contain; }
.brand-name { font-weight: 600; color: var(--teal); }
.links { display: flex; gap: 1.3rem; font-size: .95rem; }
.links a { position: relative; padding: .2rem 0; color: var(--lapis-2); }
.links a::after {
  content: ""; position: absolute; inset-inline: 0; bottom: -2px; height: 2px;
  background: var(--turq-deep); transform: scaleX(0); transition: transform .25s;
}
.links a:hover::after { transform: scaleX(1); }
.lang-btn {
  font: inherit; font-weight: 600; cursor: pointer;
  background: var(--lapis); color: var(--turq);
  border: 0; border-radius: 999px; padding: .3rem 1rem;
  transition: background .2s, color .2s;
}
.lang-btn:hover { background: var(--turq); color: var(--lapis); }
.menu-btn { display: none; background: none; border: 0; cursor: pointer; width: 38px; height: 38px; }
.menu-btn span { display: block; height: 2px; background: var(--teal); margin: 6px 6px; border-radius: 2px; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  background:
    radial-gradient(1000px 500px at 80% -10%, rgba(64, 224, 208, .35), transparent 60%),
    var(--tile),
    linear-gradient(160deg, var(--lapis) 0%, var(--lapis-2) 55%, var(--teal) 100%);
  color: var(--cream);
  padding: clamp(2.5rem, 7vw, 5rem) 0 clamp(4rem, 8vw, 6rem);
}
.hero-inner {
  width: min(1080px, 92%); margin-inline: auto;
  display: grid; grid-template-columns: 1.3fr 1fr; gap: 3rem; align-items: center;
}
.eyebrow { color: var(--turq); font-size: 1.1rem; }
.hero h1 { font-size: clamp(2.2rem, 6vw, 3.8rem); line-height: 1.3; color: #fff; }
.role {
  display: inline-block; margin: .4rem 0 1rem; padding: .15rem 1rem;
  border: 1px solid var(--turq); border-radius: 999px; color: var(--turq);
}
.lead { max-width: 56ch; color: var(--cream-2); }
.cta { display: flex; flex-wrap: wrap; gap: .8rem; margin: 1.6rem 0 1rem; }
.btn {
  padding: .65rem 1.6rem; border-radius: 999px; font-weight: 600;
  border: 2px solid var(--turq); transition: transform .2s, background .2s, color .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn.primary { background: var(--turq); color: var(--lapis); }
.btn.primary:hover { background: #fff; border-color: #fff; }
.btn.ghost { color: var(--turq); }
.btn.ghost:hover { background: rgba(64, 224, 208, .15); }
.loc { color: var(--cream-2); font-size: .95rem; opacity: .85; }
.loc::before { content: "◆ "; color: var(--turq); }

.hero-photo { display: flex; justify-content: center; }
.arch-frame {
  width: min(340px, 78vw); aspect-ratio: 3 / 4;
  padding: 10px;
  background: linear-gradient(145deg, var(--turq), var(--turq-deep) 50%, var(--gold));
  clip-path: url(#archClip);
  filter: drop-shadow(0 18px 30px rgba(0, 0, 0, .35));
}
.arch-inner {
  width: 100%; height: 100%; position: relative;
  clip-path: url(#archClip);
  background: var(--cream) var(--tile);
}
.arch-inner img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }
.monogram {
  position: absolute; inset: 0; place-items: center;
  font-size: 4rem; font-weight: 600; color: var(--teal);
}
.scallop {
  position: absolute; inset-inline: 0; bottom: -1px; height: 26px;
  background: radial-gradient(circle at 50% 0, transparent 0 13px, var(--cream) 14px) 0 0 / 38px 26px repeat-x;
}

/* ---------- Sections ---------- */
.section { padding: clamp(3rem, 7vw, 5rem) 0; }
.section.alt {
  background:
    var(--tile),
    linear-gradient(180deg, #fff8e8, var(--cream-2));
  background-blend-mode: normal;
  border-block: 1px solid rgba(20, 169, 156, .25);
}
.title {
  display: flex; align-items: center; gap: .8rem;
  font-size: clamp(1.6rem, 4vw, 2.2rem); color: var(--teal);
  margin-bottom: 2rem;
}
.title.light { color: #fff; justify-content: center; }
.star {
  width: 26px; height: 26px; flex: none;
  background: var(--turq-deep);
  clip-path: polygon(50% 0, 62% 24%, 85% 15%, 76% 38%, 100% 50%, 76% 62%, 85% 85%, 62% 76%, 50% 100%, 38% 76%, 15% 85%, 24% 62%, 0 50%, 24% 38%, 15% 15%, 38% 24%);
}
.title.light .star { background: var(--turq); }
.title::after {
  content: ""; flex: 1; height: 2px;
  background: linear-gradient(to var(--end, left), var(--turq), transparent);
}
.title.light::after { display: none; }
[dir="ltr"] .title::after { --end: right; }
.sub { color: var(--teal); margin: 2.4rem 0 1rem; font-size: 1.25rem; }
.meta { color: var(--muted); font-size: .92rem; }

/* About */
.about-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 2rem; align-items: start; }
.facts {
  background: #fff; border: 1.5px solid var(--turq);
  border-radius: var(--radius); padding: 1.2rem 1.4rem;
  box-shadow: 0 8px 24px rgba(11, 91, 99, .08);
}
.facts li { display: flex; justify-content: space-between; gap: 1rem; padding: .5rem 0; border-bottom: 1px dashed rgba(20, 169, 156, .4); }
.facts li:last-child { border: 0; }
.facts b { color: var(--teal); }
.facts span { text-align: end; }

/* Timeline */
.timeline { position: relative; padding-inline-start: 2rem; border-inline-start: 2px solid var(--turq); display: grid; gap: 1.6rem; }
.item {
  position: relative; background: #fff; border-radius: var(--radius);
  padding: 1.2rem 1.5rem; border: 1px solid rgba(20, 169, 156, .35);
  box-shadow: 0 8px 24px rgba(11, 91, 99, .07);
}
.item .dot {
  position: absolute; top: 1.5rem; inset-inline-start: calc(-2rem - 9px);
  width: 16px; height: 16px; background: var(--cream); border: 3px solid var(--turq-deep);
  transform: rotate(45deg);
}
.item h3 { color: var(--lapis-2); font-size: 1.15rem; }
.item .meta { margin-bottom: .5rem; }

/* Cards (arched top) */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 1.6rem; }
.card {
  background: #fff; border-radius: 0 0 var(--radius) var(--radius);
  padding: 0 1.4rem 1.4rem; border: 1px solid rgba(20, 169, 156, .35); border-top: 0;
  box-shadow: 0 10px 26px rgba(11, 91, 99, .09);
  transition: transform .25s, box-shadow .25s;
}
.card:hover { transform: translateY(-6px); box-shadow: 0 18px 34px rgba(11, 91, 99, .16); }
.card-top {
  margin: 0 -1.4rem 1rem; height: 86px;
  background: var(--tile), linear-gradient(160deg, var(--lapis-2), var(--teal));
  border-radius: 999px 999px 0 0 / 100% 100% 0 0;
  display: grid; place-items: center; color: var(--turq); font-size: 1.6rem; font-weight: 600;
}
.card h3 { color: var(--lapis-2); }
.card p { margin-top: .4rem; }
.tags { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .9rem; }
.tags span, .chips li {
  font-size: .85rem; padding: .1rem .8rem; border-radius: 999px;
  background: rgba(64, 224, 208, .22); color: var(--teal); border: 1px solid rgba(20, 169, 156, .5);
}

/* Skills */
.chips { display: flex; flex-wrap: wrap; gap: .6rem; }
.chips li { font-size: 1rem; padding: .25rem 1.1rem; background: #fff; transition: background .2s, transform .2s; }
.chips li:hover { background: var(--turq); color: var(--lapis); transform: translateY(-2px); }
.courses { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
.courses li {
  background: #fff; border-radius: 14px; padding: .8rem 1.1rem;
  border-inline-start: 5px solid var(--turq-deep); display: grid;
  box-shadow: 0 4px 14px rgba(11, 91, 99, .06);
}
.courses span { color: var(--muted); font-size: .9rem; }

/* Education & languages */
.edu {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap;
  background: #fff; border-radius: var(--radius); padding: 1.2rem 1.6rem;
  border: 1.5px solid var(--turq); box-shadow: 0 8px 24px rgba(11, 91, 99, .08);
}
.edu h3 { color: var(--lapis-2); }
.years { background: var(--lapis); color: var(--turq); padding: .2rem 1.1rem; border-radius: 999px; }
.langs { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1rem 1.6rem; }
.langs li { position: relative; display: grid; grid-template-columns: 1fr auto; gap: 0 .6rem; padding-bottom: .9rem; }
.langs span { color: var(--muted); font-size: .9rem; }
.langs i {
  position: absolute; bottom: 0; inset-inline: 0; height: 6px; border-radius: 6px;
  background: rgba(20, 169, 156, .2); overflow: hidden;
}
.langs i::after { content: ""; position: absolute; inset-block: 0; inset-inline-start: 0; width: var(--w); background: linear-gradient(90deg, var(--turq-deep), var(--turq)); border-radius: 6px; }

/* Honors */
.honor {
  display: flex; gap: 1.4rem; align-items: flex-start;
  background: #fff; border-radius: var(--radius); padding: 1.6rem;
  border: 1.5px solid var(--gold); box-shadow: 0 10px 26px rgba(201, 164, 92, .2);
}
.medal {
  flex: none; width: 64px; height: 64px; border-radius: 50%;
  display: grid; place-items: center; font-size: 1.8rem; color: #fff;
  background: radial-gradient(circle at 30% 30%, #e8cf8f, var(--gold));
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, .5);
}
.honor h3 { color: var(--lapis-2); }
.honor .meta { margin-bottom: .4rem; }

/* Contact */
.contact {
  background: var(--tile), linear-gradient(160deg, var(--lapis), var(--teal));
  color: var(--cream);
}
.center-note { text-align: center; max-width: 52ch; margin: -.8rem auto 2rem; color: var(--cream-2); }
.contact-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem; }
.contact-list a {
  display: grid; gap: .1rem; padding: 1rem 1.3rem; border-radius: var(--radius);
  background: rgba(250, 243, 224, .08); border: 1px solid rgba(64, 224, 208, .6);
  transition: background .2s, transform .2s;
}
.contact-list a:hover { background: rgba(64, 224, 208, .25); transform: translateY(-3px); }
.contact-list b { color: var(--turq); }
.contact-list bdi { font-size: .95rem; overflow-wrap: anywhere; }

.foot {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem;
  padding: 1.2rem clamp(1rem, 4vw, 2.5rem); background: var(--lapis); color: var(--cream-2); font-size: .9rem;
  border-top: 3px solid var(--turq);
}
.foot a { color: var(--turq); }

/* Reveal on scroll */
.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s ease, transform .7s ease; }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .hero-inner, .about-grid { grid-template-columns: 1fr; }
  .hero-photo { order: -1; }
  .arch-frame { width: min(240px, 62vw); }
  .menu-btn { display: block; }
  .links {
    position: absolute; top: 100%; inset-inline: 0; flex-direction: column; gap: 0;
    background: var(--cream); border-bottom: 2px solid var(--turq);
    max-height: 0; overflow: hidden; transition: max-height .3s;
  }
  .links.open { max-height: 420px; }
  .links a { padding: .8rem 1.4rem; border-top: 1px solid rgba(20, 169, 156, .2); }
  .brand-name { display: none; }
}
@media (max-width: 520px) {
  .honor { flex-direction: column; }
}

/* ---------- Floating glass island nav ---------- */
html { scroll-padding-top: 96px; }
.nav {
  position: fixed; top: 12px; inset-inline: 0; margin-inline: auto;
  width: min(1080px, calc(100% - 24px));
  padding: .4rem .5rem; gap: .5rem;
  border: 1px solid rgba(255, 255, 255, .55); border-radius: 999px;
  background: rgba(250, 243, 224, .45);
  -webkit-backdrop-filter: blur(18px) saturate(1.6);
  backdrop-filter: blur(18px) saturate(1.6);
  box-shadow: 0 10px 32px rgba(10, 42, 67, .22), inset 0 1px 0 rgba(255, 255, 255, .6);
}
.hero { padding-top: calc(clamp(2.5rem, 7vw, 5rem) + 84px); }
.logo-badge { width: 42px; height: 42px; }
.brand { padding-inline-end: .4rem; }
.links { gap: .15rem; }
.links a {
  padding: .35rem .95rem; border-radius: 999px; font-size: .92rem;
  transition: background .25s, color .25s;
}
.links a::after { display: none; }
.links a:hover { background: rgba(64, 224, 208, .25); }
.links a.active { background: var(--turq); color: var(--lapis); font-weight: 600; }
.lang-btn { padding: .35rem 1rem; }
@media (max-width: 860px) {
  .links {
    top: calc(100% + 8px); inset-inline: 0; gap: .15rem; padding: .5rem;
    border: 1px solid rgba(255, 255, 255, .55); border-radius: 26px;
    background: rgba(250, 243, 224, .88);
    -webkit-backdrop-filter: blur(18px) saturate(1.6); backdrop-filter: blur(18px) saturate(1.6);
    box-shadow: 0 14px 34px rgba(10, 42, 67, .25);
    opacity: 0; visibility: hidden; max-height: none; overflow: visible;
    transform: translateY(-6px); transition: opacity .2s, transform .2s, visibility .2s;
  }
  .links.open { opacity: 1; visibility: visible; transform: none; max-height: none; }
  .links a { padding: .7rem 1.1rem; border-top: 0; }
}

/* ================= Rive ornament ================= */
.hero { overflow: hidden; }
.hero-text { position: relative; z-index: 2; }
.hero-photo { position: relative; }
.arch-frame { position: relative; z-index: 1; }
.ornament {
  position: absolute; inset: -20%; z-index: 0; pointer-events: none;
  translate: calc(var(--px, 0) * -22px) calc(var(--py, 0) * -22px);
  transition: translate .25s ease-out;
}
.ornament canvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; transition: opacity .6s ease;
}
.ornament.rive-ready canvas { opacity: 1; }
.orn-fallback { width: 100%; height: 100%; color: var(--turq); opacity: .5; transition: opacity .6s ease; }
.ornament.rive-ready .orn-fallback { opacity: 0; }
.orn-fallback .spin {
  transform-box: fill-box; transform-origin: center;
  animation: orn-spin 90s linear infinite;
}
.orn-fallback .spin.rev { animation-duration: 55s; animation-direction: reverse; }
@keyframes orn-spin { to { transform: rotate(360deg); } }

/* ================= Pushable buttons ================= */
.btn, .lang-btn, .plink, .contact-list a {
  --edge: #0b5b63; --lift: 6px;
  -webkit-tap-highlight-color: transparent;
  transition: transform .12s ease, box-shadow .12s ease, background .2s, color .2s;
}
.btn.primary { --edge: #0e8a80; }
.btn.ghost { --edge: rgba(2, 18, 29, .85); background: rgba(64, 224, 208, .1); }
.plink { --edge: var(--turq-deep); --lift: 4px; background: #fff; }
.contact-list a { --edge: rgba(2, 18, 29, .8); --lift: 5px; }
.btn, .plink, .contact-list a {
  box-shadow: 0 var(--lift) 0 var(--edge), 0 calc(var(--lift) + 6px) 14px rgba(0, 0, 0, .22);
}
.lang-btn { --edge: #02121d; --lift: 3px; box-shadow: 0 var(--lift) 0 var(--edge); }
.btn:hover, .plink:hover, .contact-list a:hover {
  transform: translateY(-2px);
  box-shadow: 0 calc(var(--lift) + 2px) 0 var(--edge), 0 calc(var(--lift) + 10px) 18px rgba(0, 0, 0, .26);
}
.lang-btn:hover { transform: translateY(-1px); box-shadow: 0 calc(var(--lift) + 1px) 0 var(--edge); }
.btn:active, .plink:active, .contact-list a:active, .lang-btn:active {
  transform: translateY(var(--lift));
  box-shadow: 0 0 0 var(--edge), 0 1px 3px rgba(0, 0, 0, .3);
  transition-duration: .04s;
}
.btn:focus-visible, .plink:focus-visible, .lang-btn:focus-visible, .contact-list a:focus-visible {
  outline: 3px solid #fff; outline-offset: 3px;
}
.cta { padding-bottom: 8px; }
.plinks { padding-bottom: 4px; }

/* ================= Perspective ================= */
.hero-photo { perspective: 1100px; }
.arch-frame {
  transform: rotateY(calc(var(--px, 0) * 9deg)) rotateX(calc(var(--py, 0) * -7deg));
  transition: transform .25s ease-out; will-change: transform;
}
.hero-text {
  translate: calc(var(--px, 0) * 8px) calc(var(--py, 0) * 5px);
  transition: translate .25s ease-out;
}
/* scroll reveal: panels tip up from the floor */
.js .reveal { transform: perspective(1000px) rotateX(10deg) translateY(30px); transform-origin: 50% 0; }
.js .reveal.in { transform: none; }
/* 3D tilt (cards, honors, facts) - class added by script.js on desktop */
.tilt { position: relative; }
.js .tilt, .js .tilt.reveal, .js .tilt.reveal.in {
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateZ(var(--tz, 0px));
}
.js .tilt.reveal { translate: 0 30px; scale: .95; }
.js .tilt.reveal.in { translate: 0 0; scale: 1; }
.js .tilt.reveal, .js .tilt.reveal.in {
  transition: opacity .7s ease, translate .7s ease, scale .7s ease, transform .15s ease-out, box-shadow .25s ease;
}
.tilt:hover { --tz: 16px; }
.tilt::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(380px circle at var(--gx, 50%) var(--gy, 0%), rgba(255, 255, 255, .35), transparent 45%);
  opacity: 0; transition: opacity .25s;
}
.tilt:hover::after { opacity: .5; }

@media (prefers-reduced-motion: reduce) {
  .js .reveal, .js .tilt.reveal { transform: none; translate: none; scale: none; opacity: 1; transition: none; }
  .orn-fallback .spin { animation: none; }
  .arch-frame, .hero-text, .ornament { transform: none; translate: none; }
}

/* Perspective transforms can poke past the screen edge while animating */
html, body { overflow-x: hidden; }
@supports (overflow: clip) { html, body { overflow-x: clip; } }