/* ==========================================================================
   PHONES AND TOUCH SCREENS
   The phone is the first screen this site is read on, and a phone's browser leaves it far less height than
   the phone has (about 550 to 700 px between its own bars). So a phone gets its own layout, not the wide
   one squeezed: what is pressed is a thumb wide, nothing speaks of keys or waits for a hover, the scenes of
   the home page keep their room at any height (the text gives way: the opening paragraph folds to the lines
   that fit, and opens at a touch), the header steps aside while the page is read downwards and a thin line
   shows how far the page has been read, and the footer is short.
   html.is-touch is set by fa.js (a touch screen, or the first touch); the widths are the site's own
   (900 px: the phone layout; 560 px: a phone held upright). Loaded after every other sheet but the English
   type (fa-type-en.css), so what is said here holds.
   ========================================================================== */

/* ---------- By hand: nothing speaks of keys, nothing waits for a hover ---------- */
/* (the controls' tooltips name keys, and a tap would leave one hanging; the tour's hint says to swipe) */
.is-touch .seg::after, .is-touch .cnav__btn::after { display: none; }
.is-touch .cycle__hint-k, .is-touch .cycle.no-keys .cycle__hint-c { display: none; }
.is-touch .cycle__hint-t { display: inline; }
/* a tap leaves «hover» behind on what was tapped: buttons, links and controls go back to rest instead, and
   answer the press itself */
.is-touch .btn:hover::before { transform: translateY(101%); }
.is-touch .btn:hover svg { transform: none; }
html[dir="ltr"].is-touch .btn:hover svg { transform: scaleX(-1); }
.is-touch .btn--light:hover { box-shadow: none; }
.is-touch .btn--ghost:hover { color: var(--mist); }
.is-touch .btn--outline:hover { color: var(--navy); }
.is-touch .hubfoot__next.btn:hover, .is-touch .footer .footer__next.btn:hover { color: var(--white); border-color: rgba(226, 231, 234, 0.55); }
.is-touch .more:hover .circ { transform: none; background: var(--blue); color: var(--white); }
.is-touch .more:hover span.t { background-size: 0 1.5px; }
.is-touch .cnav__btn:hover { opacity: 0.66; background: none; }
.is-touch .cycle.is-tour .cnav .cnav__btn:hover { opacity: 0.92; background-color: rgba(14, 49, 121, 0.4); border-color: rgba(226, 231, 234, 0.34); }
.is-touch .seg:not(.is-on):hover i { opacity: 0.4; transform: none; }
.is-touch .cycle.is-tour .seg:not(.is-on):hover i { opacity: 0.42; }
.is-touch .copy:not(.is-done):hover { background: none; color: var(--mist); }
.is-touch .crow:hover .ico { background: rgba(226, 231, 234, 0.08); color: var(--mist); }
.is-touch .sibling:hover { background: none; border-color: var(--line); }
.is-touch .sibling:hover svg { transform: none; color: var(--on-navy-dim); }
html[dir="ltr"].is-touch .sibling:hover svg { transform: scaleX(-1); }
.is-touch .btn, .is-touch .more .circ, .is-touch .path, .is-touch .sibling, .is-touch .cnode, .is-touch .mcard { -webkit-tap-highlight-color: transparent; }
.is-touch .btn { transition: color 0.45s var(--ease), border-color 0.4s, box-shadow 0.4s, transform 0.25s var(--ease); }
.is-touch .btn:active { transform: scale(0.97); }
.is-touch .path, .is-touch .sibling { transition: transform 0.25s var(--ease), background 0.4s, border-color 0.4s; }
.is-touch .path:active, .is-touch .sibling:active { transform: scale(0.985); }
.is-touch .more:active .circ { transform: scale(0.9); }

/* ---------- The reading line: how far down the page, along the screen's top edge (fa.js) ---------- */
.readbar { position: fixed; top: 0; left: 0; right: 0; z-index: 620; height: 2px; pointer-events: none; opacity: 0; transition: opacity 0.4s;
  background: linear-gradient(270deg, #7da2ea, #dfe8fb); transform: scaleX(var(--read, 0)); transform-origin: 100% 50%; }
[dir="ltr"] .readbar { background: linear-gradient(90deg, #7da2ea, #dfe8fb); transform-origin: 0 50%; }
.readbar.is-on { opacity: 1; }
.menu-open .readbar { opacity: 0; }

/* ---------- The swipe cue under Karun's own screen (a touch screen, before the tour), and the button that opens
   the folded paragraph: both only on a phone held upright (below) ---------- */
.cycle__cue, .lede-more { display: none; }

@media (max-width: 900px) {
  /* ---------- The header: gone while the page is read downwards, back on the way up (fa.js) ---------- */
  .site-header.is-away { transform: translateY(-104%); }

  /* ---------- What is pressed is a thumb wide ---------- */
  .crumbs { flex-wrap: wrap; align-items: center; gap: 0 8px; margin-bottom: 12px; font-size: 13.5px; }
  .crumbs a, .crumbs > span { display: inline-flex; align-items: center; min-height: 40px; }
  .crumbs a { padding-inline: 4px; margin-inline: -4px; }
  .footer li { margin-bottom: 0; }
  .footer li a { display: inline-block; padding: 7px 0; }
  .footer li:not(:has(a)) { padding: 7px 0; }
  .hubfoot li a { padding: 8px 0; }
  .plist__head { min-height: 44px; }
  .mlink { min-height: 46px; }
  .msub__a { min-height: 40px; }
  .request__direct a { display: inline-flex; align-items: center; min-height: 44px; }
  .cnav__btn { width: 44px; height: 44px; }
  .seg { width: 26px; height: 44px; }
  .seg.is-on { width: 40px; }
  /* (a business's card on the square is as wide as its longest line, so «محصولات و خدمات» stays on one) */
  .cnode { width: auto; min-width: 31%; max-width: 47%; }
  .cnode small { font-size: 11.5px; white-space: nowrap; }
  html[lang="en"] .compass .cnode small { font-size: 10px; white-space: normal; }

  /* ---------- First screens begin right under the header ---------- */
  .section--first { padding-top: calc(var(--header-h) + 16px); }
  /* (a first screen's last line clears the dock, fa-thumb.css: 60 px at the foot of the screen) */
  .phero { padding: calc(var(--header-h) + 18px) var(--gutter) 82px; }
  .contact { padding: calc(var(--header-h) + 18px) var(--gutter) 48px; }
}

/* ==========================================================================
   A phone held upright
   ========================================================================== */
@media (max-width: 900px) and (orientation: portrait) {
  /* ---------- Home: Karun's own screen ----------
     The scene keeps the room above the text (fa.js folds the paragraph to the lines that fit, .is-clamped;
     «ادامه» opens it over the scene, .is-read). The text stands on the cue at the screen's foot. */
  .panel { bottom: 66px; } /* (the cue and the dock's round button, fa-thumb.css, share the strip under it) */
  .panel--hero .rv > .actions { flex-wrap: wrap; gap: 8px; margin-top: 16px; }
  .panel--hero .rv > .actions .btn { flex: 1 1 auto; min-width: 0; height: 48px; padding: 0 16px; font-size: 14.5px; justify-content: center; gap: 8px; }
  .panel--hero .rv > .actions .btn svg { display: block; width: 16px; height: 16px; }
  .cycle.is-clamped .panel--hero .lede { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: var(--lines, 4); line-clamp: var(--lines, 4); overflow: hidden; }
  .lede-more { width: fit-content; margin-inline-end: auto; align-items: center; gap: 6px; min-height: 40px; margin-top: 2px; padding: 0 2px; font-size: 13.5px; font-weight: 500; color: #a9c1f5; }
  .lede-more::after { content: ""; width: 7px; height: 7px; margin-top: -3px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); transition: transform 0.4s var(--ease), margin 0.4s var(--ease); }
  .cycle.is-clamped .lede-more, .cycle.is-read .lede-more { display: flex; }
  .cycle.is-read .lede-more::after { transform: rotate(225deg); margin-top: 4px; }
  .lede-more .lede-more__less, .cycle.is-read .lede-more .lede-more__more { display: none; }
  .cycle.is-read .lede-more .lede-more__less { display: inline; }
  /* open: the scene steps back behind the text */
  .cycle__shade::after { content: ""; position: absolute; inset: 0; opacity: 0; transition: opacity 0.5s var(--ease);
    background: linear-gradient(180deg, rgba(14, 49, 121, 0.7) 0%, rgba(14, 49, 121, 0.95) 30%, var(--navy) 100%); }
  .cycle.is-read .cycle__shade::after { opacity: 1; }
  .cycle.is-read .ring-labels { opacity: 0; pointer-events: none; transition: opacity 0.3s; }
  .cycle.is-read .cycle__cue { opacity: 0; }

  /* the cue: two small arrow heads rising, and two words */
  .is-touch .cycle__cue { position: absolute; left: 50%; bottom: 12px; margin: 0; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 10px;
    font-size: 12.5px; font-weight: 500; line-height: 1.6; color: var(--mist); white-space: nowrap; opacity: 0.72; pointer-events: none; transition: opacity 0.4s; }
  .cycle__cue i { position: relative; width: 12px; height: 16px; }
  .cycle__cue i::before, .cycle__cue i::after { content: ""; position: absolute; left: 2px; width: 7px; height: 7px; border: solid currentColor; border-width: 1.5px 0 0 1.5px; transform: rotate(45deg); animation: cue-rise 1.8s ease-in-out infinite; }
  .cycle__cue i::before { top: 2px; }
  .cycle__cue i::after { top: 9px; animation-delay: 0.18s; }
  .cycle.is-tour .cycle__cue, .cycle.is-warping .cycle__cue, .cycle:not(.is-journey) .cycle__cue { opacity: 0; }

  /* ---------- Home: the tour ----------
     The text sits on the line; under the line the controls, then the hint. Every part a size that leaves the
     ring its room on a phone's real screen. */
  .cycle { --tl-b: 100px; }
  .cycle.is-tour .panel--line { bottom: calc(var(--tl-b) + 16px); }
  .cycle.is-tour .cycle__hud .cnav, [dir="ltr"] .cycle.is-tour .cycle__hud .cnav { bottom: calc(var(--tl-b) - 62px); }
  .cycle.is-tour .cnav .cnav__btn { width: 44px; height: 44px; }
  .cycle.is-tour .seg, .cycle.is-tour .seg.is-on { width: 26px; }
  .cycle__hint, [dir="ltr"] .cycle__hint { bottom: 8px; font-size: 12.5px; }
  /* (the dock's round button, fa-thumb.css, has the corner of this row: the controls and the hint stand in the
     middle of what it leaves) */
  .cycle.is-tour .cycle__hud .cnav, .cycle__hint { left: calc(50% - 29px); }
  [dir="ltr"] .cycle.is-tour .cycle__hud .cnav, [dir="ltr"] .cycle__hint { left: calc(50% + 29px); }

  /* ---------- A business's first screen: its shape above, its words below, the whole on one screen where it fits
     (fa-cinema.js sizes the shape to the room above the words) ---------- */
  .lhero { align-items: end; padding: calc(var(--header-h) + 6px) var(--gutter) 70px; }
  .lhero__inner { margin-top: clamp(160px, 27vh, 300px); margin-top: clamp(160px, 27svh, 300px); }
  .lhero .crumbs { margin-bottom: 6px; }
  .lhero .actions { gap: 8px; margin-top: 18px; margin-inline-start: 0; }
  .lhero .actions .btn { flex: 1 1 auto; height: 48px; padding: 0 18px; font-size: 14.5px; justify-content: center; }
}

/* the same, in a phone's own sizes (a tablet held upright keeps the larger type it has) */
@media (max-width: 560px) and (orientation: portrait) {
  .panel .lede { font-size: 14.5px; line-height: 1.85; }
  .pill--lead { font-size: clamp(12.5px, 3.5vw, 15px); padding: 7px 15px; gap: 10px; }
  .panel--line .name { font-size: clamp(46px, 15vw, 60px); line-height: 1.12; }
  .panel--line .sub { font-size: 16.5px; line-height: 1.6; }
  .panel--line .insight { margin-top: 10px; gap: 10px; font-size: 15px; line-height: 1.75; }
  .panel--line .insight::before { width: 9px; height: 9px; }
  .panel--line .more { margin-top: 12px; font-size: 15.5px; }
  .panel--line .more .circ { width: 38px; height: 38px; }
  .panel--line .rv > .more { margin-inline-start: 19px; }
  .lhero .key { font-size: 13.5px; padding: 3px 14px; }
  .lhero h1 { font-size: clamp(52px, 17vw, 76px); margin-top: 6px; }
  .lhero .sub { font-size: 16.5px; line-height: 1.65; }
  .lhero__say { margin-top: 12px; padding-inline-start: 14px; font-size: 15.5px; line-height: 1.75; }
}

/* a short screen (a phone's browser with its bars showing): every part of the home scene a size smaller, the
   headline on one line */
@media (max-width: 560px) and (orientation: portrait) and (max-height: 700px) {
  .panel--hero h1 { font-size: clamp(27px, 8.4vw, 34px); margin: 8px 0 6px; }
  .panel--hero h1 .rv { display: inline-block; vertical-align: top; }
  .panel--hero h1 .rv + .rv { margin-inline-start: 0.26em; }
  .pill--lead { font-size: clamp(12px, 3.4vw, 13.5px); padding: 5px 13px; gap: 9px; }
  .panel--hero .rv > .actions { margin-top: 12px; }
  .panel--hero .rv > .actions .btn { height: 46px; font-size: 14px; padding: 0 14px; }
  .cycle { --tl-b: 84px; }
  .cycle.is-tour .panel--line { bottom: calc(var(--tl-b) + 12px); }
  .cycle.is-tour .cycle__hud .cnav, [dir="ltr"] .cycle.is-tour .cycle__hud .cnav { bottom: calc(var(--tl-b) - 60px); }
  .cycle__hint, [dir="ltr"] .cycle__hint { bottom: 3px; font-size: 11.5px; line-height: 1.5; }
  .panel--line > .rv:first-child { display: none; }
  .panel--line .name { font-size: clamp(40px, 13vw, 50px); margin-top: 0; }
  .panel--line .sub { font-size: 15px; }
  .panel--line .insight { margin-top: 8px; font-size: 14px; line-height: 1.7; }
  .panel--line .more { margin-top: 8px; font-size: 14.5px; }
  .panel--line .more .circ { width: 34px; height: 34px; }
  .lhero h1 { font-size: clamp(46px, 15vw, 60px); }
  .lhero__say { font-size: 14.5px; }
}

/* the shortest screens (a small phone with its browser's bars showing): the tour keeps the business's name, its
   field and the way to its page; the sentence gives its room to the ring */
@media (max-width: 560px) and (orientation: portrait) and (max-height: 540px) {
  .panel--line > .rv:nth-child(4) { display: none; }
  .panel--line .name { font-size: clamp(36px, 12vw, 44px); }
}

/* ==========================================================================
   Phones (to 560 px)
   ========================================================================== */
@media (max-width: 560px) {
  :root { --header-h: 64px; }
  .brand img { height: 30px; }
  .header-tools { gap: 8px; }
  .lang { display: inline-flex; align-items: center; justify-content: center; min-width: 46px; min-height: 46px; padding: 0 10px; }
  .burger, .sound-toggle { width: 46px; height: 46px; }
  .burger span { right: 13px; left: 13px; }
  .burger span:nth-child(1) { top: 16px; }
  .burger span:nth-child(2) { top: 22px; inset-inline-end: 19px; }
  .burger span:nth-child(3) { top: 28px; }

  /* ---------- Buttons that share a row take a line each when their words do not fit side by side ---------- */
  .actions { gap: 8px; }
  .actions .btn { flex: 1 1 auto; justify-content: center; height: 50px; padding: 0 18px; font-size: 15px; }
  /* a button whose words are long (the way to the next page) may take two lines, its arrow beside them */
  .hubfoot__end .btn, .footer .footer__next.btn { white-space: normal; text-wrap: balance; height: auto; min-height: 48px; padding: 9px 18px; line-height: 1.5; text-align: center; }

  /* ---------- Section rhythm: less air, more words ---------- */
  .section { --sp: 56px; }
  .head { gap: 12px; margin-bottom: 28px; }
  .head h2 { font-size: clamp(25px, 7.4vw, 32px); }

  /* ---------- The two paths ---------- */
  .path { padding: 22px 20px 22px; }
  .path__icon { width: 52px; height: 52px; border-radius: 16px; }
  .path__icon svg { width: 26px; height: 26px; }

  /* ---------- The footer: short. Pages and businesses side by side, the ways to reach Karun under them ---------- */
  .footer__cta { gap: 20px; padding: 46px var(--gutter) 36px; }
  .footer__cta .btn { width: 100%; justify-content: center; }
  .footer__cols { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px 14px; padding: 34px var(--gutter) 22px; }
  .footer__brand, .footer__cols > div:last-child { grid-column: 1 / -1; }
  .footer__brand { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 4px 16px; }
  .footer__brand img { width: 132px; margin: 0; }
  .footer__brand p { font-size: 13.5px; line-height: 1.7; }
  .footer h4 { margin-bottom: 2px; font-size: 13px; }
  .footer li { font-size: 15px; }
  .footer__bottom { gap: 6px 14px; padding: 16px var(--gutter) 20px; font-size: 13px; }
  .footer .footer__next.btn { width: 100%; justify-content: center; margin-bottom: 6px; }
  .hubfoot { gap: 22px; padding: 36px var(--gutter) 24px; }
  .hubfoot .footer__cols { gap: 14px; }
  .hubfoot .footer__brand { display: grid; grid-template-columns: auto minmax(0, 1fr); }
  .hubfoot .footer__brand img { width: 132px; margin: 0; }
  .hubfoot .footer__brand p { font-size: 13.5px; }

  /* ---------- Contact: each way to reach Karun is one tile; its value is the thing to press ---------- */
  .contact { align-items: start; }
  .contact__inner { gap: 22px; }
  .contact h1 { font-size: 19px; line-height: 1.85; }
  .crow { grid-template-columns: 46px minmax(0, 1fr) auto; grid-template-areas: "ico label copy" "ico value value"; gap: 0 14px; align-items: center; padding: 12px 0; }
  .crow > div { display: contents; }
  .crow .ico { grid-area: ico; width: 46px; height: 46px; border-radius: 15px; }
  .crow .ico svg { width: 21px; height: 21px; }
  .crow small { grid-area: label; align-self: center; }
  .crow a.v, .crow span.v { grid-area: value; font-size: 17px; line-height: 1.7; min-width: 0; overflow-wrap: anywhere; }
  .crow a.v { display: inline-flex; align-items: center; min-height: 40px; justify-self: start; }
  .crow .copy { grid-area: copy; grid-column: auto; justify-self: end; min-height: 36px; padding: 6px 14px; font-size: 12.5px; }

  /* ---------- Products and services: the square on the first screen ---------- */
  .hubsec .crumbs { margin-bottom: 2px; }
  .hubsec .head { gap: 8px; }
  .hubsec .head h1 { font-size: clamp(22px, 6.3vw, 27px); line-height: 1.5; }
  .hubsec .head p { font-size: 14.5px; line-height: 1.85; }
  /* (a short screen: the heading alone, as on a short wide one, so the square is on the first screen) */
  @media (max-height: 700px) { .hubsec .head p { display: none; } }
  .compass { gap: 18px; }

  /* ---------- About: every principle can be read; the one in the middle of the screen is lit ---------- */
  .plist li { grid-template-columns: 46px minmax(0, 1fr); gap: 14px; padding: 20px 0; opacity: 0.6; }
  .plist li.is-focus { opacity: 1; }
  .plist .ico { width: 46px; height: 46px; border-radius: 15px; }
  .plist .ico svg { width: 23px; height: 23px; }
  .plist h3 { font-size: 19px; }
  .plist p { margin-top: 2px; font-size: 15.5px; line-height: 1.95; }
  .principles__aside h2 { font-size: 28px; }

  /* ---------- A business's other three: a row to swipe ---------- */
  .siblings { display: flex; gap: 12px; margin-inline: calc(-1 * var(--gutter)); padding: 4px var(--gutter) 10px; overflow-x: auto; overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory; scroll-padding-inline: var(--gutter); scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .siblings::-webkit-scrollbar { display: none; }
  .sibling { flex: 0 0 min(78%, 300px); scroll-snap-align: start; padding: 22px 20px; }
  .sibling b { font-size: 32px; }
  .sibling span.s { text-align: start; }
}

/* the narrowest phones */
/* the two buttons of Karun's own screen stand side by side on a phone: no arrow, so both sets of words fit (on the
   very narrowest they take a line each by themselves) */
@media (max-width: 440px) {
  .panel--hero .rv > .actions .btn { padding: 0 10px; font-size: 13.5px; }
  .panel--hero .rv > .actions .btn svg { display: none; }
}
@media (max-width: 350px) {
  .panel--hero .rv > .actions .btn { padding: 0 8px; font-size: 12.5px; }
}
/* (the same on a business's first screen, held upright: both of its buttons on one line, above the dock) */
@media (max-width: 440px) and (orientation: portrait) {
  .lhero .actions .btn { padding: 0 10px; font-size: 13.5px; }
  .lhero .actions .btn svg { display: none; }
}
@media (max-width: 350px) and (orientation: portrait) {
  .lhero .actions .btn { padding: 0 8px; font-size: 12.5px; }
}

/* a phone held sideways: the ring stands beside the text, and only the business in focus is named on it (the
   other names would lie across the words; the controls under the text reach them) */
@media (max-width: 900px) and (orientation: landscape) and (max-height: 540px) {
  .cycle.is-tour .ring-label:not(.is-active) { opacity: 0; pointer-events: none; }
  /* (Karun's own screen: its two buttons leave the corner under them to the dock's round button, fa-thumb.css) */
  .panel--hero .rv > .actions { margin-inline-start: 48px; }
}

@media (prefers-reduced-motion: reduce) {
  .cycle__cue i::before, .cycle__cue i::after { animation: none; }
  .site-header.is-away { transform: none; }
}
@keyframes cue-rise { 0%, 100% { opacity: 0.25; transform: translateY(3px) rotate(45deg); } 50% { opacity: 1; transform: translateY(-2px) rotate(45deg); } }
