/* ===========================================================
   LUMETRA — design tokens
   =========================================================== */
:root {
  --ink: #14123F;        /* primary navy, from logo */
  --blue: #2266E3;       /* studio accent blue, from logo */
  --yellow: #E9E122;      /* lemon yellow, complementary accent */
  --paper: #F6F7FA;       /* cool paper background */
  --white: #FFFFFF;
  --ink-soft: #4A4A63;    /* secondary text on light */
  --line: #DADCE3;        /* hairline rule on light */
  --line-dark: rgba(255,255,255,0.18);

  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --wrap: 1180px;
  --gutter: 32px;
}

/* ===========================================================
   RESET
   =========================================================== */
* { margin: 0; padding: 0; box-sizing: border-box; }
::selection { background: var(--yellow); color: var(--ink); }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

body {
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }

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

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ===========================================================
   SIGNATURE ELEMENT — right-angle corner brackets
   echoing the logo's rectilinear letter joins. No curves
   anywhere on this page; every shape meets at 90°.
   =========================================================== */
.corner {
  position: absolute;
  width: 22px;
  height: 22px;
  pointer-events: none;
}
.corner-tl { top: -1px; left: -1px; border-top: 2px solid currentColor; border-left: 2px solid currentColor; }
.corner-tr { top: -1px; right: -1px; border-top: 2px solid currentColor; border-right: 2px solid currentColor; }
.corner-bl { bottom: -1px; left: -1px; border-bottom: 2px solid currentColor; border-left: 2px solid currentColor; }
.corner-br { bottom: -1px; right: -1px; border-bottom: 2px solid currentColor; border-right: 2px solid currentColor; }

.grid-corner {
  position: fixed;
  width: 14vw;
  max-width: 160px;
  height: 14vw;
  max-height: 160px;
  z-index: 50;
  pointer-events: none;
  opacity: 0.5;
}
.grid-corner--tl { top: 0; left: 0; border-top: 1px solid var(--ink); border-left: 1px solid var(--ink); }
.grid-corner--br { bottom: 0; right: 0; border-bottom: 1px solid var(--ink); border-right: 1px solid var(--ink); }

/* ===========================================================
   TYPE
   =========================================================== */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  color: var(--blue);
  margin-bottom: 18px;
  display: inline-block;
}
.eyebrow-light { color: #8FB1F8; }
.eyebrow-yellow { color: #C9C100; }

.section-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.7rem, 3vw, 2.6rem);
  line-height: 1.18;
  max-width: 14ch;
  margin-bottom: 24px;
}
.section-title--light { color: var(--white); }

/* ===========================================================
   HEADER
   =========================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(246, 247, 250, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 116px;
}
.brand-mark { height: 92px; width: auto; }

.main-nav { display: flex; align-items: center; gap: 36px; }
.main-nav a {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink);
  position: relative;
  padding-bottom: 4px;
}
.main-nav a:not(.nav-cta)::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: var(--blue);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}
.main-nav a:not(.nav-cta):hover::after { transform: scaleX(1); }

.lang-switch { opacity: 0.65; }
.lang-switch:hover { opacity: 1; color: #A89A00; }

.nav-cta {
  border: 1px solid var(--ink);
  padding: 9px 16px;
  transition: background 0.2s ease, color 0.2s ease;
}
.nav-cta:hover { background: var(--yellow); color: var(--ink); border-color: var(--yellow); }

.nav-toggle-checkbox {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  overflow: hidden;
  pointer-events: none;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--ink);
  width: 100%;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

/* ===========================================================
   HERO
   =========================================================== */
.hero {
  position: relative;
  padding: 110px 0 90px;
  overflow: hidden;
  min-height: 700px;
}

.hero-slides {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero-slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-color: var(--line); /* visible placeholder tint until real images are added */
  opacity: 0;
  transition: opacity 1.4s ease;
}
.hero-slide.is-active { opacity: 0.55; }
.hero-slides-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, var(--paper) 0%, rgba(246,247,250,0.15) 45%, var(--paper) 100%);
}

.hero-content { position: relative; z-index: 2; }
.hero-headline {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.6rem, 7vw, 5.4rem);
  line-height: 0.98;
  letter-spacing: -0.01em;
  margin-bottom: 28px;
}
.text-outline {
  color: transparent;
  -webkit-text-stroke: 1.5px var(--ink);
}
.hero-sub {
  font-size: 1.1rem;
  color: var(--ink-soft);
  max-width: 46ch;
  margin-bottom: 40px;
}
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; }

.btn {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 15px 28px;
  border: 1px solid var(--ink);
  display: inline-block;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.btn-primary { background: var(--ink); color: var(--white); }
.btn-primary:hover { background: var(--yellow); border-color: var(--yellow); color: var(--ink); }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--white); }

.hero-frame {
  position: absolute;
  inset: 24px;
  pointer-events: none;
  z-index: 2;
}
.hero-frame .corner { color: var(--blue); width: 28px; height: 28px; }
.hero-frame .corner-br { color: var(--yellow); }

/* ===========================================================
   CAPABILITIES STRIP
   =========================================================== */
.strip {
  background: var(--ink);
  color: var(--white);
  overflow: hidden;
  white-space: nowrap;
  padding: 16px 0;
  border-top: 1px solid var(--line-dark);
  border-bottom: 1px solid var(--line-dark);
}
.strip-track {
  display: inline-flex;
  gap: 28px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  animation: scroll-strip 28s linear infinite;
}
.strip-track span:nth-child(4n+2) { color: var(--blue); }
.strip-track span:nth-child(4n) { color: var(--yellow); }
@keyframes scroll-strip {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ===========================================================
   SERVICES
   =========================================================== */
.services { padding: 110px 0; }
.service-list { margin-top: 50px; border-top: 1px solid var(--line); }
.service-row {
  display: grid;
  grid-template-columns: 110px 1fr 36px;
  align-items: center;
  gap: 28px;
  padding: 34px 0;
  border-bottom: 1px solid var(--line);
  transition: background 0.2s ease;
}
.service-row:hover { background: rgba(34,102,227,0.04); }
.service-tag { font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.1em; color: var(--blue); }
.service-tag--yellow { color: #C9C100; }
.service-body h3 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  margin-bottom: 8px;
}
.service-body p { color: var(--ink-soft); max-width: 60ch; }
.service-arrow {
  font-size: 1.2rem;
  color: var(--ink);
  transition: transform 0.2s ease;
  justify-self: end;
}
.service-row:hover .service-arrow { transform: translateX(6px); color: var(--blue); }

/* ===========================================================
   WORK
   =========================================================== */
.work { padding: 110px 0; background: var(--white); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.work-grid {
  margin-top: 50px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
.work-card { display: block; }
.work-thumb {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--paper);
  border: 1px solid var(--line);
  overflow: hidden;
}
.work-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}
.work-card:hover .work-thumb img { transform: scale(1.04); }
.work-thumb { border-top: 2px solid transparent; transition: border-color 0.25s ease; }
.work-card:hover .work-thumb { border-top-color: var(--yellow); }
.work-meta { padding-top: 14px; }
.work-meta h3 { font-family: var(--font-display); font-size: 1.05rem; font-weight: 600; margin-bottom: 4px; transition: color 0.2s ease; }
.work-card:hover .work-meta h3 { color: #A89A00; }
.work-meta p { font-size: 0.88rem; color: var(--ink-soft); }
.work-note {
  margin-top: 36px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink-soft);
}
.work-note code { background: var(--paper); padding: 2px 6px; border: 1px solid var(--line); }

/* ===========================================================
   ABOUT
   =========================================================== */
.about { background: var(--ink); color: var(--white); padding: 110px 0; }
.about-inner {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 70px;
  align-items: center;
}
.about-text p { color: #C7CCE0; margin-bottom: 18px; max-width: 52ch; }
.about-text em { color: var(--white); font-style: normal; border-bottom: 1px solid var(--blue); }
.about-stats {
  display: flex;
  gap: 40px;
  margin-top: 36px;
  flex-wrap: wrap;
}
.stat-num {
  display: block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.1rem;
  margin-bottom: 6px;
}
.stat-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  color: #8B91B5;
}
.about-graphic {
  position: relative;
  aspect-ratio: 1;
  border: 1px solid var(--line-dark);
  color: var(--blue);
}
.geo-mark { position: absolute; inset: 0; width: 100%; height: 100%; padding: 10%; }
.geo-grid { stroke: rgba(255,255,255,0.06); stroke-width: 1; }
.geo-ray { stroke: rgba(34,102,227,0.55); stroke-width: 1.5; stroke-linecap: round; }
.geo-ray--strong { stroke: rgba(34,102,227,0.85); stroke-width: 2; }
.geo-ray--yellow { stroke: var(--yellow); stroke-width: 2.5; }
.geo-frame { stroke: var(--line-dark); stroke-width: 1; }
.geo-ring { fill: none; }
.geo-ring-1 { stroke: rgba(34,102,227,0.25); stroke-width: 1; }
.geo-ring-2 { stroke: rgba(34,102,227,0.5); stroke-width: 1.25; }
.geo-ring-3 { stroke: rgba(34,102,227,0.85); stroke-width: 1.5; }
.geo-crop { stroke: rgba(255,255,255,0.3); stroke-width: 1; fill: none; }
.geo-core { fill: var(--yellow); stroke: none; }

/* ===========================================================
   CONTACT
   =========================================================== */
.contact { background: #0E0C30; color: var(--white); padding: 110px 0; }
.contact-inner {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 70px;
}
.contact-note { color: #C7CCE0; max-width: 44ch; margin-bottom: 28px; }
.contact-email {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  color: var(--blue);
  border-bottom: 1px solid var(--blue);
  padding-bottom: 2px;
}
.contact-telegram {
  margin-top: 28px;
  color: #C7CCE0;
}
.contact-telegram + a {
  margin-top: 8px;
  display: inline-block;
}

.contact-form { display: flex; flex-direction: column; gap: 22px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: #8B91B5;
  text-transform: uppercase;
}
.field input, .field select, .field textarea {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--line-dark);
  padding: 10px 2px;
  color: var(--white);
  resize: vertical;
}
.field select option { color: var(--ink); }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-bottom-color: var(--yellow);
}
.btn-submit {
  align-self: flex-start;
  background: var(--blue);
  border-color: var(--blue);
  margin-top: 8px;
}
.btn-submit:hover { background: var(--yellow); color: var(--ink); border-color: var(--yellow); }
.form-status {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: #8FB1F8;
  min-height: 1em;
}

/* ===========================================================
   FOOTER
   =========================================================== */
.site-footer { background: var(--ink); border-top: 1px solid var(--line-dark); padding: 36px 0; }
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.footer-mark { height: 48px; }
.footer-copy {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: #8B91B5;
}
.footer-links { display: flex; gap: 22px; font-family: var(--font-mono); font-size: 0.74rem; }
.footer-links a { color: #C7CCE0; border-bottom: 1px solid transparent; }
.footer-links a:hover { color: var(--white); border-bottom-color: var(--yellow); }

/* ===========================================================
   RESPONSIVE
   =========================================================== */
@media (max-width: 900px) {
  .about-inner, .contact-inner { grid-template-columns: 1fr; }
  .about-graphic { order: -1; max-width: 280px; }
  .work-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  :root { --gutter: 22px; }
  .header-inner { height: 84px; }
  .brand-mark { height: 56px; }

  /* iOS Safari treats `backdrop-filter` on an ancestor as a containing
     block for `position: fixed` children, which traps the mobile nav
     dropdown inside the 84px-tall header instead of the full viewport.
     Disabling it on mobile (where the blur isn't essential) fixes the
     menu so it actually opens on phones. */
  .site-header { backdrop-filter: none; background: var(--paper); }

  .main-nav {
    position: fixed;
    top: 84px; left: 0; right: 0;
    z-index: 200;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    align-items: flex-start;
    padding: 24px var(--gutter) 30px;
    gap: 20px;
    transform: translateY(-110%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.25s ease, opacity 0.25s ease;
  }
  /* Even off-screen and invisible, the closed menu's own box still overlaps
     the hamburger button (its height is taller than the -110% offset), and
     with z-index:200 it sat on top of the button and swallowed every tap.
     pointer-events:none while closed (restored once opened) fixes it. */
  .nav-toggle-checkbox:checked ~ .main-nav { transform: translateY(0); opacity: 1; pointer-events: auto; }
  .nav-toggle { display: flex; position: relative; z-index: 201; }
  .nav-toggle-checkbox:checked ~ .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle-checkbox:checked ~ .nav-toggle span:nth-child(2) { opacity: 0; }
  .nav-toggle-checkbox:checked ~ .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .hero { padding: 70px 0 60px; }
  .services, .work, .about, .contact { padding: 70px 0; }

  .service-row { grid-template-columns: 1fr; gap: 10px; }
  .service-arrow { display: none; }
  .work-grid { grid-template-columns: 1fr; }
  .grid-corner { display: none; }
}

@media (max-width: 480px) {
  :root { --gutter: 18px; }
  .header-inner { height: 70px; }
  .brand-mark { height: 44px; }
  .main-nav { top: 70px; }
  .hero-sub { font-size: 1rem; }
  .hero-actions { gap: 12px; }
  .btn { padding: 13px 20px; font-size: 0.76rem; }
  .about-stats { gap: 24px; }
  .footer-inner { flex-direction: column; align-items: flex-start; gap: 16px; }
}

/* ===========================================================
   PERSIAN / RTL (used on the /fa/ page)
   =========================================================== */
:root { --font-fa: 'Vazirmatn', sans-serif; }

html[lang="fa"] body { font-family: var(--font-fa); }
html[lang="fa"] * { font-family: var(--font-fa); }

html[lang="fa"] .eyebrow,
html[lang="fa"] .main-nav a,
html[lang="fa"] .btn,
html[lang="fa"] .strip-track,
html[lang="fa"] .service-tag,
html[lang="fa"] .field label {
  letter-spacing: 0;
  text-transform: none;
}

html[lang="fa"] .hero-headline {
  line-height: 1.35;
  font-size: clamp(2.1rem, 6vw, 4rem);
}
html[lang="fa"] .section-title { max-width: 18em; line-height: 1.4; }
html[lang="fa"] .hero-sub { max-width: 38em; }
html[lang="fa"] .about-text p { max-width: 40em; }
html[lang="fa"] .contact-note { max-width: 34em; }
html[lang="fa"] .service-body p { max-width: 48em; }

/* keep emails, URLs and the Telegram handle reading left-to-right */
html[dir="rtl"] a[href^="mailto"],
html[dir="rtl"] a[href^="http"] {
  direction: ltr;
  unicode-bidi: embed;
}

/* ==========================================
   HERO MOBILE FIX
   ========================================== */

@media (max-width: 768px) {

  .hero {
    padding: 70px 0 50px;
    min-height: 420px;
  }

  .hero-slide {
    background-size: cover;
    background-position: center center;
  }

  .hero-headline {
    font-size: 2.2rem;
    line-height: 1.1;
    margin-bottom: 18px;
  }

  .hero-sub {
    font-size: 1rem;
    margin-bottom: 25px;
  }

  .hero-actions {
    justify-content: center;
    gap: 12px;
  }

  .btn {
    padding: 12px 22px;
    font-size: 0.75rem;
  }

  .hero-frame {
    inset: 12px;
  }
}

@media (max-width: 480px) {

  .hero {
    padding: 55px 0 40px;
    min-height: 360px;
  }

  .hero-headline {
    font-size: 1.8rem;
  }

  .hero-sub {
    font-size: 0.9rem;
  }

  .btn {
    width: 100%;
    text-align: center;
  }
}