@font-face {
  font-family: "Geist";
  src: url("fonts/Geist-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Geist";
  src: url("fonts/Geist-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Geist";
  src: url("fonts/Geist-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Geist";
  src: url("fonts/Geist-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("fonts/GeistMono-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("fonts/GeistMono-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Playfair Display";
  src: url("fonts/PlayfairDisplay-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Playfair Display";
  src: url("fonts/PlayfairDisplay-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Playfair Display";
  src: url("fonts/PlayfairDisplay-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Yekan Bakh";
  src: url("fonts/YekanBakh-Light.woff2") format("woff2");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Yekan Bakh";
  src: url("fonts/YekanBakh-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Yekan Bakh";
  src: url("fonts/YekanBakh-SemiBold.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Yekan Bakh";
  src: url("fonts/YekanBakh-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Yekan Bakh";
  src: url("fonts/YekanBakh-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --background: #f7f6f2;
  --foreground: #121110;
  --card: #ffffff;
  --muted: #ebe8e1;
  --muted-foreground: #6a6560;
  --border: rgba(18, 17, 16, 0.12);
  --hazard: #c41e2a;
  --accent: #121110;
  --accent-fg: #f7f6f2;
  --grid-line: rgba(18, 17, 16, 0.06);
  --paper-deep: #efece5;
  --font-sans: "Geist", system-ui, sans-serif;
  --font-display: "Playfair Display", Georgia, "Times New Roman", serif;
  --font-mono: "Geist Mono", ui-monospace, monospace;
  --font-fa: "Yekan Bakh", "Geist", sans-serif;
  --max: 72rem;
  --header-h: 4rem;
  --ease: cubic-bezier(0.2, 0, 0, 1);
}

html.dark {
  --background: #070707;
  --foreground: #f5f5f5;
  --card: #0e0e0e;
  --muted: #1b1b1b;
  --muted-foreground: #989898;
  --border: rgba(245, 245, 245, 0.14);
  --hazard: #e94646;
  --accent: #f5f5f5;
  --accent-fg: #070707;
  --grid-line: rgba(245, 245, 245, 0.07);
  --paper-deep: #040404;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  min-height: 100vh;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
html[data-locale="fa"] body { font-family: var(--font-fa); }
html[data-locale="fa"] .hero-name,
html[data-locale="fa"] .section-title,
html[data-locale="fa"] .plate-letter,
html[data-locale="fa"] .logotype,
html[data-locale="fa"] .btn,
html[data-locale="fa"] .nav-links a,
html[data-locale="fa"] .gh-stat strong {
  font-family: var(--font-fa);
}
html[data-locale="fa"] .hero-name {
  letter-spacing: -0.02em;
  line-height: 1.05;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul { list-style: none; }
img { display: block; max-width: 100%; }

.grain {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 80;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

/* Header */
.site-header {
  position: fixed;
  inset-inline: 0;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--background) 88%, transparent);
  backdrop-filter: blur(12px);
}
.nav {
  max-width: var(--max);
  height: 100%;
  margin: 0 auto;
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.logotype {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  transition: color 0.2s var(--ease);
}
.logotype:hover { color: var(--hazard); }
.logotype-dot { color: var(--hazard); }
.nav-links {
  display: none;
  align-items: center;
  gap: 0.15rem;
}
.nav-links a {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--muted-foreground);
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}
.nav-links a:hover,
.nav-links a.is-active {
  color: var(--foreground);
  background: var(--muted);
}
.nav-tools { display: flex; align-items: center; gap: 0.35rem; }
.icon-btn, .lang-btn {
  width: 2.25rem;
  height: 2.25rem;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  color: var(--muted-foreground);
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.lang-btn {
  width: auto;
  padding: 0 0.65rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.06em;
}
.icon-btn:hover, .lang-btn:hover {
  color: var(--foreground);
  border-color: var(--foreground);
}

@media (min-width: 840px) {
  .nav-links { display: flex; }
}

/* Hero */
.hero {
  position: relative;
  max-width: var(--max);
  margin: 0 auto;
  padding: calc(var(--header-h) + 2.5rem) 1.25rem 4rem;
  border-bottom: 1px solid var(--border);
}
.hero-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
}
.folio {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}
.availability {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--hazard);
}
.dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--hazard);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--hazard) 55%, transparent);
  animation: pulse 1.8s ease-out infinite;
}
@keyframes pulse {
  70% { box-shadow: 0 0 0 8px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.hero-stage {
  position: relative;
  min-height: clamp(10rem, 28vw, 16rem);
  margin-bottom: 1.75rem;
}
.hero-name {
  position: relative;
  z-index: 1;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.8rem, 1rem + 9vw, 7.5rem);
  line-height: 0.92;
  letter-spacing: -0.04em;
  max-width: 14ch;
  animation: rise 0.9s var(--ease) both;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(1.2rem); }
  to { opacity: 1; transform: none; }
}

.plate {
  display: none;
  position: absolute;
  top: 8%;
  inset-inline-end: 0;
  width: min(17rem, 38vw);
  aspect-ratio: 4 / 5;
  padding: 1rem;
  background: color-mix(in srgb, var(--card) 72%, transparent);
  border: 1px solid var(--border);
  backdrop-filter: blur(18px);
  box-shadow: 0 24px 60px rgba(0,0,0,0.25);
  animation: floatIn 1.1s 0.15s var(--ease) both;
  z-index: 2;
}
@keyframes floatIn {
  from { opacity: 0; transform: translateY(1.5rem) rotate(2deg); }
  to { opacity: 1; transform: none; }
}
.plate-mark {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  color: var(--muted-foreground);
}
.plate-letter {
  display: block;
  margin-top: 1.5rem;
  font-family: var(--font-display);
  font-size: 5.5rem;
  font-weight: 600;
  line-height: 0.85;
  letter-spacing: -0.05em;
}
.plate-mono {
  display: block;
  margin-top: 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  color: var(--muted-foreground);
}
.plate-caption {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.85rem;
  color: var(--muted-foreground);
}
@media (min-width: 900px) {
  .plate { display: block; }
}

.reg {
  position: absolute;
  width: 10px;
  height: 10px;
  opacity: 0.55;
}
.reg::before, .reg::after {
  content: "";
  position: absolute;
  background: var(--foreground);
}
.reg::before { width: 1px; inset-block: 0; left: 50%; transform: translateX(-50%); }
.reg::after { height: 1px; inset-inline: 0; top: 50%; transform: translateY(-50%); }
.reg.tl { top: 8px; left: 8px; }
.reg.tr { top: 8px; right: 8px; }
.reg.bl { bottom: 8px; left: 8px; }
.reg.br { bottom: 8px; right: 8px; }

.hero-lead {
  font-size: clamp(1.15rem, 0.95rem + 0.9vw, 1.55rem);
  font-weight: 500;
  max-width: 36rem;
  margin-bottom: 0.85rem;
  animation: rise 0.9s 0.08s var(--ease) both;
}
.hero-sub {
  max-width: 34rem;
  color: var(--muted-foreground);
  margin-bottom: 1.75rem;
  animation: rise 0.9s 0.14s var(--ease) both;
}
.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 1.75rem;
  animation: rise 0.9s 0.2s var(--ease) both;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.65rem;
  padding: 0 1.15rem;
  border-radius: 999px;
  border: 1px solid var(--foreground);
  background: var(--foreground);
  color: var(--accent-fg);
  font-size: 0.9rem;
  font-weight: 600;
  transition: transform 0.2s var(--ease), opacity 0.2s;
}
.btn:hover { transform: translateY(-1px); opacity: 0.92; }
.btn-ghost {
  background: transparent;
  color: var(--foreground);
}
.btn-sm {
  min-height: 2.1rem;
  padding: 0 0.95rem;
  font-size: 0.8rem;
  background: transparent;
  color: var(--foreground);
}

.socials {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.15rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  animation: rise 0.9s 0.26s var(--ease) both;
}
.socials a {
  font-size: 0.88rem;
  color: var(--muted-foreground);
  transition: color 0.2s;
}
.socials a:hover { color: var(--foreground); }

/* Sections */
.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: 4.5rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2.25rem;
}
.section-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 1.3rem + 2.8vw, 3.6rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.05;
  padding-top: 0.85rem;
  border-top: 2px solid var(--foreground);
  width: fit-content;
}

.about-grid {
  display: grid;
  gap: 2rem;
}
@media (min-width: 800px) {
  .about-grid { grid-template-columns: 1.4fr 1fr; gap: 3rem; }
}
.about-text {
  font-size: 1.12rem;
  color: var(--muted-foreground);
  max-width: 38rem;
}
.facts {
  display: grid;
  gap: 1.1rem;
  padding: 1.25rem;
  border: 1px solid var(--border);
  background: var(--card);
}
.facts dt {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-foreground);
  margin-bottom: 0.2rem;
}
.facts dd { font-weight: 500; }

.work-grid {
  display: grid;
  gap: 1.75rem;
}
@media (min-width: 700px) {
  .work-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1000px) {
  .work-grid { grid-template-columns: repeat(3, 1fr); }
}
.work-card h3 {
  font-size: 1.05rem;
  font-weight: 650;
  margin: 0.15rem 0 0.45rem;
}
.work-card p:last-child {
  color: var(--muted-foreground);
  font-size: 0.92rem;
}
.work-meta {
  margin-top: 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  color: var(--muted-foreground);
}
.work-frame {
  position: relative;
  aspect-ratio: 16 / 11;
  background:
    linear-gradient(var(--grid-line) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px) 0 0 / 24px 24px,
    var(--paper-deep);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  overflow: hidden;
  transition: border-color 0.25s var(--ease), transform 0.25s var(--ease);
}
.work-card:hover .work-frame {
  border-color: color-mix(in srgb, var(--foreground) 45%, transparent);
  transform: translateY(-2px);
}
.work-fig {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  color: color-mix(in srgb, var(--muted-foreground) 55%, transparent);
}
.work-glyph {
  position: relative;
  z-index: 1;
  font-size: 2rem;
  opacity: 0.85;
}

.gh-stat {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.65rem;
  margin-bottom: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}
.gh-stat strong {
  font-size: 1.65rem;
  font-family: var(--font-display);
  letter-spacing: -0.03em;
  color: var(--foreground);
  font-weight: 600;
}
.repo-list {
  border-top: 1px solid var(--border);
}
.repo {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1rem;
  align-items: center;
  padding: 1.05rem 0.15rem;
  border-bottom: 1px solid var(--border);
  transition: background 0.2s;
}
.repo:hover { background: color-mix(in srgb, var(--muted) 55%, transparent); }
.repo-n {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted-foreground);
}
.repo-body { display: grid; gap: 0.15rem; min-width: 0; }
.repo-body strong { font-weight: 600; }
.repo-body em {
  font-style: normal;
  font-size: 0.88rem;
  color: var(--muted-foreground);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.repo-meta {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--muted-foreground);
  white-space: nowrap;
}
@media (max-width: 640px) {
  .repo { grid-template-columns: auto 1fr; }
  .repo-meta { grid-column: 2; }
}

.contact-lead {
  max-width: 32rem;
  font-size: 1.15rem;
  color: var(--muted-foreground);
  margin-bottom: 1.5rem;
}

/* Footer */
.site-footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 3.5rem 1.25rem 2.5rem;
  display: grid;
  gap: 2.5rem;
}
@media (min-width: 800px) {
  .site-footer {
    grid-template-columns: 1.3fr 1fr;
    align-items: start;
  }
}
.footer-brand p {
  margin-top: 0.85rem;
  max-width: 24rem;
  color: var(--muted-foreground);
  font-size: 0.95rem;
}
.footer-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}
.footer-cols h4 {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  color: var(--muted-foreground);
  margin-bottom: 0.75rem;
}
.footer-cols a {
  display: block;
  font-size: 0.92rem;
  color: var(--muted-foreground);
  padding: 0.2rem 0;
  transition: color 0.2s;
}
.footer-cols a:hover { color: var(--foreground); }
.footer-copy {
  grid-column: 1 / -1;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  color: var(--muted-foreground);
}

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