/* Rahvar Peyvand Dadeh: one page, server-rack motif.
   Deep teal for structure, amber and green as the "link lights" of network gear. */

@font-face {
  font-family: "Vazirmatn";
  src: url("../fonts/vazirmatn-arabic-wght-normal.woff2") format("woff2-variations");
  font-weight: 100 900; font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+200C-200E, U+2010-2011, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
  font-family: "Vazirmatn";
  src: url("../fonts/vazirmatn-latin-wght-normal.woff2") format("woff2-variations");
  font-weight: 100 900; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+FEFF, U+FFFD;
}

:root {
  --page: #EEF2F1;
  --panel: #FFFFFF;
  --ink: #0F1E22;
  --muted: #4C5D62;
  --line: #CCD7D5;
  --teal-950: #072A31;
  --teal-900: #0B3A44;
  --teal-700: #12596A;
  --mint: #7FD1C1;
  --amber: #E9A23B;
  --green: #46C28E;
  --led-off: #2A4A51;

  --f-text: "Vazirmatn", Tahoma, system-ui, sans-serif;
  --f-display: "Vazirmatn", Tahoma, sans-serif;

  --max: 1160px;
  --gutter: clamp(16px, 4vw, 48px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 76px; }
body { margin: 0; background: var(--page); color: var(--ink); font-family: var(--f-text); font-size: 1rem; line-height: 1.85; overflow-x: hidden; }
h1, h2, h3 { margin: 0; }
p { margin: 0; }
a { color: inherit; }
img { display: block; max-width: 100%; height: auto; }
ul, ol { margin: 0; padding: 0; list-style: none; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; border-radius: 4px; }
.skip { position: absolute; inset-inline-start: 12px; top: -60px; z-index: 50; background: var(--teal-900); color: #fff; padding: 8px 14px; border-radius: 8px; text-decoration: none; }
.skip:focus { top: 12px; }

/* ---------- Header ---------- */
.bar { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--page) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid transparent; transition: border-color .3s; }
.bar.is-stuck { border-bottom-color: var(--line); }
.bar-inner { max-width: var(--max); margin: 0 auto; padding: 10px var(--gutter); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark { width: 38px; height: 38px; flex: none; }
.brand-name { font-family: var(--f-display); font-weight: 750; font-size: 1.05rem; color: var(--teal-900); }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a { text-decoration: none; padding: 6px 12px; border-radius: 999px; color: var(--muted); font-weight: 600; font-size: .95rem; }
.nav a:hover { color: var(--ink); background: rgba(11,58,68,.06); }
.nav .nav-cta { background: var(--teal-900); color: #fff; margin-inline-start: 6px; }
.nav .nav-cta:hover { background: var(--teal-700); color: #fff; }

/* ---------- Hero ---------- */
.hero { max-width: var(--max); margin: 0 auto; padding: clamp(28px, 6vw, 80px) var(--gutter) clamp(36px, 5vw, 64px);
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 72px); align-items: center; }
.hero h1 { font-family: var(--f-display); font-weight: 900; font-size: clamp(2.4rem, 5.2vw, 3.9rem); line-height: 1.35; color: var(--teal-900); }
.hero-sub { margin-top: 6px; font-size: clamp(1.15rem, 2.2vw, 1.5rem); font-weight: 700; color: var(--teal-700); }
.hero-text { margin-top: 18px; max-width: 46ch; font-size: 1.1rem; color: var(--ink); }
.hero-actions { margin-top: 30px; display: flex; flex-wrap: wrap; gap: 12px; }
.btn { display: inline-flex; align-items: center; padding: 12px 24px; border-radius: 999px; text-decoration: none; font-weight: 700; transition: background .2s, color .2s, border-color .2s; }
.btn-solid { background: var(--teal-900); color: #fff; }
.btn-solid:hover { background: var(--teal-700); }
.btn-line { border: 1.5px solid var(--teal-700); color: var(--teal-900); }
.btn-line:hover { background: var(--panel); }

.hero { position: relative; isolation: isolate; }
.hero-bg { position: absolute; z-index: -1; top: 0; bottom: 0; left: 50%; width: 100vw; transform: translateX(-50%); pointer-events: none;
  background-image: radial-gradient(rgba(11,58,68,.13) 1px, transparent 1.4px); background-size: 26px 26px;
  -webkit-mask-image: radial-gradient(ellipse 70% 75% at 50% 45%, #000 30%, transparent 78%); mask-image: radial-gradient(ellipse 70% 75% at 50% 45%, #000 30%, transparent 78%); }
.hero-bg i { position: absolute; left: 0; right: 0; height: 1px; background: linear-gradient(90deg, transparent, rgba(18,89,106,.12) 20%, rgba(18,89,106,.12) 80%, transparent); overflow: hidden; }
.hero-bg i:nth-child(1) { top: 4%; } .hero-bg i:nth-child(2) { top: 7%; } .hero-bg i:nth-child(3) { top: 94%; } .hero-bg i:nth-child(4) { top: 97%; }
.hero-bg i::after { content: ""; position: absolute; top: -1px; height: 3px; width: 140px; border-radius: 3px; right: -160px;
  background: linear-gradient(270deg, transparent, var(--amber), transparent); animation: signal 7s linear infinite; }
.hero-bg i:nth-child(2)::after { animation-duration: 9s; animation-delay: -3s; background: linear-gradient(270deg, transparent, var(--mint), transparent); }
.hero-bg i:nth-child(3)::after { animation-duration: 8s; animation-delay: -5.5s; }
.hero-bg i:nth-child(4)::after { animation-duration: 11s; animation-delay: -1.5s; background: linear-gradient(270deg, transparent, var(--mint), transparent); }
@keyframes signal { from { transform: translateX(0); } to { transform: translateX(calc(-100vw - 200px)); } }

/* Rack: five units = the five registered activities */
.rack { margin: 0; background: linear-gradient(180deg, var(--teal-900), var(--teal-950)); border-radius: 18px; padding: 14px 14px 18px;
  box-shadow: 0 40px 70px -40px rgba(7,42,49,.7), inset 0 1px 0 rgba(255,255,255,.06); }
.rack-top { display: flex; gap: 6px; justify-content: flex-end; padding: 0 6px 10px; }
.rack-top span { width: 8px; height: 8px; border-radius: 50%; background: var(--led-off); }
.rack-units { display: grid; gap: 8px; }
.unit { display: flex; align-items: center; gap: 12px; padding: 12px 10px; border-radius: 10px;
  background: linear-gradient(180deg, #11434E, #0D3740); border: 1px solid rgba(127,209,193,.12); }
.ear { width: 6px; height: 22px; border-radius: 3px; background: repeating-linear-gradient(180deg, #2C5A63 0 4px, transparent 4px 9px); flex: none; }
.unit-label { flex: 1; min-width: 0; color: #E6EFEE; font-size: .9rem; font-weight: 600; line-height: 1.5; }
.leds { display: flex; gap: 5px; flex: none; }
.leds i { width: 7px; height: 7px; border-radius: 50%; background: var(--led-off); }
.leds i.g { background: var(--green); box-shadow: 0 0 8px rgba(70,194,142,.8); }
.leds i.a { background: var(--amber); box-shadow: 0 0 8px rgba(233,162,59,.8); }
html:not(.motion) .leds i:nth-child(1), html:not(.motion) .leds i:nth-child(3) { background: var(--green); }
.ports { display: grid; grid-template-columns: repeat(3, 12px); gap: 4px; flex: none; }
.ports b { height: 9px; border-radius: 2px; background: #062227; border: 1px solid #23515A; }
.rack-foot { margin: 12px auto 0; width: 60%; height: 4px; border-radius: 4px; background: rgba(127,209,193,.18); }

/* ---------- Sections ---------- */
main > section:not(.hero):not(.contact) { max-width: var(--max); margin: 0 auto; padding: clamp(32px, 4.5vw, 60px) var(--gutter); }
main > section.team { padding-bottom: clamp(48px, 7vw, 88px); }
.sec-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 18px; margin-bottom: 28px; }
.sec-head h2 { font-family: var(--f-display); font-weight: 800; font-size: clamp(1.7rem, 3.4vw, 2.3rem); color: var(--teal-900); line-height: 1.4; }
.sec-head p { color: var(--muted); }

/* Services: rows, each with a link light that turns on when reached */
.svc-list { border-top: 2px solid var(--teal-900); }
.svc { position: relative; display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 18px; align-items: start; padding: 24px 16px; margin-inline: -16px; border-bottom: 1px solid var(--line); border-radius: 12px; transition: background .3s; }
.svc:hover { background: rgba(255,255,255,.65); }
.svc-led { width: 12px; height: 12px; border-radius: 50%; margin-top: 12px; background: #B9C6C4; transition: background .5s, box-shadow .5s; }
.svc.is-on .svc-led, html:not(.motion) .svc-led { background: var(--green); box-shadow: 0 0 0 4px rgba(70,194,142,.18); }
.svc h3 { font-size: 1.25rem; font-weight: 800; color: var(--teal-900); line-height: 1.6; }
.svc p { margin-top: 6px; max-width: 70ch; text-align: justify; text-justify: inter-word; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.tags li { font-size: .85rem; padding: 2px 12px; border-radius: 999px; background: rgba(18,89,106,.08); color: var(--teal-900); }

/* Process */
.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; position: relative; }
.steps::before, .steps::after { content: ""; position: absolute; top: 21px; inset-inline: 22px; height: 2px; background: var(--line); }
.steps::after { background: var(--amber); transform: scaleX(var(--p, 1)); transform-origin: right; }
html[dir="ltr"] .steps::after { transform-origin: left; }
.step { position: relative; z-index: 1; }
.step-n { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--teal-900); color: #fff; font-family: var(--f-display); font-weight: 800; font-size: 1.1rem; box-shadow: 0 0 0 6px var(--page); }
.step h3 { margin-top: 14px; font-size: 1.1rem; font-weight: 800; color: var(--teal-900); }
.step p { margin-top: 4px; color: var(--muted); font-size: .95rem; }

/* Work */
.work-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: stretch; }
.case-feature { grid-column: 1 / -1; }
.case-icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--teal-900); color: var(--mint); margin-bottom: 6px; }
.case .tags { margin-top: 4px; }
.case { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; transition: transform .35s cubic-bezier(.2,.7,.2,1), box-shadow .35s; }
.case:hover, .person:hover { transform: translateY(-4px); box-shadow: 0 24px 40px -28px rgba(7,42,49,.45); }
.case-media > img:first-child { transition: transform .8s cubic-bezier(.2,.7,.2,1); }
.case:hover .case-media > img:first-child { transform: scale(1.04); }
.case-feature { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); }
.case-media { position: relative; min-height: 240px; background: var(--teal-900); }
.case-media > img:first-child { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .85; }
.case-logo { position: absolute; inset-inline-start: 16px; bottom: 16px; width: 64px; height: 64px; border-radius: 14px; background: #fff; padding: 6px; box-shadow: 0 10px 24px -10px rgba(0,0,0,.5); }
.case-body { padding: 22px 24px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.case-mark { width: 56px; height: 56px; object-fit: contain; border-radius: 50%; margin-bottom: 6px; box-shadow: 0 8px 18px -10px rgba(0,0,0,.45); }
.case h3 { font-size: 1.2rem; font-weight: 800; color: var(--teal-900); line-height: 1.6; }
.case p { text-align: justify; text-justify: inter-word; }
.case-link { margin-top: auto; align-self: flex-start; font-weight: 700; color: var(--teal-700); text-decoration: underline; text-decoration-color: var(--amber); text-underline-offset: 5px; direction: ltr; }

/* Team */
.people { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.person { transition: transform .35s cubic-bezier(.2,.7,.2,1), box-shadow .35s; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 18px; align-items: start; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 22px 24px; }
.mono { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--teal-900); color: var(--mint); font-family: var(--f-display); font-weight: 800; font-size: 1.6rem; line-height: 1; padding-top: 4px; }
.person h3 { font-size: 1.2rem; font-weight: 800; color: var(--teal-900); }
.role { color: var(--teal-700); font-weight: 700; margin-bottom: 6px !important; }
.person p:not(.role) { text-align: justify; text-justify: inter-word; }
.person-link { display: inline-block; margin-top: 10px; font-weight: 700; color: var(--teal-700); text-decoration: underline; text-decoration-color: var(--amber); text-underline-offset: 5px; }

/* Contact */
.contact { background: var(--teal-900); color: #E6EFEE; }
.contact-inner { max-width: var(--max); margin: 0 auto; padding: clamp(48px, 8vw, 100px) var(--gutter); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(24px, 5vw, 64px); align-items: center; }
.contact h2 { font-family: var(--f-display); font-weight: 800; font-size: clamp(1.6rem, 3.2vw, 2.2rem); line-height: 1.5; color: #fff; }
.contact-inner > div > p { margin-top: 10px; color: rgba(230,239,238,.8); }
.contact-list { display: grid; border-top: 1px solid rgba(127,209,193,.25); }
.contact-list li { display: grid; grid-template-columns: 5em minmax(0, 1fr); gap: 12px; align-items: baseline; padding: 14px 0; border-bottom: 1px solid rgba(127,209,193,.25); }
.c-k { color: var(--mint); font-size: .9rem; }
.c-v { font-size: 1.15rem; font-weight: 700; color: #fff; text-decoration: none; justify-self: start; }
a.c-v:hover { color: var(--amber); }

/* Footer */
.foot { background: var(--teal-950); color: rgba(230,239,238,.7); font-size: .9rem; }
.foot-inner { max-width: var(--max); margin: 0 auto; padding: 20px var(--gutter); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; }
.foot nav { display: flex; gap: 16px; flex-wrap: wrap; }
.foot a { text-decoration: none; }
.foot a:hover { color: #fff; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .rack { max-width: 520px; width: 100%; justify-self: center; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 32px; }
  .steps::before, .steps::after { display: none; }
  .work-grid, .people, .contact-inner { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .nav a:not(.nav-cta) { display: none; }
  .brand-name { font-size: .98rem; }
  .svc { grid-template-columns: 12px minmax(0, 1fr); gap: 14px; }
  .case-feature { grid-template-columns: 1fr; }
  .case-media { min-height: 200px; }
  .ports { display: none; }
  .person p:not(.role), .case p, .svc p { text-align: start; }
  .unit-label { font-size: .85rem; }
}
@media (max-width: 420px) {
  .steps { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-bg i::after { animation: none; display: none; }
  .case, .person, .case-media > img:first-child { transition: none; }
}
