/* ============================================================
   Cyrine Akrout — portfolio
   Layout inspired by classic split-landing developer portfolios,
   restyled with a dark indigo palette.
   ============================================================ */
:root {
  --bg: #1d1a21;
  --bg-alt: #25202a;
  --card: #2f2836;
  --card-2: #3a2f4283;
  --primary: #c9b8f0;
  --primary-2: #5b4a86;
  --accent: #c9b8f0;
  --mint: #74e0c1;
  --text: #f1f0f7;
  --muted: #b7b5c9;
  --dim: #7d7a92;
  --radius: 18px;
  --font: "Poppins", system-ui, -apple-system, sans-serif;
  --script: "Great Vibes", cursive;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.6; overflow-x: hidden; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
svg { display: block; }
::selection { background: var(--primary); color: #1d1a21; }

/* ============ NAVBAR + DRAWER ============ */
.navbar {
  position: fixed; inset: 0 0 auto 0; z-index: 40;
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 40px; transition: background .3s, padding .3s, box-shadow .3s;
}
.navbar.scrolled { background: rgba(29, 28, 38, .9); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); padding: 10px 40px; box-shadow: 0 4px 20px rgba(0,0,0,.25); }
.signature { font-family: var(--script); font-size: 2.4rem; line-height: 1; color: #fff; }
.menu-btn { width: 44px; height: 44px; border: 0; background: transparent; cursor: pointer; display: grid; place-content: center; gap: 6px; }
.menu-btn span { display: block; width: 26px; height: 2.5px; border-radius: 2px; background: #fff; transition: width .3s; }
.menu-btn span:nth-child(2) { width: 20px; margin-left: auto; }
.menu-btn:hover span { width: 26px; }

.drawer {
  position: fixed; top: 0; right: 0; height: 100%; width: min(320px, 85vw); z-index: 60;
  background: var(--bg-alt); border-left: 1px solid rgba(255,255,255,.06);
  padding: 80px 28px 28px; transform: translateX(100%); transition: transform .4s cubic-bezier(.7,0,.2,1);
}
.drawer.open { transform: none; }
.drawer-close { position: absolute; top: 18px; right: 22px; font-size: 2.2rem; line-height: 1; background: none; border: 0; color: var(--muted); cursor: pointer; transition: color .2s, transform .3s; }
.drawer-close:hover { color: #fff; transform: rotate(90deg); }
.drawer nav { display: grid; gap: 6px; }
.drawer nav a { display: flex; align-items: center; gap: 16px; padding: 12px 18px; border-radius: 999px; color: var(--muted); font-weight: 500; transition: background .25s, color .25s, padding .25s; }
.drawer nav a svg { width: 20px; height: 20px; fill: currentColor; }
.drawer nav a:hover { background: var(--primary); color: #1d1a21; padding-left: 24px; }
.backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(10, 9, 16, .55); opacity: 0; pointer-events: none; transition: opacity .3s; }
.backdrop.show { opacity: 1; pointer-events: auto; }

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-width: 150px; padding: 12px 26px; border-radius: 999px; font: 600 .95rem var(--font);
  cursor: pointer; transition: background .25s, color .25s, border-color .25s, transform .25s;
}
.btn:hover { transform: translateY(-2px); }
.btn-outline { border: 2px solid var(--primary); color: #fff; background: transparent; }
.btn-outline:hover { background: var(--primary); color: #1d1a21; }
.btn-solid { border: 2px solid #f1f0f7; background: #f1f0f7; color: #1d1a21; }
.btn-solid:hover { background: transparent; color: #f1f0f7; }

/* ============ LANDING ============ */
.landing { position: relative; min-height: 100vh; min-height: 100svh; display: flex; }
.landing-left {
  flex: 0 0 35%; position: relative;
  background: linear-gradient(160deg, #34323f 0%, #2a2834 60%, #23222d 100%);
  overflow: hidden;
}
.landing-left::before { /* soft dotted texture */
  content: ""; position: absolute; inset: 0; opacity: .18;
  background-image: radial-gradient(#fff 1.2px, transparent 1.2px); background-size: 22px 22px;
}
.landing-socials { position: absolute; bottom: 40px; left: 40px; display: flex; gap: 20px; }
.landing-socials a { width: 28px; height: 28px; color: #fff; transition: transform .25s, opacity .25s; }
.landing-socials a:hover { transform: translateY(-3px); opacity: .8; }
.landing-socials svg { width: 100%; height: 100%; fill: currentColor; }
.landing-right { flex: 1; display: flex; align-items: center; padding: 120px 8% 80px 22%; }
.landing-avatar {
  position: absolute; left: 35%; top: 50%; transform: translate(-50%, -50%);
  width: clamp(240px, 26vw, 380px); aspect-ratio: 1; border-radius: 50%;
  box-shadow: 0 0 0 10px var(--bg), 0 30px 60px rgba(0,0,0,.4); z-index: 2;
}
.landing-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; background: #fff; }
.landing-content { max-width: 520px; }
.landing-content h6 { font-size: 1.05rem; font-weight: 600; color: var(--accent); margin-bottom: 4px; }
.landing-content h1 { font-size: clamp(2.6rem, 5vw, 4.4rem); font-weight: 800; line-height: 1.08; margin-bottom: 20px; letter-spacing: -0.01em; }
.landing-content p { color: var(--muted); font-size: 1.02rem; margin-bottom: 36px; }
.landing-buttons { display: flex; flex-wrap: wrap; gap: 18px; }
.landing-buttons .btn-solid { background: #f1f0f7; border-color: #f1f0f7; color: #1d1a21; }
.landing-buttons .btn-solid:hover { background: transparent; color: #f1f0f7; }

/* ============ SECTIONS ============ */
.section { padding: 100px 8%; }
.section h2, .section-title { font-size: clamp(2rem, 3.6vw, 3rem); font-weight: 800; line-height: 1.15; }
.section-title { margin-bottom: 50px; }

/* about */
.line-styling { display: flex; align-items: center; gap: 8px; margin-bottom: 60px; }
.style-circle { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); }
.style-line { flex: 1; height: 3px; border-radius: 3px; background: linear-gradient(90deg, var(--primary), transparent); margin-left: 8px; }
.about-body { display: grid; grid-template-columns: 1.1fr .9fr; gap: 60px; align-items: center; }
.about-description h2 { margin-bottom: 28px; }
.about-description p { color: var(--muted); margin-bottom: 16px; font-size: 1rem; }
.about-description .lead { color: var(--text); font-size: 1.12rem; font-weight: 500; }
.hl { color: var(--accent); font-weight: 600; }
.langs { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.langs span { padding: 7px 16px; border-radius: 999px; background: var(--card); font-size: .88rem; font-weight: 500; }
.about-img img { width: 100%; max-width: 440px; margin: 0 auto; }

/* hobbies */
.hobbies { max-width: 1200px; margin: 0 auto; }
.hobbies-title { font-size: clamp(1.4rem, 2.4vw, 1.9rem); font-weight: 700; margin-bottom: 26px; }
.hobby-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 18px; }
.hobby { padding: 22px; border-radius: var(--radius); background: var(--card); border: 1px solid rgba(201,184,240,.12); transition: transform .3s, border-color .3s; }
.hobby:hover { transform: translateY(-4px); border-color: rgba(201,184,240,.45); }
.hobby h4 { font-size: 1.05rem; font-weight: 700; margin: 10px 0 4px; }
.hobby p { color: var(--muted); font-size: .9rem; }
.hobby-emoji { font-size: 1.9rem; line-height: 1; }
.hobby-feature { display: flex; gap: 20px; align-items: center; background: linear-gradient(135deg, var(--primary-2), #7a68b0 60%, #a493d6 140%); border: 0; }
.hobby-feature h4 { margin-top: 0; font-size: 1.25rem; color: #fff; }
.hobby-feature p { color: rgba(255,255,255,.88); }
.mic { width: 110px; height: 110px; flex-shrink: 0; animation: sway 3s ease-in-out infinite; transform-origin: 50% 90%; }
@keyframes sway { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }

/* highlight (experience) */
.highlight {
  display: grid; grid-template-columns: 260px 1fr; gap: 36px; align-items: center;
  margin-bottom: 60px; padding: 26px; border-radius: 24px;
  background: linear-gradient(135deg, rgba(91,74,134,.38), rgba(122,104,176,.18) 55%, rgba(201,184,240,.10));
  border: 1px solid rgba(201,184,240,.35);
}
.highlight-photo { margin: 0; }
.highlight-photo img { width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 16px; box-shadow: 0 14px 30px rgba(0,0,0,.35); }
.highlight-photo figcaption { margin-top: 10px; font-size: .82rem; color: var(--muted); text-align: center; }
.highlight-tag { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; background: rgba(201,184,240,.16); color: var(--accent); font-size: .8rem; font-weight: 600; }
.highlight-tag svg { width: 16px; height: 16px; fill: currentColor; }
.highlight h3 { font-size: clamp(1.3rem, 2.4vw, 1.75rem); font-weight: 800; line-height: 1.25; margin: 14px 0 4px; }
.highlight h5 { font-size: .95rem; font-weight: 600; color: var(--mint); margin-bottom: 14px; }
.highlight p { color: var(--muted); margin-bottom: 12px; }
.highlight p:last-child { margin-bottom: 0; }

/* education / experience */
.split { display: grid; grid-template-columns: 1.2fr .8fr; gap: 60px; align-items: center; }
.split-rev { grid-template-columns: .8fr 1.2fr; }
.split-img img { width: 100%; max-width: 400px; margin: 0 auto; }
.cards { display: grid; gap: 22px; }
.info-card {
  display: flex; gap: 20px; align-items: flex-start; padding: 22px 26px; border-radius: var(--radius);
  background: var(--card); border: 1px solid rgba(201,184,240,.12);
  transition: transform .3s, background .3s, border-color .3s;
}
.info-card:hover { transform: translateY(-4px); background: #3e2f45; border-color: rgba(201,184,240,.45); }
.info-icon { flex-shrink: 0; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: rgba(201,184,240,.2); color: var(--primary); }
.info-icon svg { width: 24px; height: 24px; fill: currentColor; }
.info-card h6 { font-size: .85rem; font-weight: 600; color: var(--mint); }
.info-card h4 { font-size: 1.12rem; font-weight: 700; margin: 2px 0 2px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.info-card h5 { font-size: .92rem; font-weight: 500; color: var(--muted); }
.info-card p { font-size: .9rem; color: var(--dim); margin-top: 8px; }
.info-card p a { color: var(--accent); font-weight: 600; white-space: nowrap; }
.chip { font-size: .72rem; font-weight: 600; padding: 2px 10px; border-radius: 999px; background: rgba(116,224,193,.15); color: var(--mint); }

/* skills — marquee */
.skills { padding: 100px 0; background: var(--bg-alt); text-align: center; }
.skills .section-title { padding: 0 8%; }
.marquee { overflow: hidden; padding: 10px 0 30px; -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.marquee-track { display: flex; gap: 24px; width: max-content; animation: scroll 40s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes scroll { to { transform: translateX(calc(-50% - 12px)); } }
.skill {
  width: 170px; height: 70px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; gap: 14px;
  padding: 0 20px; border-radius: 12px; background: var(--card); border: 1px solid rgba(255,255,255,.05);
  box-shadow: 0 8px 20px rgba(0,0,0,.25); transition: transform .3s, background .3s;
}
.skill:hover { transform: translateY(-5px); background: #3a3150; }
.skill img { width: 34px; height: 34px; object-fit: contain; background: #fff; border-radius: 8px; padding: 4px; }
.skill span { font-weight: 600; font-size: .95rem; white-space: nowrap; }
.methods { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; padding: 10px 8% 0; }
.methods span { padding: 8px 16px; border-radius: 999px; border: 1px solid rgba(201,184,240,.4); color: var(--muted); font-size: .88rem; }

/* projects */
.projects { padding: 100px 8%; background: var(--bg-alt); }
.projects .section-title { text-align: center; }
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 32px; max-width: 1200px; margin: 0 auto; }
.project {
  position: relative; height: 340px; border-radius: var(--radius); overflow: hidden; outline: none;
  background: var(--bg); box-shadow: 0 10px 30px rgba(0,0,0,.3); cursor: default;
}
.project-content {
  position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; align-items: center;
  padding: 22px 20px 18px; border-radius: var(--radius);
  background: var(--bg); /* each card sets its own --bg colour inline */
  transition: transform .5s cubic-bezier(.7,0,.2,1);
}
.project h3 { text-align: center; font-size: 1.2rem; font-weight: 700; color: #fff; line-height: 1.3; min-height: 2.6em; display: flex; align-items: center; }
.project img { width: 92%; flex: 1; min-height: 0; object-fit: contain; margin: 10px 0; transition: transform .4s; }
.project-btns { width: 100%; display: flex; justify-content: flex-end; align-items: center; gap: 10px; }
.btn-report {
  margin-right: auto; display: inline-flex; align-items: center; gap: 7px; height: 42px; padding: 0 16px 0 12px;
  border-radius: 999px; border: 2px solid #fff; color: #fff; font-size: .85rem; font-weight: 600;
  transition: background .25s, color .25s, transform .25s;
}
.btn-report svg { width: 18px; height: 18px; fill: currentColor; }
.btn-report:hover { background: #fff; color: var(--bg); transform: translateY(-2px); }
.project-btns .btn-code { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; border: 2px solid #fff; color: #fff; transition: background .25s, color .25s, transform .25s; }
.project-btns .btn-code:hover { background: #fff; color: var(--bg); transform: scale(1.08); }
.project-btns svg { width: 18px; height: 18px; fill: currentColor; }
.badge-intern { font-size: .78rem; font-weight: 600; padding: 6px 12px; border-radius: 999px; background: rgba(255,255,255,.18); color: #fff; }
.project-desc {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; height: 50%;
  display: flex; align-items: center; padding: 18px 22px; font-size: .9rem; color: var(--text);
  background: #17141b; border-radius: 0 0 var(--radius) var(--radius);
}
.project:hover .project-content, .project:focus-within .project-content, .project:focus .project-content { transform: translateY(-50%); }
.project:hover img { transform: scale(1.05); }
.project-group { max-width: 1200px; margin: 0 auto 70px; }
.project-group:last-of-type { margin-bottom: 0; }
.group-title { display: flex; align-items: center; gap: 14px; font-size: clamp(1.3rem, 2.2vw, 1.7rem); font-weight: 700; margin-bottom: 28px; }
.group-title::after { content: ""; flex: 1; height: 2px; border-radius: 2px; background: linear-gradient(90deg, rgba(201,184,240,.6), transparent); }
.group-icon { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: rgba(201,184,240,.2); color: var(--primary); flex-shrink: 0; }
#finance .group-icon { background: rgba(116,224,193,.15); color: var(--mint); }
#finance .group-title::after { background: linear-gradient(90deg, rgba(116,224,193,.55), transparent); }
.group-icon svg { width: 24px; height: 24px; }
.more { display: flex; justify-content: center; margin-top: 50px; }

/* contact */
.contact { padding: 100px 8% 80px; }
.contact-body { display: grid; grid-template-columns: 1.2fr .8fr; gap: 60px; align-items: start; max-width: 1100px; }
.contact-form { display: grid; gap: 26px; }
.field { position: relative; }
.field input, .field textarea {
  width: 100%; padding: 20px 18px 10px; border-radius: 12px; border: 2px solid var(--card); outline: none;
  background: var(--bg-alt); color: var(--text); font: 500 1rem var(--font); resize: vertical; transition: border-color .25s;
}
.field label { position: absolute; left: 18px; top: 16px; color: var(--dim); font-weight: 500; pointer-events: none; transition: all .2s; }
.field input:focus, .field textarea:focus { border-color: var(--primary); }
.field input:focus + label, .field input:not(:placeholder-shown) + label,
.field textarea:focus + label, .field textarea:not(:placeholder-shown) + label { top: 4px; font-size: .74rem; color: var(--primary); }
.field .invalid { border-color: #ff6b81; }
.hp { position: absolute; left: -9999px; width: 0; height: 0; opacity: 0; }
.form-foot { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.form-status { font-size: .92rem; font-weight: 500; flex: 1; }
.form-status.ok { color: var(--mint); }
.form-status.err { color: #ff8a9b; }
.btn-send svg { width: 18px; height: 18px; }
.btn-send[disabled] { opacity: .6; cursor: wait; transform: none; }
.contact-side p { color: var(--muted); margin-bottom: 28px; }
.contact-icons { display: flex; gap: 16px; }
.contact-link { display: inline-flex; }
.ci { flex-shrink: 0; width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; background: var(--primary); color: #1d1a21; transition: transform .25s; }
.contact-link:hover .ci { transform: rotate(-8deg) scale(1.06); }
.ci svg { width: 22px; height: 22px; fill: currentColor; }

/* footer */
.footer { padding: 26px; text-align: center; background: var(--bg-alt); color: var(--muted); font-size: .95rem; }
.heart { color: var(--accent); display: inline-block; animation: beat 1.4s infinite; }
@keyframes beat { 0%, 100% { transform: scale(1); } 15% { transform: scale(1.25); } 30% { transform: scale(1); } }

/* back to top */
.back-to-top {
  position: fixed; right: 24px; bottom: 24px; z-index: 30; width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; background: var(--primary); color: #1d1a21; box-shadow: 0 8px 20px rgba(0,0,0,.35);
  opacity: 0; transform: translateY(20px); pointer-events: none; transition: opacity .3s, transform .3s;
}
.back-to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.back-to-top svg { width: 20px; height: 20px; }

/* reveal */
.reveal { opacity: 0; transform: translateY(30px); transition: opacity .8s ease, transform .8s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ============ RESPONSIVE ============ */
@media (max-width: 1000px) {
  .hobby-grid { grid-template-columns: 1fr 1fr 1fr; }
  .hobby-feature { grid-column: 1 / -1; }
  .about-body, .split, .split-rev, .contact-body { grid-template-columns: 1fr; }
  .split-rev .split-img { order: 2; }
  .split-img img, .about-img img { max-width: 320px; }
}
@media (max-width: 800px) {
  .highlight { grid-template-columns: 1fr; padding: 20px; gap: 20px; }
  .highlight-photo { max-width: 280px; margin: 0 auto; }
  .hobby-grid { grid-template-columns: 1fr 1fr; }
  .hobby-feature { grid-column: 1 / -1; flex-direction: column; text-align: center; }
  .navbar, .navbar.scrolled { padding: 12px 20px; }
  .landing { flex-direction: column; }
  .landing-left { flex: 0 0 auto; height: 38vh; min-height: 260px; }
  .landing-avatar { left: 50%; top: 38vh; width: 200px; }
  .landing-right { padding: 130px 24px 70px; text-align: center; justify-content: center; }
  .landing-buttons { justify-content: center; }
  .landing-socials { left: 20px; bottom: 20px; gap: 14px; }
  .landing-socials a { width: 24px; height: 24px; }
  .section, .projects, .contact { padding-left: 24px; padding-right: 24px; }
  .section { padding-top: 80px; padding-bottom: 80px; }
  .info-card { padding: 18px; gap: 14px; }
  .info-icon { width: 44px; height: 44px; }
  .project-grid { gap: 24px; }
}
@media (max-width: 800px) and (min-height: 0) {
  .landing-avatar { top: max(38vh, 260px); }
}
/* touch devices: show description under the image instead of on hover */
@media (hover: none) {
  .project { height: auto; }
  .project-content { position: relative; transform: none !important; }
  .project img { height: 180px; flex: none; }
  .project-desc { position: relative; height: auto; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}
