/* Ahrari Group — one screen, no scroll, mobile first.
   Everything is self-hosted; the CSP in deploy/nginx blocks anything else. */

/* ---------- Fonts ---------------------------------------------------------- */

@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-latin-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Instrument Serif";
  src: url("../fonts/instrument-serif-latin-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Instrument Serif";
  src: url("../fonts/instrument-serif-latin-400-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Vazirmatn "Non-Latin": Persian script only. Latin letters and digits on the
   Persian page fall through to Inter. The range mirrors the font's own cmap. */
@font-face {
  font-family: "Vazirmatn";
  src: url("../fonts/vazirmatn-nl-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0020-0021, U+0028-0029, U+002B, U+002D-002F, U+003A, U+003D, U+005B, U+005D, U+00A0, U+00AB, U+00BB, U+00D7, U+00F7, U+0600-06FF, U+0750-077F, U+200B-200F, U+2012-2014, U+202A-202F, U+2212, U+2215, U+25CC, U+FB50-FDFF, U+FE70-FEFF;
}

/* ---------- Tokens --------------------------------------------------------- */

:root {
  --bg: #0a1628;
  --text: #f3eee4;
  --muted: #a3b2c6;
  --faint: #7d8ea6;
  --gold: #d4af6a;
  --gold-light: #ecd3a0;
  --line: rgb(212 175 106 / 0.28);
  --line-soft: rgb(255 255 255 / 0.09);

  --sans: "Inter", "Vazirmatn", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Instrument Serif", ui-serif, Georgia, "Times New Roman", serif;

  --container: 100%;
  --pad: clamp(1.25rem, 5vw, 3.5rem);
  --gap: clamp(1.5rem, 4.5svh, 3rem);
}

:root:lang(fa) {
  --sans: "Vazirmatn", "Inter", ui-sans-serif, system-ui, Tahoma, sans-serif;
  --display: var(--sans);
}

/* ---------- Base ----------------------------------------------------------- */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--bg);
}

/* Header, content, footer: one screen tall, never taller on supported sizes
   (tests/site.test.mjs checks every viewport in tests/viewports.mjs). */
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.top,
.main,
.foot {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--pad);
}

a {
  color: inherit;
}

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

/* ---------- Backdrop ------------------------------------------------------- */

.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(110% 70% at 100% 0%, rgb(212 175 106 / 0.13), transparent 60%),
    radial-gradient(90% 60% at 0% 100%, rgb(60 104 170 / 0.22), transparent 65%),
    linear-gradient(170deg, #0c1b31 0%, #081222 100%);
}

.backdrop__rosette {
  position: absolute;
  width: max(130vmin, 34rem);
  aspect-ratio: 1;
  top: min(-38vmin, -12rem);
  inset-inline-end: min(-42vmin, -13rem);
  color: var(--gold);
  opacity: 0.085;
}

.backdrop__rosette * {
  stroke-width: 1px;
  vector-effect: non-scaling-stroke;
}

/* ---------- Header --------------------------------------------------------- */

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: clamp(1rem, 3svh, 2rem);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
}

.brand__mark {
  flex: none;
  width: 2rem;
  height: 2rem;
  color: var(--gold);
}

.brand__name {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

:lang(fa) .brand__name {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0;
}

.lang {
  display: inline-flex;
  align-items: center;
  min-height: 2.5rem;
  padding: 0 1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.85rem;
  text-decoration: none;
  transition: border-color 0.2s, color 0.2s, background-color 0.2s;
}

.lang:hover {
  border-color: var(--gold);
  background-color: rgb(212 175 106 / 0.08);
  color: var(--gold-light);
}

.lang:lang(fa) {
  font-family: "Vazirmatn", var(--sans);
  font-size: 0.92rem;
}

.lang:lang(en) {
  font-family: "Inter", ui-sans-serif, system-ui, sans-serif;
}

/* ---------- Intro ---------------------------------------------------------- */

.main {
  display: grid;
  align-content: center;
  gap: var(--gap);
  padding-block: clamp(0.75rem, 2.5svh, 2rem);
}

.eyebrow {
  margin: 0 0 0.9em;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
}

:lang(fa) .eyebrow {
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0;
}

.sep {
  display: inline-block;
  width: 0.38em;
  height: 0.38em;
  margin-inline: 0.8em 0.55em;
  background: currentColor;
  transform: rotate(45deg);
  vertical-align: 0.14em;
}

:lang(fa) .sep {
  margin-inline: 0.45em;
  vertical-align: 0.2em;
}

/* Two lines on every screen: the plain phrase, then the gold one. */
h1 {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2.25rem, min(12.5vw, 7.2svh), 4.25rem);
  line-height: 0.98;
  letter-spacing: -0.01em;
}

h1 em {
  display: block;
  font-style: italic;
  color: var(--gold-light);
}

:lang(fa) h1 {
  font-weight: 800;
  font-size: clamp(1.7rem, min(9.5vw, 5.6svh), 3.1rem);
  line-height: 1.3;
  letter-spacing: 0;
}

:lang(fa) h1 em {
  font-style: normal;
}

.lede {
  margin: 1.1em 0 0;
  max-width: 36rem;
  font-size: clamp(0.9rem, 0.55svh + 0.7rem, 1.12rem);
  line-height: 1.6;
  color: var(--muted);
  text-wrap: pretty;
}

:lang(fa) .lede {
  line-height: 1.85;
}

.lede a {
  color: var(--gold-light);
  text-underline-offset: 0.2em;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.4rem 0 0;
  padding: 0;
  list-style: none;
}

.tags li {
  padding: 0.3em 0.85em;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgb(212 175 106 / 0.06);
  font-size: 0.76rem;
  white-space: nowrap;
}

:lang(fa) .tags li {
  font-size: 0.82rem;
}

/* ---------- Contact -------------------------------------------------------- */

.contact {
  padding: 0.35rem 1.15rem;
  border: 1px solid var(--line-soft);
  border-radius: 1.1rem;
  background:
    linear-gradient(180deg, rgb(255 255 255 / 0.055), rgb(255 255 255 / 0.015)),
    rgb(10 22 40 / 0.35);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.contact__title {
  margin: 0.75rem 0 0.2rem;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
}

:lang(fa) .contact__title {
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0;
}

.contact__body {
  font-style: normal;
}

.contact__list {
  margin: 0;
}

.row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.72rem 0;
  border-top: 1px solid var(--line-soft);
}

.row:first-child {
  border-top: 0;
}

.row dt {
  flex: none;
  font-size: 0.74rem;
  color: var(--faint);
}

:lang(fa) .row dt {
  font-size: 0.82rem;
}

.row dd {
  min-width: 0;
  margin: 0;
  text-align: end;
  font-size: 0.95rem;
  font-weight: 500;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.row a {
  text-decoration: none;
  background: linear-gradient(currentColor, currentColor) no-repeat 100% 100% / 0 1px;
  transition: background-size 0.3s, color 0.2s;
}

.row a:hover {
  color: var(--gold-light);
  background-position: 0 100%;
  background-size: 100% 1px;
}

/* ---------- Footer --------------------------------------------------------- */

.foot {
  padding-bottom: clamp(0.9rem, 2.5svh, 1.75rem);
  font-size: 0.72rem;
  color: var(--faint);
}

.foot p {
  margin: 0;
}

:lang(fa) .foot {
  font-size: 0.78rem;
}

/* ---------- Short phones, portrait ----------------------------------------- */

/* The rows are labelled, so the card title is the first thing to go. */
@media (orientation: portrait) and (max-height: 48rem) {
  .contact__title {
    display: none;
  }

  .contact {
    padding-block: 0.2rem;
  }
}

@media (orientation: portrait) and (max-height: 44rem) {
  :root {
    --gap: 1.1rem;
  }

  .lede {
    font-size: 0.88rem;
  }

  .tags {
    margin-top: 1rem;
    gap: 0.4rem;
  }

  .row {
    padding: 0.55rem 0;
  }
}

@media (orientation: portrait) and (max-height: 36rem) {
  :root {
    --gap: 1rem;
  }

  .top {
    padding-top: 0.75rem;
  }

  .brand__mark {
    width: 1.75rem;
    height: 1.75rem;
  }

  .lang {
    min-height: 2.25rem;
  }

  .eyebrow {
    margin-bottom: 0.55em;
  }

  h1 {
    font-size: clamp(2rem, 6.6svh, 2.6rem);
  }

  :lang(fa) h1 {
    font-size: clamp(1.5rem, 5.2svh, 2rem);
  }

  .lede {
    margin-top: 0.65em;
    font-size: 0.82rem;
    line-height: 1.45;
  }

  :lang(fa) .lede {
    line-height: 1.7;
  }

  .tags {
    margin-top: 0.8rem;
  }

  .tags li {
    font-size: 0.7rem;
  }

  .row {
    padding: 0.4rem 0;
  }

  .row dd {
    font-size: 0.88rem;
  }
}

/* ---------- Tablets, portrait: one centred column -------------------------- */

@media (orientation: portrait) and (min-width: 40rem) {
  :root {
    --container: 46rem;
  }

  h1 {
    font-size: clamp(3.5rem, min(9vw, 6.4svh), 5.25rem);
  }

  :lang(fa) h1 {
    font-size: clamp(2.5rem, min(6.4vw, 4.6svh), 3.8rem);
  }

  .lede {
    font-size: 1.12rem;
  }

  .tags li {
    font-size: 0.85rem;
  }

  .contact {
    padding-inline: 1.75rem;
  }

  .row {
    padding: 1rem 0;
  }

  .row dt {
    font-size: 0.82rem;
  }

  .row dd {
    font-size: 1.08rem;
  }
}

/* ---------- Two columns: desktops, tablets and phones in landscape --------- */

@media (min-width: 60rem), (orientation: landscape) and (min-width: 36rem) {
  .main {
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    align-items: center;
    column-gap: clamp(2rem, 7vw, 7rem);
  }
}

@media (min-width: 60rem) and (min-height: 30.01rem) {
  :root {
    --container: 80rem;
  }

  h1 {
    font-size: clamp(3.25rem, min(5.4vw, 11.5svh), 5.5rem);
  }

  :lang(fa) h1 {
    font-size: clamp(2.4rem, min(3.8vw, 8.4svh), 4.2rem);
  }

  .contact {
    padding: 0.6rem 1.75rem 0.8rem;
  }

  .contact__title {
    margin-top: 1rem;
  }

  .row {
    padding: 1rem 0;
  }

  .row dt {
    font-size: 0.8rem;
  }

  .row dd {
    font-size: 1.05rem;
  }

  .tags li {
    font-size: 0.82rem;
  }
}

/* Big screens: scale the whole page up (every size above is in rem). */
@media (min-width: 100rem) and (min-height: 52rem) {
  html {
    font-size: 112.5%;
  }
}

@media (min-width: 150rem) and (min-height: 75rem) {
  html {
    font-size: 125%;
  }
}

/* Phones sideways: very little height, so everything tightens. */
@media (orientation: landscape) and (max-height: 30rem) {
  .top {
    padding-top: 0.6rem;
  }

  .brand__mark {
    width: 1.6rem;
    height: 1.6rem;
  }

  .lang {
    min-height: 2rem;
  }

  .main {
    padding-block: 0.4rem;
  }

  .eyebrow {
    margin-bottom: 0.5em;
  }

  h1 {
    font-size: clamp(1.6rem, 9svh, 2.4rem);
  }

  :lang(fa) h1 {
    font-size: clamp(1.25rem, 6.6svh, 1.9rem);
    line-height: 1.35;
  }

  .lede {
    margin-top: 0.6em;
    font-size: 0.8rem;
    line-height: 1.45;
  }

  :lang(fa) .lede {
    line-height: 1.75;
  }

  .tags {
    margin-top: 0.7rem;
    gap: 0.35rem;
  }

  .tags li {
    font-size: 0.68rem;
  }

  .contact {
    padding-block: 0.2rem;
  }

  .contact__title {
    display: none;
  }

  .row {
    padding: 0.42rem 0;
  }

  .row dd {
    font-size: 0.85rem;
  }

  .foot {
    padding-bottom: 0.5rem;
  }
}

/* ---------- Motion --------------------------------------------------------- */

@media (prefers-reduced-motion: no-preference) {
  .intro,
  .contact {
    animation: fade-in 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  }

  .contact {
    animation-delay: 0.15s;
  }

  .backdrop__rosette {
    animation: turn 240s linear infinite;
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

@keyframes turn {
  to {
    transform: rotate(1turn);
  }
}
