/* ===================================================================
   Fred Mavoungou — Portfolio
   =================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
  --bg: #1c1c1e;
  --bg-alt: #232326;
  --text: #ffffff;
  --text-dim: #a8a8ad;
  --accent: #ff6b35;
  --line: rgba(255, 255, 255, 0.14);
  --ff-display: 'Space Grotesk', 'Inter', sans-serif;
  --ff-body: 'Inter', sans-serif;
  --ff-mono: 'Space Grotesk', monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--ff-body);
  font-size: 16px;
  line-height: 1.5;
  overflow-x: hidden;
  cursor: none;
}

@media (max-width: 860px), (hover: none) {
  body { cursor: auto; }
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img { max-width: 100%; display: block; }
button { font: inherit; background: none; border: none; color: inherit; cursor: pointer; }

::selection { background: var(--accent); color: #1c1c1e; }

.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 6vw;
}

/* ---------- Preloader ---------- */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity .6s var(--ease), visibility .6s;
}
.preloader-count {
  font-family: var(--ff-display);
  font-weight: 700;
  font-size: clamp(3rem, 10vw, 6rem);
  color: var(--text);
}
.preloader-count::after {
  content: '%';
  font-size: 0.4em;
  color: var(--text-dim);
  margin-left: 0.2em;
}
.preloader.is-done { opacity: 0; visibility: hidden; pointer-events: none; }

/* ---------- Grain overlay ---------- */
.grain {
  position: fixed;
  inset: 0;
  z-index: 999;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Custom cursor ---------- */
.cursor, .cursor-dot {
  position: fixed;
  top: 0; left: 0;
  pointer-events: none;
  z-index: 1000;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  will-change: transform;
}
.cursor {
  width: 34px; height: 34px;
  border: 1px solid var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: width .25s var(--ease), height .25s var(--ease), background-color .25s var(--ease), border-color .25s var(--ease), opacity .25s var(--ease);
}
.cursor-dot {
  width: 4px; height: 4px;
  background: var(--text);
}
.cursor.is-active {
  width: 64px; height: 64px;
  background: var(--accent);
  border-color: var(--accent);
}
.cursor.has-label { width: 84px; height: 84px; }
.cursor-label {
  font-family: var(--ff-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bg);
  opacity: 0;
  transition: opacity .2s var(--ease);
}
.cursor.has-label .cursor-label { opacity: 1; }
.cursor.is-hidden, .cursor-dot.is-hidden { opacity: 0; }

@media (max-width: 860px), (hover: none) {
  .cursor, .cursor-dot { display: none; }
}

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 6vw;
  mix-blend-mode: difference;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.7em;
}
.logo-mark {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--ff-display);
  font-weight: 700;
  font-size: 0.95rem;
  transition: background .3s var(--ease), color .3s var(--ease);
}
.logo:hover .logo-mark { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.logo-text {
  font-family: var(--ff-display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  display: flex;
  gap: 0.4em;
}
.logo-text span { color: var(--text-dim); font-weight: 500; }

.header-nav {
  display: flex;
  align-items: center;
  gap: 2.2rem;
}
.header-nav a {
  font-family: var(--ff-mono);
  font-size: 0.85rem;
  letter-spacing: 0.03em;
  color: var(--text);
  position: relative;
  padding-bottom: 2px;
}
.header-nav a::after {
  content: '';
  position: absolute;
  left: 0; right: 100%;
  bottom: 0;
  height: 1px;
  background: var(--text);
  transition: right .3s var(--ease);
}
.header-nav a:hover::after { right: 0; }

@media (max-width: 860px) {
  .header-nav { display: none; }
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1.8rem;
}

.lang-widget { position: relative; }
.lang-toggle {
  display: flex;
  align-items: center;
  gap: 0.5em;
  font-family: var(--ff-mono);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 100px;
  padding: 0.5em 0.9em;
  transition: border-color .3s var(--ease);
}
.lang-toggle:hover { border-color: var(--text); }
.lang-current-flag {
  width: 18px; height: 13px;
  border-radius: 2px;
  object-fit: cover;
  flex-shrink: 0;
}
.lang-toggle svg { transition: transform .3s var(--ease); }
body.lang-open .lang-toggle svg { transform: rotate(180deg); }

.lang-dropdown {
  position: fixed;
  top: 76px;
  right: 6vw;
  z-index: 700;
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  min-width: 180px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity .25s var(--ease), transform .25s var(--ease), visibility .25s;
  direction: ltr;
}
body.lang-open .lang-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.lang-option {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.7rem;
  padding: 0.6em 0.8em;
  border-radius: 6px;
  font-size: 0.9rem;
  text-align: left;
  transition: background .2s var(--ease);
}
.lang-option:hover { background: rgba(255, 255, 255, 0.06); }
.lang-option.is-active { color: var(--accent); }
.lang-flag {
  width: 20px; height: 15px;
  border-radius: 2px;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 0 0 1px var(--line);
}
.lang-option .lang-code {
  margin-left: auto;
  font-family: var(--ff-mono);
  font-size: 0.7rem;
  color: var(--text-dim);
}
.lang-option.is-active .lang-code { color: var(--accent); }

.menu-toggle {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 32px;
  z-index: 600;
  position: relative;
}
.menu-toggle span {
  display: block;
  height: 1px;
  background: var(--text);
  transition: transform .4s var(--ease), opacity .4s var(--ease);
}
.menu-toggle .label {
  font-family: var(--ff-mono);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-dim);
  height: auto;
  background: none;
  margin-top: 2px;
}

body.nav-open .menu-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
body.nav-open .menu-toggle span:nth-child(2) { opacity: 0; }
body.nav-open .menu-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (min-width: 861px) {
  .menu-toggle { display: none; }
}

/* ---------- Fullscreen nav ---------- */
.fullscreen-nav {
  position: fixed;
  inset: 0;
  z-index: 400;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 6vw;
  padding-top: max(6vw, 6.5rem);
  overflow-y: auto;
  clip-path: circle(0% at calc(100% - 6vw) 44px);
  transition: clip-path .7s var(--ease);
}
body.nav-open .fullscreen-nav {
  clip-path: circle(150% at calc(100% - 6vw) 44px);
}

.fullscreen-nav ul { display: flex; flex-direction: column; gap: 0.2em; }
.fullscreen-nav li {
  overflow: hidden;
}
.fullscreen-nav a {
  display: inline-block;
  font-family: var(--ff-display);
  font-weight: 600;
  font-size: clamp(2.5rem, 8vw, 5rem);
  color: var(--text-dim);
  transition: color .3s var(--ease);
  transform: translateY(110%);
  transition: transform .6s var(--ease), color .3s var(--ease);
}
body.nav-open .fullscreen-nav a { transform: translateY(0); }
.fullscreen-nav li:nth-child(1) a { transition-delay: .05s, 0s; }
.fullscreen-nav li:nth-child(2) a { transition-delay: .1s, 0s; }
.fullscreen-nav li:nth-child(3) a { transition-delay: .15s, 0s; }
.fullscreen-nav li:nth-child(4) a { transition-delay: .2s, 0s; }
.fullscreen-nav li:nth-child(5) a { transition-delay: .25s, 0s; }
.fullscreen-nav a:hover { color: var(--text); }

.nav-footer {
  margin-top: 4rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 2rem;
  border-top: 1px solid var(--line);
  padding-top: 2rem;
  opacity: 0;
  transition: opacity .5s var(--ease) .3s;
}
body.nav-open .nav-footer { opacity: 1; }

.nav-socials { display: flex; gap: 1.5rem; }
.nav-socials a, .nav-contact a {
  font-family: var(--ff-mono);
  font-size: 0.85rem;
  color: var(--text-dim);
  border-bottom: 1px solid transparent;
}
.nav-socials a:hover, .nav-contact a:hover { color: var(--text); border-color: var(--text); }

/* ---------- Sections generic ---------- */
section { position: relative; }

.eyebrow {
  font-family: var(--ff-mono);
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 0.6em;
  margin-bottom: 1.5em;
}
.eyebrow::before {
  content: '';
  width: 28px; height: 1px;
  background: var(--accent);
}

[data-reveal] {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity .9s var(--ease), transform .9s var(--ease);
}
[data-reveal].in-view { opacity: 1; transform: translateY(0); }
[data-reveal="1"] { transition-delay: .05s; }
[data-reveal="2"] { transition-delay: .15s; }
[data-reveal="3"] { transition-delay: .25s; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  padding: 7.5rem 6vw 5.5rem;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: url('../img/tech.gif');
  background-size: cover;
  background-position: center;
}
@media (prefers-reduced-motion: reduce) {
  .hero-bg { background-image: url('../img/tech-static.jpg'); }
}
.hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, var(--bg) 0%, rgba(28, 28, 30, 0.15) 35%, rgba(28, 28, 30, 0.1) 65%, var(--bg) 100%);
}

.hero-top, .hero-name, .scroll-indicator { position: relative; z-index: 1; }

.hero-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 3rem;
  flex-wrap: wrap;
  margin-top: auto;
  margin-bottom: 3rem;
}

.hero-badge {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: 100px;
  padding: 0.8rem 0.8rem 0.8rem 1.4rem;
}
.hero-badge-text {
  font-family: var(--ff-mono);
  font-size: 0.72rem;
  line-height: 1.5;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.hero-badge-icon {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  flex-shrink: 0;
  overflow: hidden;
}
.hero-badge-icon svg {
  animation: spinGlobe 6s linear infinite;
}
@keyframes spinGlobe {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  .hero-badge-icon svg { animation: none; }
}

.hero-tagline {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  max-width: 24rem;
  text-align: right;
  flex-direction: row-reverse;
  margin-left: auto;
}
.hero-tagline-arrow { color: var(--text-dim); margin-top: 0.3rem; flex-shrink: 0; }
.hero-tagline .eyebrow {
  justify-content: flex-end;
  margin-bottom: 0.6em;
}
.hero-tagline .eyebrow::before { order: 2; }
.hero-sub {
  color: var(--text-dim);
  font-size: 0.95rem;
}

.hero-name {
  margin-top: auto;
  overflow: hidden;
}
.hero-name-track {
  display: flex;
  width: max-content;
  animation: heroNameMarquee 18s linear infinite;
}
.hero-name-word {
  display: block;
  font-family: var(--ff-display);
  font-weight: 700;
  font-size: clamp(3.2rem, 10.5vw, 8.5rem);
  line-height: 0.95;
  letter-spacing: -0.02em;
  white-space: nowrap;
  padding-right: 0.5em;
}
@keyframes heroNameMarquee {
  from { transform: translateX(-50%); }
  to { transform: translateX(0%); }
}
@media (prefers-reduced-motion: reduce) {
  .hero-name-track { animation: none; }
}

.scroll-indicator {
  position: absolute;
  bottom: 1.8rem;
  left: 6vw;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-family: var(--ff-mono);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.scroll-indicator .scroll-line {
  width: 1px; height: 40px;
  background: linear-gradient(var(--text-dim), transparent);
  position: relative;
  overflow: hidden;
}
.scroll-indicator .scroll-line::after {
  content: '';
  position: absolute;
  top: -100%; left: 0;
  width: 100%; height: 100%;
  background: var(--accent);
  animation: scrollLine 2s ease-in-out infinite;
}
@keyframes scrollLine {
  0% { top: -100%; }
  60% { top: 100%; }
  100% { top: 100%; }
}

/* ---------- About ---------- */
.about {
  padding: 10rem 6vw;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 0.9fr 1.4fr;
  gap: 5vw;
}

.about-visual {
  aspect-ratio: 3/4;
  border-radius: 4px;
  background-image: url('../img/tech-static.jpg');
  background-size: cover;
  background-position: center;
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.about-visual::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, rgba(28, 28, 30, 0.75), rgba(28, 28, 30, 0.4) 55%, rgba(28, 28, 30, 0.85));
}
.about-visual::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 20%, rgba(255, 91, 46, 0.22), transparent 60%);
}
.monogram-ring {
  position: relative;
  z-index: 1;
  width: 128px;
  height: 128px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(28, 28, 30, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
}
.about-visual .monogram {
  font-family: var(--ff-display);
  font-weight: 700;
  font-size: 2.6rem;
  color: var(--text);
}
.about-visual-corner {
  position: absolute;
  z-index: 1;
  width: 22px;
  height: 22px;
  border-color: var(--accent);
  opacity: 0.8;
}
.corner-tl { top: 1.1rem; left: 1.1rem; border-top: 1.5px solid; border-left: 1.5px solid; }
.corner-br { bottom: 1.1rem; right: 1.1rem; border-bottom: 1.5px solid; border-right: 1.5px solid; }

.about-text h2 {
  font-family: var(--ff-display);
  font-weight: 600;
  font-size: clamp(1.8rem, 3.4vw, 2.6rem);
  line-height: 1.3;
  max-width: 20ch;
}
.about-text h2 em { color: var(--text-dim); font-style: normal; }

.about-lead {
  margin-top: 1.8rem;
  color: var(--text-dim);
  max-width: 52ch;
  font-size: 1.05rem;
}

.about-meta {
  margin-top: 3rem;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.6rem 2rem;
  border-top: 1px solid var(--line);
  padding-top: 2rem;
}
.about-meta dt {
  font-family: var(--ff-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 0.4rem;
}
.about-meta dd { font-size: 0.98rem; }

/* ---------- Marquee ---------- */
.marquee {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  padding: 1.4rem 0;
}
.marquee-track {
  display: flex;
  width: max-content;
  gap: 3rem;
  animation: marquee 28s linear infinite;
}
.marquee-track span {
  font-family: var(--ff-display);
  font-size: 1.4rem;
  color: var(--text-dim);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 3rem;
}
.marquee-track span::after { content: '—'; color: var(--accent); }
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ---------- Projects ---------- */
.projects {
  padding: 8rem 6vw 10rem;
}
.projects h2 {
  font-family: var(--ff-display);
  font-weight: 600;
  font-size: clamp(1.8rem, 3.4vw, 2.6rem);
  margin-bottom: 3rem;
}

.project-list { border-top: 1px solid var(--line); }

.project-item {
  position: relative;
  display: block;
  padding: 2rem 0;
  border-bottom: 1px solid var(--line);
}

.project-row {
  display: grid;
  grid-template-columns: 3.5rem 1fr auto auto;
  align-items: center;
  gap: 2rem;
  transition: padding-left .4s var(--ease);
}
.project-item:hover .project-row,
.project-item:focus-within .project-row { padding-left: 1rem; }

.project-index {
  font-family: var(--ff-mono);
  color: var(--text-dim);
  font-size: 0.9rem;
}

.project-title-wrap { overflow: hidden; }
.project-title {
  font-family: var(--ff-display);
  font-weight: 600;
  font-size: clamp(1.4rem, 3vw, 2.2rem);
  transition: color .3s var(--ease), transform .4s var(--ease);
  display: inline-block;
}
.project-item:hover .project-title,
.project-item:focus-within .project-title { color: var(--accent); transform: translateX(0.3em); }

.project-tag {
  font-family: var(--ff-mono);
  font-size: 0.8rem;
  color: var(--text-dim);
  white-space: nowrap;
}

.project-arrow {
  width: 34px; height: 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .4s var(--ease), border-color .3s var(--ease), background .3s var(--ease);
}
.project-item:hover .project-arrow,
.project-item:focus-within .project-arrow {
  transform: rotate(45deg);
  border-color: var(--accent);
  background: var(--accent);
}
.project-arrow svg { width: 14px; height: 14px; }
.project-item:hover .project-arrow svg,
.project-item:focus-within .project-arrow svg { color: var(--bg); }

.project-visual {
  position: relative;
  max-height: 0;
  overflow: hidden;
  border-radius: 4px;
  background-size: cover;
  background-position: top center;
  transition: max-height .55s var(--ease), margin-top .55s var(--ease);
}
.project-item:hover .project-visual,
.project-item:focus-within .project-visual {
  max-height: 320px;
  margin-top: 1.4rem;
}
.project-visual.has-image::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0.1) 55%, rgba(0, 0, 0, 0.35));
}
.project-visual-view {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(0.85);
  z-index: 2;
  width: 74px; height: 74px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--ff-mono);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  opacity: 0;
  transition: opacity .35s var(--ease), transform .35s var(--ease);
}
.project-item:hover .project-visual-view,
.project-item:focus-within .project-visual-view {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}
.project-visual-inner {
  height: 320px;
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  padding: 1.5rem;
  overflow: hidden;
}
.project-visual-index {
  position: absolute;
  right: 1.2rem;
  bottom: -0.5rem;
  font-family: var(--ff-display);
  font-weight: 700;
  font-size: 8rem;
  line-height: 1;
  color: rgba(255, 255, 255, 0.14);
  pointer-events: none;
}
.project-visual.has-image .project-visual-index { color: rgba(255, 255, 255, 0.22); }
.project-visual-tag {
  position: relative;
  font-family: var(--ff-mono);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
}

@media (max-width: 860px), (hover: none) {
  .project-preview { display: none; }
}

/* ---------- Skills ---------- */
.skills {
  padding: 8rem 6vw;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 0.8fr 1.6fr;
  gap: 4vw;
}
.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2.5rem 3rem;
}
.skill-group h3 {
  font-family: var(--ff-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
}
.skill-group ul li {
  font-family: var(--ff-display);
  font-size: 1.15rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--line);
}

/* ---------- Contact ---------- */
.contact {
  padding: 8rem 6vw 6rem;
  border-top: 1px solid var(--line);
}
.contact h2 {
  font-family: var(--ff-display);
  font-weight: 600;
  font-size: clamp(2.2rem, 6vw, 4.4rem);
  max-width: 14ch;
  line-height: 1.05;
}
.contact-mail {
  display: inline-flex;
  align-items: baseline;
  gap: 0.5em;
  margin-top: 2rem;
  font-family: var(--ff-display);
  font-size: clamp(1.4rem, 3vw, 2rem);
  color: var(--accent);
  border-bottom: 1px solid var(--accent);
  padding-bottom: 0.2em;
}

.contact-grid {
  margin-top: 5rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5vw;
}

.contact-form { display: flex; flex-direction: column; gap: 1.6rem; }
.field { position: relative; }
.field input, .field textarea {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  font-family: var(--ff-body);
  font-size: 1rem;
  padding: 0.8rem 0;
  outline: none;
  transition: border-color .3s var(--ease);
  resize: none;
}
.field input:focus, .field textarea:focus { border-color: var(--accent); }
.field label {
  position: absolute;
  top: 0.8rem; left: 0;
  color: var(--text-dim);
  font-size: 1rem;
  pointer-events: none;
  transition: transform .25s var(--ease), font-size .25s var(--ease), color .25s var(--ease);
}
.field input:focus ~ label,
.field input:not(:placeholder-shown) ~ label,
.field textarea:focus ~ label,
.field textarea:not(:placeholder-shown) ~ label {
  transform: translateY(-1.4rem);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent);
}

.submit-btn {
  align-self: flex-start;
  margin-top: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.8em;
  font-family: var(--ff-mono);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 1em 1.8em;
  border: 1px solid var(--text);
  border-radius: 100px;
  transition: background .3s var(--ease), color .3s var(--ease), border-color .3s var(--ease);
}
.submit-btn:hover { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.submit-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.form-status {
  font-family: var(--ff-mono);
  font-size: 0.85rem;
  min-height: 1.2em;
}
.form-status.success { color: #6ee7a5; }
.form-status.error { color: #ff6b6b; }

.contact-info dl { display: flex; flex-direction: column; gap: 1.6rem; }
.contact-info dt {
  font-family: var(--ff-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 0.3rem;
}
.contact-info dd { font-size: 1.05rem; }
.contact-info a { border-bottom: 1px solid transparent; }
.contact-info a:hover { border-color: var(--text); }

.contact-socials {
  margin-top: 2.5rem;
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.contact-socials a {
  font-family: var(--ff-mono);
  font-size: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 100px;
  padding: 0.6em 1.2em;
  transition: border-color .3s var(--ease), color .3s var(--ease);
}
.contact-socials a:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Footer ---------- */
.site-footer {
  padding: 2rem 6vw;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}
.site-footer p {
  font-family: var(--ff-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
}
.back-to-top {
  font-family: var(--ff-mono);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  transition: color .3s var(--ease);
}
.back-to-top:hover { color: var(--accent); }

.footer-clock {
  display: flex;
  align-items: center;
  gap: 0.6em;
  font-family: var(--ff-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
}
.footer-clock-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #6ee7a5;
  box-shadow: 0 0 6px #6ee7a5;
}
.footer-clock-label { color: var(--text-dim); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .about { grid-template-columns: 1fr; }
  .about-visual { aspect-ratio: 16/9; }
  .skills { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; gap: 3rem; }
  .project-row { grid-template-columns: 2.2rem 1fr auto; }
  .project-tag { display: none; }
  .project-visual { display: none; }
  .hero-tagline { max-width: 18rem; }
}

@media (max-width: 560px) {
  .about { padding: 6rem 6vw; }
  .projects { padding: 5rem 6vw 6rem; }
  .skills { padding: 5rem 6vw; }
  .contact { padding: 5rem 6vw 4rem; }
  .about-meta { grid-template-columns: 1fr; }
  .skills-grid { grid-template-columns: 1fr; }

  .hero-top { gap: 1.5rem; }
  .hero-tagline { text-align: left; flex-direction: row; margin-left: 0; max-width: 100%; }
  .hero-tagline .eyebrow { justify-content: flex-start; }
  .hero-tagline .eyebrow::before { order: 0; }
  .hero-name-word {
    font-size: clamp(2.4rem, 12vw, 4rem);
  }
  .hero-name-track { animation-duration: 12s; }

  .header-right { gap: 0.9rem; }
  .logo-text { font-size: 0.85rem; }
  .lang-toggle { font-size: 0.68rem; padding: 0.4em 0.65em; }
  .lang-dropdown { right: 4vw; top: 68px; min-width: 160px; }
  .menu-toggle .label { display: none; }
}

@media (max-width: 420px) {
  .logo-text { display: none; }
}

/* ---------- RTL support (Arabic) ----------
   The page skeleton (header, grids, footer) stays left-to-right so the
   layout never breaks; only the actual text content flips to a right-to-left
   reading direction and right alignment within it. */
[dir="rtl"] .about-lead,
[dir="rtl"] .about-text h2,
[dir="rtl"] .about-meta dt,
[dir="rtl"] .about-meta dd,
[dir="rtl"] .skill-group h3,
[dir="rtl"] .skill-group ul,
[dir="rtl"] .project-tag,
[dir="rtl"] .contact h2,
[dir="rtl"] .contact-info dt,
[dir="rtl"] .contact-info dd,
[dir="rtl"] .form-status {
  direction: rtl;
  text-align: right;
}
[dir="rtl"] .contact-form label,
[dir="rtl"] .contact-form input,
[dir="rtl"] .contact-form textarea {
  direction: rtl;
  text-align: right;
}
[dir="rtl"] .field label { left: auto; right: 0; }
[dir="rtl"] .field input:focus ~ label,
[dir="rtl"] .field input:not(:placeholder-shown) ~ label,
[dir="rtl"] .field textarea:focus ~ label,
[dir="rtl"] .field textarea:not(:placeholder-shown) ~ label {
  transform: translateY(-1.4rem);
}
[dir="rtl"] .eyebrow { direction: rtl; }
[dir="rtl"] .eyebrow::before { order: 2; }
