/* PiriGram site. Dark by design, in the PopSkip client's dark palette, so the studio and its products read as one family. */
:root {
  --bg: #0F1218; --surface: #161B25; --card: #1A1F2B; --ink: #ECEFF4; --muted: #A3ACBD; --line: #262D3B;
  --accent: #F2A21B; --accent-strong: #F7B733; --accent-ink: #2A1A00; --danger: #FF7A7E; --ok: #4FD1A0;
  --focus: #FFD27A; --radius: 14px; --wrap: 1080px; --gutter: 20px;
  color-scheme: dark;
}
/* The wordmark face (D-0136): Aref Ruqaa, Latin letters drawn to sit beside Ruqʿa script. Self-hosted, OFL (fonts/OFL-ArefRuqaa.txt). */
@font-face { font-family: "Aref Ruqaa"; src: url("fonts/aref-ruqaa-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif; -webkit-text-size-adjust: 100%; }
body { padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); line-height: 1.6; }
a { color: inherit; }
img { max-width: 100%; height: auto; display: block; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
.skip { position: absolute; left: -10000px; top: 8px; }
.skip:focus { left: 12px; z-index: 20; background: var(--card); padding: 10px 14px; border-radius: 10px; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

/* Header: compact wordmark and anchor navigation. */
.top { position: sticky; top: 0; z-index: 10; background: rgba(15, 18, 24, 0.92); backdrop-filter: saturate(140%) blur(10px); -webkit-backdrop-filter: saturate(140%) blur(10px); border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; flex-wrap: wrap; }
.wordmark { font-family: "Aref Ruqaa", Georgia, serif; font-size: 23px; font-weight: 700; line-height: 1; text-decoration: none; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; }
.wordmark img { width: 28px; height: 28px; display: block; }
.nav { display: flex; gap: 2px; margin: 0 -8px; }
.nav a:focus-visible { outline-offset: -3px; }
.nav::-webkit-scrollbar { display: none; }
.nav a { padding: 8px 10px; border-radius: 8px; color: var(--muted); font-weight: 600; font-size: 15px; text-decoration: none; white-space: nowrap; min-height: 44px; display: inline-flex; align-items: center; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); }
.menu-btn { display: none; }
@media (max-width: 639px) {
  .nav { overflow-x: auto; scrollbar-width: none; }
  .nav a { font-size: 14px; padding: 8px 6px; }
  .js .menu-btn { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font: inherit; font-weight: 650; font-size: 15px; cursor: pointer; }
  .js .nav { display: none; }
  .js .top.open .nav { display: flex; flex-direction: column; width: 100%; margin: 0; padding: 4px 0 12px; }
  .js .top.open .nav a { font-size: 17px; padding: 10px 0; color: var(--ink); border-top: 1px solid var(--line); }
}

/* Type */
h1, h2, h3 { margin: 0; line-height: 1.15; letter-spacing: -0.015em; }
h1 { font-size: clamp(34px, 6.2vw, 58px); font-weight: 750; }
h2 { font-size: clamp(26px, 3.6vw, 36px); font-weight: 720; }
h3 { font-size: 18px; font-weight: 700; letter-spacing: -0.005em; }
p { margin: 0; }
.muted { color: var(--muted); }
.eyebrow { font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); font-weight: 700; }
.lead { font-size: clamp(17px, 2vw, 19px); color: var(--muted); max-width: 40em; }

/* Sections */
.section { padding: 88px 0; border-top: 1px solid var(--line); }
.section-head { display: flex; flex-direction: column; gap: 12px; margin-bottom: 44px; max-width: 44em; }
@media (max-width: 639px) { .section { padding: 60px 0; } .section-head { margin-bottom: 32px; } }

/* Hero */
.hero { padding: 96px 0 88px; }
.hero .wrap { display: flex; flex-direction: column; gap: 22px; align-items: flex-start; }
.hero h1 { max-width: 13em; }
.hero .lead { max-width: 34em; }
@media (max-width: 639px) { .hero { padding: 56px 0 60px; } .hero .wrap { gap: 18px; } }

/* Buttons */
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 11px 20px; border-radius: 12px; font-weight: 700; font-size: 16px; text-decoration: none; border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; font-family: inherit; transition: border-color 140ms, background-color 140ms; }
.btn:hover { border-color: #3A4356; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn:disabled { opacity: .6; cursor: default; }
.text-link { color: var(--accent); font-weight: 700; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; }
.text-link:hover { text-decoration: underline; text-underline-offset: 4px; }
.text-link::after { content: "→"; }
@media (max-width: 479px) { .hero .row .btn { flex: 1 1 100%; } }

/* Products: screenshot-led rows */
.products { display: flex; flex-direction: column; gap: 96px; }
.product { display: grid; grid-template-columns: 1fr; gap: 32px; align-items: center; }
.product-copy { display: flex; flex-direction: column; gap: 16px; }
.product-meta { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; font-size: 14px; color: var(--muted); font-weight: 600; }
.status { display: inline-flex; align-items: center; gap: 7px; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink); font-size: 13px; font-weight: 650; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.product-copy h3 { font-size: 30px; }
.product-copy p { color: var(--muted); font-size: 17px; max-width: 32em; }
.product-copy .note { font-size: 14px; }
.note a.inline { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.facts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 15px; color: var(--muted); max-width: 32em; }
.facts li { padding-left: 18px; position: relative; }
.facts li::before { content: ""; position: absolute; left: 0; top: 0.68em; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.shot { margin: 0; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--surface); }
.shot img { width: 100%; }
figcaption { font-size: 13px; color: var(--muted); padding: 10px 2px 0; line-height: 1.45; }
.phones { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.phones.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.phones figure { margin: 0; }
.phones img { border-radius: 22px; border: 1px solid var(--line); width: 100%; }
.phones.offset figure:nth-child(2) { margin-top: 48px; }
.duo { display: grid; gap: 16px; align-items: start; }
@media (min-width: 760px) { .duo { grid-template-columns: 1.85fr 1fr; } }
.follow { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; color: var(--ink); text-decoration: none; min-height: 44px; }
.follow svg { width: 18px; height: 18px; fill: currentColor; }
@media (max-width: 599px) { .phones.three { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; } .phones img { border-radius: 14px; } .phones.offset figure:nth-child(2) { margin-top: 24px; } .phones figcaption { display: none; } }
@media (min-width: 860px) {
  .product { grid-template-columns: 5fr 6fr; gap: 64px; }
  .product.stacked { grid-template-columns: 1fr; gap: 36px; }

}

/* Engineering and consulting: rules, not boxes */
.areas { display: grid; grid-template-columns: 1fr; gap: 0; list-style: none; margin: 0; padding: 0; }
.areas > li { padding: 22px 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.areas p { color: var(--muted); }
@media (min-width: 760px) {
  .areas.two { grid-template-columns: repeat(2, 1fr); column-gap: 48px; }
}
.after { margin-top: 32px; }

/* About */
.about { display: grid; grid-template-columns: 1fr; gap: 20px; }
.about .body { display: flex; flex-direction: column; gap: 18px; font-size: 17px; max-width: 38em; }
.about .body p { color: var(--muted); }
.about .edu { font-size: 14px; color: var(--muted); }
.about-side { display: flex; flex-direction: column; gap: 24px; }
.about-map { margin: 4px 0 0; max-width: 380px; }
.about-map img { width: 100%; border-radius: 12px; border: 1px solid var(--line); }
.about-map figcaption { padding-top: 8px; font-size: 13px; }
.about-photos { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; max-width: 420px; }
.about-photos figure { margin: 0; }
.about-photos img { width: 100%; border-radius: 12px; border: 1px solid var(--line); }
.about-photos figcaption { padding-top: 6px; font-size: 13px; }
@media (min-width: 860px) { .about-photos { grid-template-columns: 1fr; max-width: 300px; } .about-photos figure:nth-child(2) { width: 70%; margin-left: auto; margin-top: -60px; position: relative; } .about-photos figure:nth-child(2) img { box-shadow: 0 14px 34px rgba(0,0,0,.55); } }
@media (min-width: 860px) { .about { grid-template-columns: 5fr 7fr; gap: 56px; } }

/* Contact form */
.contact { display: grid; grid-template-columns: 1fr; gap: 28px; }
@media (min-width: 860px) { .contact { grid-template-columns: 5fr 7fr; gap: 56px; } }
form { display: flex; flex-direction: column; gap: 16px; }
label, .field-label { display: flex; flex-direction: column; gap: 7px; font-weight: 650; font-size: 15px; }
.optional { color: var(--muted); font-weight: 500; }
input, textarea, select { font: inherit; font-size: 16px; color: var(--ink); background: var(--surface); border: 1px solid #333C4E; border-radius: 10px; padding: 12px 14px; width: 100%; }
select { appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 40px; }
input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; border-color: transparent; }
[aria-invalid="true"] { border-color: var(--danger); }
textarea { min-height: 160px; resize: vertical; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-status { font-size: 15px; font-weight: 600; border-radius: 10px; }
.form-status:empty { display: none; }
.form-status.ok, .form-status.err { padding: 12px 14px; border: 1px solid; }
.form-status.ok { color: var(--ok); border-color: rgba(79, 209, 160, 0.4); background: rgba(79, 209, 160, 0.08); }
.form-status.err { color: var(--danger); border-color: rgba(255, 122, 126, 0.4); background: rgba(255, 122, 126, 0.08); }
.fine { font-size: 13px; color: var(--muted); }
.fine a { text-decoration: underline; text-underline-offset: 3px; }

/* Case study */
.page-head { padding: 72px 0 40px; }
.page-head .wrap { display: flex; flex-direction: column; gap: 18px; align-items: flex-start; }
.prose { display: flex; flex-direction: column; gap: 14px; font-size: 17px; max-width: 42em; }
.wrap.prose { max-width: var(--wrap); }
.wrap.prose > * { max-width: 42em; }
.prose h2 { font-size: clamp(22px, 2.6vw, 28px); margin-top: 28px; }
.prose h3 { margin-top: 12px; }
.prose p, .prose li { color: var(--muted); }
.prose strong { color: var(--ink); font-weight: 650; }
.prose ul { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }
.prose a:not(.btn) { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.prose .date { font-size: 14px; }
.flow { list-style: none; margin: 8px 0; padding: 0; display: flex; flex-direction: column; gap: 0; counter-reset: flow; }
.flow li { position: relative; padding: 12px 14px 12px 48px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); counter-increment: flow; }
.flow li + li { margin-top: 22px; }
.flow li + li::before { content: "↓"; position: absolute; top: -21px; left: 22px; color: var(--muted); font-size: 14px; }
.flow li::after { content: counter(flow); position: absolute; left: 14px; top: 12px; width: 22px; height: 22px; border-radius: 50%; background: var(--card); color: var(--accent); font-size: 13px; font-weight: 700; display: grid; place-items: center; }
.flow small { display: block; color: var(--muted); font-size: 14px; }
.flow .planned { border-style: dashed; background: transparent; }

/* Legal and support pages */
.doc { padding: 56px 0 72px; }
.doc .wrap { max-width: 760px; display: flex; flex-direction: column; gap: 28px; }
.doc h1 { font-size: clamp(30px, 4.5vw, 42px); }
.doc section { display: flex; flex-direction: column; gap: 14px; }
.doc a:not(.btn) { text-decoration: underline; text-underline-offset: 3px; }

/* Footer */
.foot { border-top: 1px solid var(--line); padding: 32px 0 40px; color: var(--muted); font-size: 14px; }
.foot .wrap { display: flex; flex-direction: column; gap: 14px; }
.foot .links { display: flex; gap: 6px 18px; flex-wrap: wrap; }
.foot a { color: var(--ink); font-weight: 600; text-decoration: none; min-height: 32px; display: inline-flex; align-items: center; }
.foot a:hover { text-decoration: underline; text-underline-offset: 3px; }
@media (min-width: 640px) { .foot .wrap { flex-direction: row; justify-content: space-between; align-items: center; } }

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .btn { transition: none; } }
