/* =========================================================================
   AKA TEAM — styles.css

   Built on the same token set and component vocabulary as
   mohamedalaaportfolio.pages.dev, so the team site is the personal site
   with the same hand on it: warm off-white, near-black ink, one deep teal
   accent, mono labels, 12px radius, a single hairline shadow.

   Tokens are copied verbatim from the original build. Change them here and
   both palettes move together.
   ========================================================================= */

/* -------------------------------------------------------------------------
   1. Tokens
   ------------------------------------------------------------------------- */
:root,
[data-theme="light"] {
  --bg: #fafaf9;
  --surface: #fff;
  --panel: #f4f4f2;
  --text: #16161a;
  --muted: #5c5c60;
  --border: #e4e4e0;
  --accent: #0b5e57;
  --accent-soft: #e0efec;
  --btn-bg: #16161a;
  --btn-text: #fff;
  --shadow: 0 1px 2px #0000000f;
  --radius: 12px;
  --max: 1060px;
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #101013;
  --surface: #17171b;
  --panel: #1d1d22;
  --text: #f2f1ec;
  --muted: #a7a7ad;
  --border: #2b2b31;
  --accent: #6fd3c6;
  --accent-soft: #1e3230;
  --btn-bg: #f2f1ec;
  --btn-text: #101013;
  --shadow: 0 1px 2px #0006;
  color-scheme: dark;
}

/* -------------------------------------------------------------------------
   2. Base
   ------------------------------------------------------------------------- */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  transition: background-color .25s ease, color .25s ease;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .85em;
}

h1, h2, h3 { letter-spacing: -.02em; margin: 0 0 .6em; line-height: 1.2; }
h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
h2 { font-size: clamp(1.5rem, 3.4vw, 2.1rem); }
h3 { font-size: 1.1rem; }

p { margin: 0 0 1em; }

a { color: var(--accent); }
a:hover { text-decoration-thickness: 2px; }

img, svg, iframe { max-width: 100%; }

::selection { background: var(--accent); color: var(--surface); }

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

section[id] { scroll-margin-top: 76px; }

.container { max-width: var(--max); margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }

.skip-link {
  background: var(--btn-bg);
  color: var(--btn-text);
  z-index: 100;
  border-radius: 0 0 8px;
  padding: 10px 16px;
  position: absolute;
  top: 0;
  left: -999px;
}
.skip-link:focus { left: 0; }

/* -------------------------------------------------------------------------
   3. Header
   ------------------------------------------------------------------------- */
.site-header {
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  position: fixed;
  inset: 0 0 auto;
}
.site-header.is-scrolled { border-bottom-color: var(--border); }

.header-inner {
  align-items: center;
  gap: 20px;
  height: 64px;
  display: flex;
}

.brand {
  color: var(--text);
  align-items: center;
  gap: 10px;
  text-decoration: none;
  display: flex;
}

/* The monogram tile. Swapped for the real logo file if you drop one in
   assets/img/ — see README. */
.brand-mark {
  background: var(--btn-bg);
  width: 36px;
  height: 36px;
  color: var(--btn-text);
  border-radius: 9px;
  place-items: center;
  font-family: ui-monospace, monospace;
  font-size: .85rem;
  font-weight: 700;
  display: grid;
  flex: none;
  overflow: hidden;
}
.brand-mark svg { width: 22px; height: 22px; }

.brand-text { flex-direction: column; line-height: 1.2; display: flex; }
.brand-text strong { font-size: .95rem; letter-spacing: .01em; }
.brand-text small { color: var(--muted); font-size: .75rem; }

.desktop-nav { gap: 4px; margin-left: auto; display: flex; }
.desktop-nav a {
  color: var(--muted);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: .92rem;
  text-decoration: none;
}
.desktop-nav a:hover { color: var(--text); background: var(--panel); }
.desktop-nav a.is-active { color: var(--text); background: var(--panel); font-weight: 600; }

.header-actions { align-items: center; gap: 8px; margin-left: auto; display: flex; }
.desktop-nav + .header-actions { margin-left: 0; }

.icon-btn {
  width: 38px;
  height: 38px;
  color: var(--text);
  border: 1px solid var(--border);
  cursor: pointer;
  background: 0 0;
  border-radius: 9px;
  place-items: center;
  display: grid;
  flex: none;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.icon-btn:hover { background: var(--panel); }
.icon-btn svg { width: 18px; height: 18px; }

/* Only one of the two icons is ever shown; the CSS picks by active theme. */
.theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

.mobile-nav {
  border-top: 1px solid var(--border);
  background: var(--bg);
  flex-direction: column;
  gap: 4px;
  padding: 12px 20px 16px;
  display: flex;
}
.mobile-nav[hidden] { display: none; }
.mobile-nav a:not(.btn) {
  color: var(--text);
  border-radius: 8px;
  padding: 10px 12px;
  text-decoration: none;
}
.mobile-nav a:not(.btn).is-active { background: var(--panel); font-weight: 600; }

/* NOTE: the .desktop-only / .mobile-only visibility rules live in section 12,
   at the end of this file. They must come after .btn, which also sets
   display:inline-flex — otherwise the button wins on source order and the
   "Hire us" CTA never hides on a phone. */

/* -------------------------------------------------------------------------
   4. Buttons
   ------------------------------------------------------------------------- */
.btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  box-shadow: var(--shadow);
  border-radius: 10px;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  font-size: .95rem;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  transition: border-color .15s ease, background-color .15s ease, opacity .15s ease;
}
.btn:hover { border-color: var(--text); }
.btn-primary { background: var(--btn-bg); color: var(--btn-text); border-color: var(--btn-bg); }
.btn-primary:hover { opacity: .88; }
.btn-ghost { box-shadow: none; }
.btn-small { padding: 8px 14px; font-size: .86rem; }
.btn-block { width: 100%; }

/* -------------------------------------------------------------------------
   5. Hero
   ------------------------------------------------------------------------- */
.hero-section { padding: 128px 0 64px; }
.hero-narrow { max-width: 780px; }

.eyebrow {
  color: var(--muted);
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  font-size: .85rem;
  display: flex;
}
.dot { background: #1d9e6c; border-radius: 50%; flex: none; width: 8px; height: 8px; }
.role-line {
  color: var(--muted);
  margin-top: 6px;
  font-size: .55em;
  font-weight: 500;
  display: block;
}

/* Typewriter line. Phrases cycle; the caret blinks. */
.typed-line { font-size: 1.15rem; }
.typed-line strong { color: var(--accent); }
.caret { color: var(--muted); animation: 1.1s step-end infinite blink; }
@keyframes blink { 50% { opacity: 0; } }

.lede { color: var(--muted); max-width: 56ch; }
.cta-row { flex-wrap: wrap; gap: 10px; margin: 20px 0 26px; display: flex; }

.hero-meta {
  border-top: 1px solid var(--border);
  gap: 10px;
  margin: 0;
  padding-top: 18px;
  display: grid;
}
.hero-meta > div { grid-template-columns: 150px 1fr; gap: 12px; display: grid; }
.hero-meta dt { color: var(--muted); font-size: .85rem; }
.hero-meta dd { overflow-wrap: anywhere; margin: 0; }
@media (width <= 560px) {
  .hero-meta > div { grid-template-columns: 1fr; gap: 2px; }
}

/* -------------------------------------------------------------------------
   6. Sections
   ------------------------------------------------------------------------- */
.section { padding: 72px 0; }
.section-alt {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.section-sub { color: var(--muted); max-width: 62ch; }

.two-col {
  grid-template-columns: 1.1fr 1fr;
  align-items: start;
  gap: 36px;
  margin-top: 28px;
  display: grid;
}
@media (width <= 900px) { .two-col { grid-template-columns: 1fr; } }

.panel {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.section-alt .panel { background: var(--bg); }

.check-list { gap: 8px; margin: 18px 0 0; padding: 0; list-style: none; display: grid; }
.check-list li { padding-left: 26px; position: relative; }
.check-list li::before {
  content: "✓";
  color: var(--accent);
  font-weight: 700;
  position: absolute;
  left: 0;
}

.facts { gap: 10px; margin: 0 0 20px; display: grid; }
.facts > div { grid-template-columns: 110px 1fr; gap: 10px; font-size: .92rem; display: grid; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
@media (width <= 480px) { .facts > div { grid-template-columns: 1fr; gap: 0; } }

.timeline { gap: 18px; margin: 0; padding: 0; list-style: none; display: grid; }
.timeline li { border-left: 2px solid var(--border); padding-left: 16px; }
.timeline .period { color: var(--accent); margin-bottom: 2px; font-size: .8rem; display: block; }
.timeline small { color: var(--muted); margin-bottom: 4px; display: block; }
.timeline p { color: var(--muted); margin: 0; font-size: .93rem; }

/* -------------------------------------------------------------------------
   7. Tags
   ------------------------------------------------------------------------- */
.tags {
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
}
.tags li {
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: 999px;
  padding: 5px 11px;
  font-size: .83rem;
}
.tags-small li { padding: 4px 10px; font-size: .78rem; }
.tech-groups { display: grid; gap: 18px; margin-top: 14px; }
.tech-group h4 { margin: 0; font-size: .9rem; }
.tech-group .tags { margin-top: 8px; }

/* -------------------------------------------------------------------------
   8. Project index
   ------------------------------------------------------------------------- */
.filter-row { flex-wrap: wrap; gap: 8px; margin-top: 22px; display: flex; }
.filter-row[hidden] { display: none; }
.chip {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  border-radius: 999px;
  align-items: center;
  gap: 8px;
  padding: 8px 15px;
  font-size: .88rem;
  font-weight: 600;
  display: inline-flex;
}
.chip .count {
  background: var(--panel);
  border-radius: 999px;
  padding: 1px 8px;
  font-size: .75rem;
  font-weight: 700;
}
.chip.is-active { background: var(--btn-bg); color: var(--btn-text); border-color: var(--btn-bg); }
.chip.is-active .count { background: 0 0; border: 1px solid; }
.chip[hidden] { display: none; }

.project-grid { align-items: stretch; }
.project-card { flex-direction: column; display: flex; }
.project-card[hidden] { display: none; }

.project-top { justify-content: space-between; align-items: center; margin-bottom: 10px; display: flex; }
.status-pill {
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 999px;
  align-items: center;
  gap: 7px;
  padding: 4px 12px;
  font-size: .78rem;
  font-weight: 700;
  display: inline-flex;
}
.status-pill.is-live { color: var(--accent); border-color: var(--accent); }
.status-pill .dot { width: 6px; height: 6px; background: currentColor; }

.project-links { gap: 16px; margin-top: auto; padding-top: 16px; display: flex; }
.text-link {
  align-items: center;
  gap: 6px;
  font-size: .9rem;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
}
.text-link:hover { text-decoration: underline; }
.text-link.is-disabled { color: var(--muted); cursor: default; }
.text-link.is-disabled:hover { text-decoration: none; }

/* Featured project: live preview you can click into. */
.project-feature {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  grid-template-columns: 1.25fr 1fr;
  align-items: center;
  gap: 32px;
  margin-top: 28px;
  padding: 26px;
  display: grid;
}
.section-alt .project-feature { background: var(--surface); }
@media (width <= 900px) { .project-feature { grid-template-columns: 1fr; } }

.tilt { perspective: 1100px; }
.tilt-inner {
  transform-style: preserve-3d;
  will-change: transform;
  transition: transform .25s ease-out;
}

.preview-frame {
  aspect-ratio: 16/10;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  background: #fff;
  border-radius: 10px;
  position: relative;
  overflow: hidden;
}
.preview-frame.is-active { aspect-ratio: auto; height: min(600px, 72vh); }
.preview-frame iframe { pointer-events: none; border: 0; width: 100%; height: 100%; display: block; }
.preview-frame.is-active iframe { pointer-events: auto; }
.tilt.is-live .tilt-inner { transform: none; }

.preview-cta {
  white-space: nowrap;
  background: var(--btn-bg);
  color: var(--btn-text);
  border: 1px solid var(--btn-bg);
  cursor: pointer;
  border-radius: 999px;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  font-size: .86rem;
  font-weight: 600;
  display: inline-flex;
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  box-shadow: 0 4px 14px #00000040;
}
.preview-cta:hover { opacity: .9; }

.link-btn {
  font: inherit;
  cursor: pointer;
  color: var(--accent);
  background: 0 0;
  border: none;
  padding: 0;
}
.project-live-note { margin-top: 4px; }
.project-live-note p { margin-bottom: 10px; }
.project-info h3 { margin: 12px 0 8px; font-size: 1.35rem; }
.project-info .tags { margin-bottom: 18px; }

.project-empty {
  color: var(--muted);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  margin-top: 28px;
  padding: 28px;
  text-align: center;
}
.project-empty[hidden] { display: none; }

/* -------------------------------------------------------------------------
   9. Contact
   ------------------------------------------------------------------------- */
.contact-list { gap: 18px; margin: 28px 0 0; padding: 0; list-style: none; display: grid; }
.contact-list li { gap: 2px; display: grid; }
.contact-list strong { overflow-wrap: anywhere; font-size: 1.02rem; }
.contact-list .btn { justify-self: start; margin-top: 8px; }

.contact-form { gap: 14px; margin-top: 28px; display: grid; }
.two-col .contact-form { margin-top: 28px; }

.field { gap: 6px; display: grid; }
.field label { font-size: .88rem; font-weight: 600; }
.field input,
.field textarea {
  font: inherit;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  resize: vertical;
  border-radius: 10px;
  width: 100%;
  padding: 11px 13px;
}
.section-alt .field input,
.section-alt .field textarea { background: var(--bg); }
.field input:focus,
.field textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.field-error { color: #c92a2a; margin: 0; font-size: .85rem; }
[data-theme="dark"] .field-error { color: #ff9c9c; }
.form-note { color: var(--accent); margin: 0; font-size: .9rem; }
.form-note:empty { display: none; }

/* -------------------------------------------------------------------------
   10. Footer
   ------------------------------------------------------------------------- */
.site-footer { border-top: 1px solid var(--border); padding: 36px 0; }
.footer-inner { grid-template-columns: 1fr auto 1fr; align-items: center; gap: 20px; display: grid; }
.footer-inner nav { flex-wrap: wrap; justify-content: center; gap: 6px 16px; display: flex; }
.footer-inner nav a { color: var(--muted); font-size: .9rem; text-decoration: none; }
.footer-inner nav a:hover { color: var(--text); }
.footer-inner > :last-child { justify-self: end; margin: 0; }
@media (width <= 820px) {
  .footer-inner { text-align: center; grid-template-columns: 1fr; }
  .footer-inner nav { justify-content: center; }
  .footer-inner > :last-child { justify-self: center; }
}

.to-top {
  background: var(--btn-bg);
  width: 44px;
  height: 44px;
  color: var(--btn-text);
  cursor: pointer;
  box-shadow: var(--shadow);
  border: none;
  border-radius: 12px;
  place-items: center;
  display: grid;
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 40;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity .2s ease, transform .2s ease;
}
.to-top.is-visible { opacity: 1; pointer-events: auto; transform: none; }
.to-top:hover { opacity: .88; }

/* -------------------------------------------------------------------------
   11. Reveal
   ------------------------------------------------------------------------- */
.reveal { opacity: 0; transition: opacity .55s, transform .55s; transform: translateY(14px); }
.reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transition: none; transform: none; }
  .caret { animation: none; }
  .tilt-inner { transition: none; }
}

/* -------------------------------------------------------------------------
   12. Responsive visibility
   Kept last on purpose. .btn sets display:inline-flex later in source order
   than the header, so these rules have to come after it — otherwise the
   desktop-only CTA leaks onto small screens.
   ------------------------------------------------------------------------- */
.mobile-only { display: none; }

@media (width <= 820px) {
  .desktop-nav,
  .desktop-only { display: none; }
  .mobile-only { display: grid; }
  .header-actions { margin-left: auto; }
}
