@font-face { font-family: 'Thmanyah'; src: url('fonts/thmanyah.otf') format('opentype'); font-display: swap; }
@font-face { font-family: 'Bahij'; src: url('fonts/bahij-bold.ttf') format('truetype'); font-weight: 700; font-display: swap; }

:root {
  --lemon: #FFE15A;
  --lemon-soft: #FFF5C9;
  --ink: #1C2142;
  --cobalt: #3D5AFE;
  --pink: #FF8CB0;
  --pink-text: #C8326C;
  --paper: #FFFFFF;
  --line: 2.5px solid var(--ink);
  --radius: 18px;
  --display: 'Thmanyah', 'Bahij', serif;
  --ui: 'Bahij', 'IBM Plex Sans Arabic', system-ui, sans-serif;
  --body: 'IBM Plex Sans Arabic', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--lemon);
  background-image: radial-gradient(rgba(28, 33, 66, .14) 1.2px, transparent 1.2px);
  background-size: 22px 22px;
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.75;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--cobalt); outline-offset: 3px; }

.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }

/* ---------- header ---------- */
.top {
  position: sticky; top: 0; z-index: 20;
  background: var(--lemon);
  border-bottom: var(--line);
}
.top .wrap { display: flex; align-items: center; justify-content: space-between; height: 72px; gap: 16px; }
.logo img { height: 44px; width: auto; }
.nav { display: flex; gap: 22px; font-family: var(--ui); font-weight: 700; }
.nav a { text-decoration: none; }
.nav a:hover { color: var(--cobalt); }
.nav { margin-inline-end: auto; margin-inline-start: 28px; }
.tt-btn {
  display: inline-flex; align-items: center; gap: 6px; text-decoration: none;
  background: var(--ink); color: var(--paper); border: var(--line); border-radius: 999px;
  padding: 6px 14px; font-family: var(--ui); font-weight: 700; font-size: 15px; direction: ltr;
  box-shadow: 3px 3px 0 var(--pink);
}
.tt-btn:hover { background: var(--cobalt); }
@media (max-width: 600px) { .tt-btn span { display: none; } .tt-btn { padding: 8px; } }
.cart-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--paper); border: var(--line); border-radius: 999px;
  padding: 6px 16px; font-family: var(--ui); font-weight: 700;
  box-shadow: 3px 3px 0 var(--cobalt);
}
.cart-btn .count {
  background: var(--pink); border: 2px solid var(--ink); border-radius: 999px;
  min-width: 26px; height: 26px; display: inline-grid; place-items: center; font-size: 14px;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--ui); font-weight: 700; font-size: 17px;
  border: var(--line); border-radius: 999px; padding: 12px 26px;
  background: var(--cobalt); color: var(--paper); text-decoration: none;
  box-shadow: 4px 4px 0 var(--ink);
  transition: transform .12s, box-shadow .12s;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--ink); }
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.btn.ghost { background: var(--paper); color: var(--ink); }
.btn.pink { background: var(--pink); color: var(--ink); }
.btn[disabled] { opacity: .55; pointer-events: none; }
.btn.block { width: 100%; }

/* ---------- hero ---------- */
.hero { padding: 64px 0 40px; }
.hero .wrap { display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; }
.pill {
  display: inline-block; background: var(--ink); color: var(--lemon);
  font-family: var(--ui); font-weight: 700; font-size: 15px;
  border-radius: 999px; padding: 4px 16px;
}
.hero h1 {
  font-family: var(--display); font-weight: 400;
  font-size: clamp(44px, 7vw, 84px); line-height: 1.15; margin: 18px 0 12px;
}
.hero h1 em { font-style: normal; color: var(--cobalt); }
.hero p.lead { font-size: 20px; max-width: 30ch; margin: 0 0 28px; }
.hero .cta { display: flex; gap: 14px; flex-wrap: wrap; }
/* hero: an ink-drawn iPad showing real planner pages */
.hero-art { position: relative; max-width: 500px; justify-self: center; width: 100%; padding-inline-end: 22px; }
.ipad {
  all: unset; cursor: pointer; display: block; position: relative;
  background: var(--paper); border: 3px solid var(--ink); border-radius: 30px;
  padding: 18px 18px 18px 30px; transform: rotate(-2deg);
  box-shadow: 10px 10px 0 var(--cobalt), 18px 18px 0 var(--pink);
  transition: transform .2s;
}
.ipad:hover { transform: rotate(-1deg) translateY(-3px); }
.ipad:focus-visible { outline: 3px solid var(--cobalt); outline-offset: 6px; }
.ipad .cam { position: absolute; left: 12px; top: 50%; width: 8px; height: 8px; margin-top: -4px; border-radius: 50%; background: var(--ink); }
.ipad .screen {
  display: grid; aspect-ratio: 1400 / 1051; overflow: hidden;
  border: 2px solid var(--ink); border-radius: 12px; background: var(--lemon);
}
.ipad .screen img { grid-area: 1 / 1; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .8s; }
.ipad .screen img.on { opacity: 1; }
.pencil {
  position: absolute; inset-inline-end: 0; top: 12%; width: 12px; height: 62%;
  background: var(--paper); border: 2.5px solid var(--ink); border-radius: 6px 6px 2px 2px;
  transform: rotate(-2deg); box-shadow: 3px 3px 0 var(--pink);
}
.pencil::after { content: ''; position: absolute; left: 50%; bottom: -12px; margin-left: -4px; border: 4px solid transparent; border-top: 9px solid var(--ink); }
.hero-caption { display: flex; align-items: center; gap: 10px; margin-top: 30px; font-family: var(--ui); font-weight: 700; justify-content: center; }

/* ---------- sections ---------- */
section { padding: 56px 0; scroll-margin-top: 72px; }
.section-title { font-family: var(--display); font-weight: 400; font-size: clamp(34px, 5vw, 52px); margin: 0 0 8px; line-height: 1.2; }
.section-sub { margin: 0 0 32px; font-size: 18px; }

/* ---------- category tabs ---------- */
.tabs { display: flex; gap: 10px; flex-wrap: wrap; margin: 8px 0 14px; }
.tabs button {
  display: inline-flex; align-items: center; gap: 8px;
  border: var(--line); border-radius: 999px; padding: 8px 20px; background: var(--paper);
  font-family: var(--ui); font-weight: 700; font-size: 16px;
}
.tabs button[aria-selected="true"] { background: var(--ink); color: var(--lemon); box-shadow: 3px 3px 0 var(--cobalt); }
.tabs .soon {
  background: var(--pink); color: var(--ink); border: 2px solid var(--ink); border-radius: 999px;
  font-size: 12px; padding: 0 8px; line-height: 1.6;
}
.soon-panel {
  grid-column: 1 / -1; text-align: center; background: var(--paper); border: var(--line);
  border-radius: var(--radius); padding: 40px 20px; box-shadow: 6px 6px 0 var(--ink);
  display: grid; justify-items: center; gap: 6px;
}
.soon-panel img { border-radius: 16px; }
.soon-panel h3 { font-family: var(--display); font-weight: 400; font-size: 34px; margin: 6px 0 0; }
.soon-panel p { margin: 0; max-width: 42ch; }

/* ---------- product cards ---------- */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.card {
  background: var(--paper); border: var(--line); border-radius: var(--radius);
  position: relative; display: flex; flex-direction: column;
  box-shadow: 6px 6px 0 var(--ink);
  transition: transform .15s, box-shadow .15s;
}
.card:hover { transform: translate(-2px, -2px); box-shadow: 8px 8px 0 var(--cobalt); }
/* the product image fills the whole frame, edge to edge */
.card .thumb {
  border-bottom: var(--line); background: var(--lemon);
  aspect-ratio: 1; overflow: hidden;
  border-radius: calc(var(--radius) - 3px) calc(var(--radius) - 3px) 0 0;
}
.card .thumb button { all: unset; cursor: pointer; display: block; width: 100%; height: 100%; }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; object-position: center; }
/* badge sits on the card's frame, not inside the picture */
.card .badge {
  position: absolute; top: -16px; inset-inline-start: 16px; z-index: 2;
  background: var(--pink); border: var(--line); border-radius: 999px;
  font-family: var(--ui); font-weight: 700; font-size: 15px; padding: 2px 14px;
  box-shadow: 3px 3px 0 var(--ink);
}
.card .body { padding: 18px 20px 22px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card h3 { font-family: var(--display); font-weight: 400; font-size: 28px; margin: 0; line-height: 1.3; }
.card .tagline { font-size: 15px; color: var(--pink-text); font-family: var(--ui); font-weight: 700; }
.card .summary { font-size: 15.5px; margin: 4px 0 12px; flex: 1; }
.card .foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.price { font-family: var(--ui); font-weight: 700; font-size: 24px; }
.price s { font-size: 16px; opacity: .55; margin-inline-start: 6px; }
.price .free { color: var(--cobalt); }

/* ---------- how it works ---------- */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; counter-reset: s; }
.step {
  background: var(--paper); border: var(--line); border-radius: var(--radius);
  padding: 22px 20px; position: relative;
}
.step::before {
  counter-increment: s; content: counter(s, arabic-indic);
  position: absolute; top: -20px; inset-inline-start: 18px;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--cobalt); color: var(--paper); border: var(--line);
  display: grid; place-items: center; font-family: var(--ui); font-weight: 700; font-size: 20px;
}
.step h4 { font-family: var(--ui); font-size: 18px; margin: 10px 0 4px; }
.step p { margin: 0; font-size: 15.5px; }

/* ---------- FAQ ---------- */
.faq { display: grid; gap: 12px; max-width: 780px; }
.faq details { background: var(--paper); border: var(--line); border-radius: 14px; padding: 4px 20px; }
.faq summary { font-family: var(--ui); font-weight: 700; cursor: pointer; padding: 12px 0; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; float: inline-end; font-size: 22px; line-height: 1; }
.faq details[open] summary::after { content: '−'; }
.faq p { margin: 0 0 14px; }

/* ---------- footer ---------- */
footer { background: var(--ink); color: var(--lemon-soft); padding: 40px 0; margin-top: 40px; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 24px; justify-content: space-between; align-items: center; }
footer a { color: var(--lemon); }
footer small { opacity: .8; }

/* ---------- dialogs (product + cart) ---------- */
dialog {
  border: var(--line); border-radius: 22px; padding: 0; color: var(--ink);
  background: var(--paper); box-shadow: 8px 8px 0 var(--cobalt);
  width: min(960px, 100% - 24px); max-height: calc(100dvh - 32px);
}
dialog::backdrop { background: rgba(28, 33, 66, .55); }
.dlg-close {
  position: absolute; top: 12px; inset-inline-end: 12px; z-index: 2;
  width: 40px; height: 40px; border-radius: 50%; border: var(--line);
  background: var(--lemon); font-size: 22px; line-height: 1;
}
.pd { display: grid; grid-template-columns: 1.05fr 1fr; }
.pd .gallery { background: var(--lemon-soft); border-inline-end: var(--line); padding: 18px; }
.pd .gallery .main { border: var(--line); border-radius: 14px; background: var(--paper); }
.pd .thumbs { display: flex; gap: 8px; margin-top: 12px; overflow-x: auto; }
.pd .thumbs button { all: unset; cursor: pointer; width: 64px; flex: none; border: 2px solid transparent; border-radius: 8px; overflow: hidden; }
.pd .thumbs button[aria-current="true"] { border-color: var(--cobalt); }
.pd .info { padding: 28px 26px; overflow-y: auto; max-height: calc(100dvh - 40px); }
.pd h2 { font-family: var(--display); font-weight: 400; font-size: 38px; margin: 0; line-height: 1.25; }
.pd ul { padding-inline-start: 20px; margin: 10px 0 18px; }
.pd li { margin-bottom: 2px; }
.opt { margin: 16px 0; border: 0; padding: 0; }
.opt legend { font-family: var(--ui); font-weight: 700; margin-bottom: 8px; padding: 0; }
.opt .choices { display: flex; gap: 10px; flex-wrap: wrap; }
.opt label { position: relative; }
.opt input { position: absolute; opacity: 0; inset: 0; }
.opt span {
  display: inline-block; border: var(--line); border-radius: 999px; padding: 6px 18px;
  font-family: var(--ui); font-weight: 700; font-size: 15px; background: var(--paper); cursor: pointer;
}
.opt input:checked + span { background: var(--ink); color: var(--lemon); }
.opt input:focus-visible + span { outline: 3px solid var(--cobalt); outline-offset: 2px; }

/* cart */
#cart { width: min(520px, 100% - 24px); }
.cart-inner { padding: 26px 24px; }
.cart-inner h2 { font-family: var(--display); font-weight: 400; font-size: 34px; margin: 0 0 14px; }
.lines { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 10px; }
.lines li { display: flex; gap: 12px; align-items: center; border: 2px solid var(--ink); border-radius: 12px; padding: 8px; }
.lines img { width: 56px; border-radius: 6px; border: 1.5px solid var(--ink); }
.lines .l-text { flex: 1; line-height: 1.5; }
.lines .l-text small { display: block; opacity: .75; }
.lines .rm { border: 0; background: none; color: var(--pink-text); font-family: var(--ui); font-weight: 700; }
.total-row { display: flex; justify-content: space-between; font-family: var(--ui); font-weight: 700; font-size: 20px; border-top: 2px dashed var(--ink); padding-top: 12px; margin-bottom: 18px; }
.field { display: grid; gap: 4px; margin-bottom: 12px; }
.field label { font-family: var(--ui); font-weight: 700; font-size: 15px; }
.field input {
  font: inherit; border: var(--line); border-radius: 12px; padding: 10px 14px; background: var(--paper);
}
.field input:focus { outline: none; border-color: var(--cobalt); box-shadow: 3px 3px 0 var(--cobalt); }
.field .err { color: var(--pink-text); font-size: 14px; min-height: 0; }
.note { background: var(--lemon-soft); border: 2px dashed var(--ink); border-radius: 12px; padding: 10px 14px; font-size: 15px; margin: 6px 0 16px; }
.empty { text-align: center; padding: 20px 0; }

/* order success */
.bank { background: var(--lemon-soft); border: var(--line); border-radius: 14px; padding: 14px 16px; margin: 14px 0; }
.bank dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; }
.bank dt { font-family: var(--ui); font-weight: 700; }
.bank dd { margin: 0; direction: ltr; text-align: right; font-family: ui-monospace, monospace; word-break: break-all; }
.bank dd.ar { direction: rtl; font-family: var(--body); }
.code-big { font-family: var(--ui); font-weight: 700; font-size: 30px; color: var(--cobalt); direction: ltr; display: inline-block; }
.copy { border: 2px solid var(--ink); border-radius: 999px; background: var(--paper); font-size: 13px; padding: 0 10px; margin-inline-start: 8px; font-family: var(--ui); font-weight: 700; }

/* toast */
.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(120px);
  background: var(--ink); color: var(--lemon); border-radius: 999px; padding: 10px 22px;
  font-family: var(--ui); font-weight: 700; transition: transform .25s; z-index: 50;
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* simple page (receipt, policies) */
.page { padding: 48px 0; }
.panel { background: var(--paper); border: var(--line); border-radius: 22px; padding: 28px; box-shadow: 8px 8px 0 var(--cobalt); max-width: 640px; margin-inline: auto; }
.panel h1 { font-family: var(--display); font-weight: 400; font-size: 40px; margin: 0 0 8px; line-height: 1.25; }
.drop {
  display: grid; place-items: center; text-align: center; gap: 6px;
  border: 2.5px dashed var(--ink); border-radius: 16px; padding: 28px 16px; background: var(--lemon-soft);
  cursor: pointer; margin: 16px 0;
}
.drop.has { border-style: solid; border-color: var(--cobalt); }
.drop input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.prose h2 { font-family: var(--ui); font-size: 22px; margin: 28px 0 6px; }

@media (max-width: 900px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .hero-art { max-width: 460px; }
  .grid { grid-template-columns: 1fr 1fr; }
  .steps { grid-template-columns: 1fr 1fr; row-gap: 34px; }
  .pd { grid-template-columns: 1fr; }
  .pd .gallery { border-inline-end: 0; border-bottom: var(--line); }
  .pd .info { max-height: none; }
  .nav { display: none; }
}
@media (max-width: 600px) {
  .grid, .steps { grid-template-columns: 1fr; }
  /* phone: image beside the text so cards stay short */
  .card { flex-direction: row; }
  .card .thumb { aspect-ratio: auto; width: 132px; flex: none; border-bottom: 0; border-inline-end: var(--line); border-radius: 0 calc(var(--radius) - 3px) calc(var(--radius) - 3px) 0; }
  .card .badge { top: -13px; inset-inline-start: 10px; font-size: 12px; padding: 0 10px; box-shadow: 2px 2px 0 var(--ink); }
  .card .body { padding: 12px 14px 14px; gap: 2px; }
  .card h3 { font-size: 22px; }
  .card .tagline { font-size: 13px; }
  .card .summary { font-size: 14px; margin: 2px 0 8px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .card .foot { flex-wrap: wrap; gap: 6px; }
  .card .foot .btn { padding: 6px 14px; font-size: 14px; box-shadow: 3px 3px 0 var(--ink); }
  .card .price { font-size: 19px; }
  .hero-art { max-width: 340px; padding-inline-end: 16px; }
  .ipad { border-radius: 20px; padding: 10px 10px 10px 20px; box-shadow: 6px 6px 0 var(--cobalt), 11px 11px 0 var(--pink); }
  .ipad .cam { left: 7px; width: 6px; height: 6px; margin-top: -3px; }
  .hero-caption { margin-top: 22px; font-size: 14px; }
  .hero { padding-top: 36px; }
  .logo img { height: 36px; }
  dialog { max-height: calc(100dvh - 16px); overflow-y: auto; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
