/* Mahmoud Tabouq — personal site. Colours follow the Plus970 palette. */
:root {
  --bg: #120a24;
  --surface: #1a0e33;
  --surface-2: #2e1856;
  --text: #ffffff;
  --text-2: #c9b8f0;
  --accent: #1afecb;
  --line: #5325ad;
  --cut: 28px; /* 45° chamfer size */
  --font-en: 'Montserrat', system-ui, sans-serif;
  --font-ar: 'IBM Plex Sans Arabic', 'Montserrat', system-ui, sans-serif;
  --pad: clamp(16px, 5vw, 72px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-en);
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
:lang(ar) body, html[lang='ar'] body { font-family: var(--font-ar); }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }

.wrap { width: 100%; max-width: 1240px; margin-inline: auto; padding-inline: var(--pad); }

/* Header */
.top {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px);
  border-block-end: 1px solid color-mix(in srgb, var(--line) 45%, transparent);
}
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 24px; height: 68px; }
.brand { font-weight: 800; text-decoration: none; letter-spacing: -0.01em; }
.brand span { color: var(--accent); }
.nav { display: flex; gap: clamp(14px, 3vw, 32px); font-size: 0.92rem; }
.nav a { text-decoration: none; color: var(--text-2); transition: color .2s; }
.nav a:hover, .nav a:focus-visible { color: var(--text); }
.nav .lang { color: var(--text); }
@media (max-width: 640px) { .nav .hide-sm { display: none; } }

/* Hero */
.hero { padding-block: clamp(48px, 9vw, 120px) clamp(56px, 8vw, 110px); }
.hero .wrap { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: clamp(32px, 6vw, 88px); align-items: center; }
.hero h1 {
  margin: 0;
  font-size: clamp(3rem, 8.4vw, 7.4rem);
  line-height: 0.95;
  font-weight: 800;
  letter-spacing: -0.035em;
}
html[lang='ar'] .hero h1 { line-height: 1.2; letter-spacing: 0; font-weight: 700; }
.hero .lead {
  margin: clamp(20px, 3vw, 32px) 0 0;
  max-width: 34ch;
  font-size: clamp(1.1rem, 1.7vw, 1.4rem);
  font-weight: 300;
  color: var(--text-2);
}
.hero .lead strong { color: var(--text); font-weight: 600; }
.actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: clamp(28px, 4vw, 44px); }

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 15px 26px;
  font-weight: 700; font-size: 0.98rem; text-decoration: none;
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 0 100%);
  transition: transform .2s;
}
html[dir='rtl'] .btn { clip-path: polygon(14px 0, 100% 0, 100% 100%, 0 100%, 0 14px); }
.btn:hover { transform: translateY(-2px); }
.btn-main { background: var(--accent); color: #0d0620; }
.btn-ghost, html[dir='rtl'] .btn-ghost { clip-path: none; background: transparent; color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }

/* Photo with the 45° chamfer */
.photo {
  position: relative;
  clip-path: polygon(0 0, calc(100% - var(--cut) * 2) 0, 100% calc(var(--cut) * 2), 100% 100%, 0 100%);
  background: var(--surface);
}
html[dir='rtl'] .photo { clip-path: polygon(calc(var(--cut) * 2) 0, 100% 0, 100% 100%, 0 100%, 0 calc(var(--cut) * 2)); }
.photo img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }
.photo-frame { position: relative; }
.photo-frame::before { /* construction line */
  content: ''; position: absolute; inset: -14px; border: 1px solid var(--line); opacity: .55; pointer-events: none;
}

@media (max-width: 860px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .hero .photo-frame { order: -1; max-width: 420px; }
}

/* Sections */
section { border-block-start: 1px solid color-mix(in srgb, var(--line) 45%, transparent); }
.block { padding-block: clamp(64px, 9vw, 120px); }
.block h2 {
  margin: 0 0 clamp(28px, 4vw, 48px);
  font-size: clamp(2rem, 4.4vw, 3.6rem);
  line-height: 1.05; font-weight: 800; letter-spacing: -0.02em;
}
html[lang='ar'] .block h2 { line-height: 1.3; letter-spacing: 0; font-weight: 700; }

.about .wrap { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: clamp(32px, 6vw, 88px); align-items: start; }
.about .photo img { aspect-ratio: 4 / 5; }
.about p { margin: 0 0 1.1em; font-size: clamp(1.05rem, 1.4vw, 1.2rem); color: var(--text-2); max-width: 60ch; }
.about p:first-of-type { color: var(--text); font-size: clamp(1.25rem, 1.9vw, 1.6rem); line-height: 1.45; font-weight: 300; }
.about a { color: var(--accent); text-decoration: none; font-weight: 600; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin-top: clamp(28px, 4vw, 48px); border-block-start: 1px solid var(--line); }
.stats div { padding: 22px 0; }
.stats b { display: block; font-size: clamp(2rem, 4vw, 3.2rem); font-weight: 800; line-height: 1.1; }
.stats b em { font-style: normal; color: var(--accent); }
.stats span { color: var(--text-2); font-size: .95rem; }
@media (max-width: 860px) {
  .about .wrap { grid-template-columns: 1fr; }
  .about .photo-frame { max-width: 420px; }
}
@media (max-width: 520px) { .stats { grid-template-columns: 1fr; } .stats div { padding: 14px 0; border-block-end: 1px solid color-mix(in srgb, var(--line) 45%, transparent); } }

.services { background: var(--surface); }
.list { list-style: none; margin: 0; padding: 0; }
.list li {
  display: grid; grid-template-columns: 1fr 1.3fr; gap: 24px;
  padding-block: clamp(22px, 3vw, 34px);
  border-block-start: 1px solid var(--line);
}
.list li:last-child { border-block-end: 1px solid var(--line); }
.list h3 { margin: 0; font-size: clamp(1.3rem, 2.4vw, 2rem); font-weight: 700; line-height: 1.2; }
.list p { margin: 0; color: var(--text-2); }
@media (max-width: 700px) { .list li { grid-template-columns: 1fr; gap: 8px; } }

.contact .big {
  display: inline-block;
  font-size: clamp(1.8rem, 6vw, 4.6rem);
  font-weight: 800; line-height: 1.1; letter-spacing: -0.02em;
  text-decoration: none;
  direction: ltr; unicode-bidi: isolate;
}
.contact .big:hover { color: var(--accent); }
.contact .rows { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; margin-top: clamp(36px, 5vw, 64px); }
.contact .rows div { border-block-start: 1px solid var(--line); padding-top: 16px; }
.contact .rows span { display: block; color: var(--text-2); font-size: .9rem; margin-bottom: 4px; }
.contact .rows a { text-decoration: none; font-weight: 600; direction: ltr; unicode-bidi: isolate; }
.contact .rows a:hover { color: var(--accent); }
@media (max-width: 700px) { .contact .rows { grid-template-columns: 1fr; } }

/* Footer */
footer { border-block-start: 1px solid color-mix(in srgb, var(--line) 45%, transparent); padding-block: 32px; font-size: .9rem; color: var(--text-2); }
footer .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
footer a { text-decoration: none; }
footer a:hover { color: var(--text); }
footer .made { display: inline-flex; align-items: center; gap: 10px; }
footer .made img { height: 22px; width: auto; }

/* Legal page */
.legal { padding-block: clamp(48px, 8vw, 100px); }
.legal .wrap { max-width: 820px; }
.legal h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); line-height: 1.1; margin: 0 0 10px; font-weight: 800; }
.legal .date { color: var(--text-2); margin: 0 0 40px; }
.legal h2 { font-size: 1.3rem; margin: 2.2em 0 .6em; }
.legal p, .legal li { color: var(--text-2); }
.legal a { color: var(--accent); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

@media (prefers-reduced-motion: no-preference) {
  .rise { animation: rise .9s cubic-bezier(.2,.7,.2,1) both; }
  .rise.d2 { animation-delay: .12s; }
  .rise.d3 { animation-delay: .24s; }
  @keyframes rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
}
