/* =============================================================================
   Contact page "Drop us a postcard" (2026-11-16). The form is a postcard
   lying on the night chart of the gulf (the 404 page's sea and ferry sail
   along the bottom): an airmail edge, a stamp, ruled lines to write on.
   Sending it presses the postmark, the card flies off and a paper plane
   follows the dotted route to a pin. Markup: templates/contact.html;
   behaviour: js/contact.js. The card is paper in both themes, so it carries
   its own ink colours.
   ========================================================================== */

:root {
  --pc-paper: #F7F0E0;
  --pc-paper-2: #EFE5CF;
  --pc-ink: #10243A;
  --pc-ink-2: #4B5C72;
  --pc-ink-3: #6F7E92;
  --pc-rule: rgba(16, 36, 58, .17);
  --pc-focus: #0A7E8C;
  --pc-bad: #C2351F;
  --pc-shadow: 0 40px 90px -30px rgba(0, 0, 0, .75), 0 12px 30px -18px rgba(0, 0, 0, .6);
  --ct-grid: rgba(255, 255, 255, .05);
  --ct-way: rgba(249, 176, 78, .5);
}
:root[data-theme="light"] {
  --pc-paper: #FFFFFF;
  --pc-paper-2: #FBF5E8;
  --pc-shadow: 0 40px 80px -34px rgba(20, 40, 70, .45), 0 10px 26px -16px rgba(20, 40, 70, .28);
  --ct-grid: rgba(10, 30, 55, .055);
  --ct-way: rgba(201, 112, 26, .55);
}

[hidden] { display: none !important; }

/* ── Scene ────────────────────────────────────────────────────────────── */
.ct-hero {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: 100vh; min-height: 100svh;
  padding-block: calc(var(--nav-h) + 56px) 210px;
  display: grid; align-items: center;
  background:
    radial-gradient(55% 45% at 78% 30%, var(--glow-a), transparent 70%),
    radial-gradient(45% 40% at 8% 88%, var(--glow-b), transparent 70%),
    var(--bg);
}
.ct-chart {
  position: absolute; inset: 0; z-index: -2; pointer-events: none;
  background-image:
    linear-gradient(var(--ct-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--ct-grid) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(120% 90% at 50% 40%, #000 35%, transparent 95%);
  mask-image: radial-gradient(120% 90% at 50% 40%, #000 35%, transparent 95%);
  animation: ct-drift 18s linear infinite;
}
@keyframes ct-drift { to { background-position: 64px 0, 64px 0; } }
.ct-route { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; pointer-events: none; }
[dir="rtl"] .ct-route { transform: scaleX(-1); }
.ct-way { fill: none; stroke: var(--ct-way); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 3 12; }
.ct-flyer path { fill: var(--amber); filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .35)); }
.ct-pins use { opacity: .85; }
.ct-p0 { color: var(--teal); } .ct-p1 { color: var(--orange); } .ct-p2 { color: var(--leaf); }
.ct-late { animation-delay: -1.3s; } .ct-later { animation-delay: -2.6s; }
.ct-hero .nf-sea { position: absolute; z-index: -1; }

.ct-grid {
  position: relative;
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 5vw, 72px);
  align-items: center;
}

/* ── Words ────────────────────────────────────────────────────────────── */
.ct-kicker {
  margin-bottom: 14px; color: var(--accent-ink);
  font-family: var(--font-head); font-weight: 700; font-size: .82rem; letter-spacing: .28em; text-transform: uppercase;
}
:lang(fa) .ct-kicker, :lang(ar) .ct-kicker { letter-spacing: 0; font-size: .98rem; }
.ct-h1 { font-size: clamp(2.3rem, 1.3rem + 3.6vw, 4rem); line-height: 1.04; text-wrap: balance; }
:lang(fa) .ct-h1, :lang(ar) .ct-h1 { line-height: 1.35; }
.ct-lead { margin-top: 20px; max-width: 30em; color: var(--ink-2); font-size: 1.1rem; text-wrap: pretty; }

.ct-mail {
  display: inline-flex; align-items: center; gap: 14px; margin-top: 28px; padding: 10px 20px 10px 10px;
  padding-inline: 10px 22px;
  border-radius: 999px; background: var(--surface); border: 1px solid var(--line-2);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  transition: transform .35s var(--ease-spring), border-color .25s, background-color .25s;
}
.ct-mail:hover { transform: translateY(-2px); border-color: var(--accent-ink); background: var(--surface-2); }
.ct-mail-ic {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; flex: none;
  background: var(--grad-accent); color: var(--on-accent);
}
.ct-mail-ic svg { width: 22px; height: 22px; }
.ct-mail small { display: block; color: var(--ink-3); font-size: .78rem; line-height: 1.3; }
.ct-mail b { display: block; font-family: var(--font-head); font-weight: 600; font-size: 1.02rem; line-height: 1.35; }

.ct-facts { display: grid; gap: 16px; margin-top: 36px; max-width: 30em; }
.ct-facts li { display: flex; gap: 14px; align-items: flex-start; }
.ct-facts svg { width: 22px; height: 22px; flex: none; margin-top: 3px; color: var(--accent-ink); }
.ct-facts b { display: block; font-family: var(--font-head); font-weight: 600; font-size: .98rem; }
.ct-facts span { display: block; color: var(--ink-2); font-size: .93rem; line-height: 1.5; }

/* ── The postcard ─────────────────────────────────────────────────────── */
.ct-stage { position: relative; perspective: 1400px; }
.pc {
  position: relative; padding: 30px 32px 24px;
  border-radius: 14px; color: var(--pc-ink);
  background:
    radial-gradient(120% 80% at 0% 0%, rgba(255, 255, 255, .55), transparent 60%),
    linear-gradient(160deg, var(--pc-paper), var(--pc-paper-2));
  box-shadow: var(--pc-shadow);
  transform: rotate(-1.6deg);
  transition: transform .6s var(--ease-spring), opacity .5s var(--ease);
  animation: pc-arrive .9s var(--ease) both;
}
[dir="rtl"] .pc { transform: rotate(1.6deg); }
.pc:focus-within, .pc.is-busy, .pc-done, .pc-off { transform: none; }
@keyframes pc-arrive { from { opacity: 0; transform: translateY(46px) rotate(-7deg) scale(.96); } }
/* The airmail edge. */
.pc::before {
  content: ""; position: absolute; inset: 0; padding: 9px; border-radius: inherit; pointer-events: none;
  background: repeating-linear-gradient(-45deg, #12A9B8 0 14px, transparent 14px 28px, #EF5A3A 28px 42px, transparent 42px 56px);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  opacity: .9;
}
.pc ::selection { background: rgba(18, 169, 184, .3); color: var(--pc-ink); }
.pc :focus-visible { outline-color: var(--pc-focus); }

.pc-head { position: relative; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; min-height: 92px; padding-top: 4px; }
.pc-label {
  font-family: var(--font-head); font-weight: 700; font-size: .8rem; letter-spacing: .34em; text-transform: uppercase;
  color: var(--pc-ink-3); padding-top: 10px;
}
:lang(fa) .pc-label, :lang(ar) .pc-label { letter-spacing: 0; font-size: 1rem; }

/* The stamp: perforated, a little crooked. */
.pc-stamp {
  flex: none; width: 84px; height: 100px; padding: 2px; transform: rotate(3deg);
  /* The perforation: dots of the card's paper bitten out of the edge. */
  background: #FFFDF6; border: 5px dotted var(--pc-paper);
  filter: drop-shadow(0 2px 3px rgba(16, 36, 58, .22));
}
[dir="rtl"] .pc-stamp { transform: rotate(-3deg); }
.pc-stamp-in {
  position: relative; height: 100%; display: grid; place-items: center; overflow: hidden;
  background: radial-gradient(90% 70% at 50% 35%, #12456B, #07203A 75%);
}
.pc-stamp-in img { width: 34px; height: 42px; margin-top: -8px; }
.pc-stamp-val { position: absolute; inset-block-start: 3px; inset-inline-end: 5px; color: #F9B04E; font: 700 .62rem "Space Grotesk", system-ui, sans-serif; }
.pc-stamp-city { position: absolute; inset-block-end: 3px; inset-inline: 0; text-align: center; color: #E8F4F8; font: 700 .56rem "Space Grotesk", system-ui, sans-serif; letter-spacing: .18em; }

/* The postmark lands on the stamp when the card is sent. */
.pc-postmark {
  position: absolute; inset-block-start: -4px; inset-inline-end: 40px; width: 216px; height: 104px; overflow: visible;
  fill: none; stroke: var(--pc-ink); stroke-width: 1.6; opacity: 0; pointer-events: none; z-index: 1;
  transform: rotate(-9deg) scale(1.7); transform-origin: 26% 50%;
}
.pc-postmark text { fill: var(--pc-ink); stroke: none; font-family: "Space Grotesk", "Inter", system-ui, sans-serif; font-weight: 700; }
.pc-pm-ring { font-size: 8.4px; letter-spacing: .13em; }
.pc-pm-date { font-size: 9.5px; }
.pc-pm-tr { font-size: 8px; letter-spacing: .2em; }
.pc.is-stamped .pc-postmark { animation: pc-stamp .42s cubic-bezier(.3, 1.5, .5, 1) forwards; }
@keyframes pc-stamp {
  0% { opacity: 0; transform: rotate(-9deg) scale(1.7); }
  60% { opacity: .9; transform: rotate(-9deg) scale(.94); }
  100% { opacity: .78; transform: rotate(-9deg) scale(1); }
}
[dir="rtl"] .pc.is-stamped .pc-postmark { animation-name: pc-stamp-rtl; }
@keyframes pc-stamp-rtl {
  0% { opacity: 0; transform: rotate(9deg) scale(1.7); }
  60% { opacity: .9; transform: rotate(9deg) scale(.94); }
  100% { opacity: .78; transform: rotate(9deg) scale(1); }
}
[dir="rtl"] .pc-postmark { transform: rotate(9deg) scale(1.7); transform-origin: 74% 50%; }
.pc.is-stamped { animation: pc-thud .42s var(--ease); }
@keyframes pc-thud { 45% { transform: scale(.985) rotate(0deg); } }
.pc.is-sent { animation: pc-fly .75s cubic-bezier(.5, 0, .9, .4) forwards; }
@keyframes pc-fly { to { opacity: 0; transform: translate3d(60%, -70%, 0) rotate(16deg) scale(.5); } }
[dir="rtl"] .pc.is-sent { animation-name: pc-fly-rtl; }
@keyframes pc-fly-rtl { to { opacity: 0; transform: translate3d(-60%, -70%, 0) rotate(-16deg) scale(.5); } }

.pc-body { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); margin-top: 6px; }
.pc-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.pc-msg { padding-inline-end: 26px; border-inline-end: 1.5px solid var(--pc-rule); }
.pc-addr { padding-inline-start: 26px; }
.pc-cap {
  font-family: var(--font-head); font-weight: 700; font-size: .7rem; letter-spacing: .26em; text-transform: uppercase; color: var(--pc-ink-3);
}
:lang(fa) .pc-cap, :lang(ar) .pc-cap { letter-spacing: 0; font-size: .86rem; }
.pc-cap + .fld { margin-top: -8px; }

/* Fields: lines to write on, not boxes. */
.fld { display: flex; flex-direction: column; min-width: 0; }
.fld-grow { flex: 1; }
.fld label { font-size: .8rem; font-weight: 600; color: var(--pc-ink-2); }
.fld input, .fld select, .fld textarea {
  width: 100%; min-width: 0; margin: 0; padding: 7px 2px 8px; border: 0; border-radius: 0;
  border-bottom: 1.5px solid var(--pc-rule); background: transparent; color: var(--pc-ink);
  font: inherit; font-size: 1.02rem; line-height: 1.5; outline: none;
  transition: border-color .25s, box-shadow .25s;
  -webkit-appearance: none; appearance: none;
}
.fld input::placeholder, .fld textarea::placeholder { color: var(--pc-ink-3); opacity: .75; }
.fld input:focus, .fld select:focus, .fld textarea:focus { border-bottom-color: var(--pc-focus); box-shadow: 0 1.5px 0 var(--pc-focus); }
.fld input:-webkit-autofill { -webkit-text-fill-color: var(--pc-ink); box-shadow: 0 0 0 40px var(--pc-paper) inset; }
.fld select {
  cursor: pointer; padding-inline-end: 28px; text-overflow: ellipsis;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 6l4.5 4.5L12.5 6' fill='none' stroke='%234B5C72' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-size: 16px; background-position: right 4px center;
}
[dir="rtl"] .fld select { background-position: left 4px center; }
.fld select:invalid { color: var(--pc-ink-3); }
.fld select option { color: #10243A; background: #fff; }
.fld textarea {
  flex: 1; min-height: 12.6em; resize: vertical; padding: 0 2px; border-bottom: 0;
  line-height: 2.1em;
  background-image: linear-gradient(transparent calc(2.1em - 1.5px), var(--pc-rule) calc(2.1em - 1.5px));
  background-size: 100% 2.1em; background-attachment: local;
}
.fld textarea:focus { box-shadow: none; background-image: linear-gradient(transparent calc(2.1em - 1.5px), rgba(10, 126, 140, .45) calc(2.1em - 1.5px)); }
.fld-foot { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-top: 6px; min-height: 1.3em; }
.fld-count { margin-inline-start: auto; color: var(--pc-ink-3); font-size: .74rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fld-err { margin-top: 5px; color: var(--pc-bad); font-size: .8rem; font-weight: 600; line-height: 1.35; }
.fld-foot .fld-err { margin-top: 0; }
.fld.is-bad input, .fld.is-bad select { border-bottom-color: var(--pc-bad); }
.fld.is-bad label { color: var(--pc-bad); }

.pc-to { display: grid; gap: 0; font-style: normal; }
.pc-to span { padding: 5px 2px 6px; border-bottom: 1.5px solid var(--pc-rule); font-size: .98rem; color: var(--pc-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
[dir="rtl"] .pc-to span[dir="ltr"] { text-align: right; }
.pc-hp { position: absolute; inset-inline-start: -9999px; width: 1px; height: 1px; overflow: hidden; }
.pc-send { margin-top: auto; width: 100%; }
.pc-addr .pc-send { margin-top: 10px; }
.pc-send[disabled] { cursor: progress; filter: saturate(.6); opacity: .8; }
.pc-send svg { width: 20px; height: 20px; }
.pc.is-busy .pc-send svg { animation: pc-wiggle .9s ease-in-out infinite; }
@keyframes pc-wiggle { 50% { transform: translate(4px, -4px); } }

.pc-status {
  margin-top: 18px; padding: 11px 14px; border-radius: 10px;
  background: rgba(194, 53, 31, .1); border: 1px solid rgba(194, 53, 31, .35); color: #8E2414; font-size: .92rem; font-weight: 600;
}
.pc-legal { margin-top: 16px; color: var(--pc-ink-3); font-size: .76rem; line-height: 1.5; }
.pc-legal a { color: var(--pc-ink-2); text-decoration: underline; text-underline-offset: 2px; }
.grecaptcha-badge { visibility: hidden; }

/* ── Sent ─────────────────────────────────────────────────────────────── */
.pc-done, .pc-off { text-align: center; padding: 34px 32px 38px; animation: pc-settle .7s var(--ease) both; }
@keyframes pc-settle { from { opacity: 0; transform: translateY(24px) scale(.97); } }
.pc-done:focus { outline: none; }
.pc-flight { width: min(100%, 520px); height: auto; margin-inline: auto; overflow: visible; }
[dir="rtl"] .pc-flight { transform: scaleX(-1); }
.pc-way { fill: none; stroke: #C9701A; stroke-width: 3; stroke-linecap: round; stroke-dasharray: 3 11; opacity: .75; }
.pc-plane path { fill: #EF5A3A; }
.pc-plane { transition: opacity .35s; }
.pc-done.is-landed .pc-plane { opacity: 0; }
.pc-dest { color: #0A8E9C; }
.pc-dest .nf-hole { fill: var(--pc-paper); }
.pc-done.is-landed .pc-dest { animation: pc-pop .5s var(--ease-spring); transform-box: fill-box; transform-origin: 50% 100%; }
@keyframes pc-pop { 40% { transform: scale(1.35); } }
.pc-tick {
  display: grid; place-items: center; width: 54px; height: 54px; margin: 6px auto 16px; border-radius: 50%;
  background: linear-gradient(135deg, #12A9B8, #2BC4A4); color: #fff; box-shadow: 0 10px 24px -10px rgba(18, 169, 184, .8);
  transform: scale(0); transition: transform .5s var(--ease-spring);
}
.pc-done.is-landed .pc-tick { transform: none; }
.pc-tick svg { width: 26px; height: 26px; }
.pc-done h2, .pc-off h2 { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem); line-height: 1.2; color: var(--pc-ink); text-wrap: balance; }
.pc-done p, .pc-off p { margin: 12px auto 0; max-width: 30em; color: var(--pc-ink-2); }
.pc-done-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 26px; }
.pc .btn-ghost { color: var(--pc-ink); background: transparent; border-color: rgba(16, 36, 58, .28); backdrop-filter: none; -webkit-backdrop-filter: none; }
.pc .btn-ghost:hover { background: rgba(16, 36, 58, .06); border-color: var(--pc-ink-2); }
.pc-off .pc-head { margin-bottom: 8px; text-align: start; }
.pc-off .btn { margin-top: 24px; }

/* ── Narrower ─────────────────────────────────────────────────────────── */
@media (max-width: 1060px) {
  .ct-hero { padding-block: calc(var(--nav-h) + 36px) 190px; }
  .ct-grid { grid-template-columns: minmax(0, 1fr); }
  .ct-intro { text-align: center; }
  .ct-lead, .ct-facts { margin-inline: auto; }
  .ct-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: none; text-align: start; }
  .ct-stage { width: min(100%, 780px); margin-inline: auto; }
}
@media (max-width: 720px) {
  .ct-facts { grid-template-columns: minmax(0, 1fr); max-width: 26em; }
}
@media (max-width: 640px) {
  .ct-hero { padding-block: calc(var(--nav-h) + 24px) 150px; }
  .pc, [dir="rtl"] .pc { transform: none; padding: 24px 20px 20px; }
  .pc::before { padding: 7px; }
  .pc-head { min-height: 84px; }
  .pc-stamp { width: 72px; height: 86px; border-width: 4px; }
  .pc-stamp-in img { width: 28px; height: 35px; }
  .pc-postmark { width: 180px; height: 87px; inset-inline-end: 30px; }
  .pc-body { grid-template-columns: minmax(0, 1fr); }
  .pc-msg { padding-inline-end: 0; border-inline-end: 0; padding-bottom: 20px; border-bottom: 1.5px dashed var(--pc-rule); }
  .pc-addr { padding-inline-start: 0; padding-top: 20px; }
  .fld textarea { min-height: 10.5em; }
  .fld input, .fld select, .fld textarea { font-size: 1rem; }
  .pc-done-actions .btn { width: 100%; }
  .ct-mail { max-width: 100%; }
  .ct-mail b { font-size: .95rem; overflow-wrap: anywhere; }
  .ct-hero .nf-sea { height: 110px; }
}

@media (prefers-reduced-motion: reduce) {
  .ct *, .ct *::before { animation: none !important; transition: none !important; }
  .ct-flyer { display: none; }
  .pc.is-stamped .pc-postmark { opacity: .78; transform: rotate(-9deg); }
  .pc-done .pc-tick { transform: none; }
}
