/* ============================================================
   Abdelkhalek Mammeri — Personal Portfolio
   Minimal · Black & White · Blue accent
   ============================================================ */

/* --- Self-hosted Acme font (100% offline, no external fonts) --- */
@font-face {
  font-family: 'Acme';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('Acme.woff2') format('woff2');
}

:root {
  --bg:            #ffffff;
  --ink:           #16181d;
  --body:          #3d4148;
  --muted:         #8a8f98;
  --line:          #e8eaee;
  --sidebar-bg:    #0c0c0e;
  --sidebar-ink:   #f5f5f7;
  --sidebar-muted: #83838b;
  --accent:        #2563eb;
  --accent-dark:   #1c4fc9;
  --font-display:  'Acme', 'Segoe UI', Arial, sans-serif;
  --font-body:     -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
                   'Helvetica Neue', Arial, sans-serif;
  --sidebar-w:     272px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}

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

a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  padding: 3.4rem 2.5rem 2.6rem;
  z-index: 10;
}

/* --- Brand --- */
.brand { text-decoration: none; display: block; }

.brand-name {
  font-family: var(--font-display);
  font-size: 1.62rem;
  letter-spacing: .13em;
  line-height: 1.3;
  color: var(--sidebar-ink);
}
.brand-name span { display: block; }

.brand-role {
  margin-top: 1rem;
  font-size: .66rem;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--sidebar-muted);
}
.brand-sub {
  margin-top: .4rem;
  font-size: .66rem;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: #54555c;
}

/* --- Navigation --- */
.nav {
  margin-top: 3.8rem;
  display: flex;
  flex-direction: column;
}
.nav a {
  display: block;
  padding: .68rem 0;
  font-family: var(--font-display);
  font-size: .84rem;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--sidebar-muted);
  text-decoration: none;
  transition: color .2s ease;
}
.nav a:hover  { color: var(--sidebar-ink); }
.nav a.active { color: var(--sidebar-ink); }
.nav a.active::before {
  content: "";
  display: inline-block;
  width: 6px; height: 6px;
  margin-right: .75rem;
  border-radius: 50%;
  background: var(--accent);
  vertical-align: 2px;
}

/* --- Social icons --- */
.social {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 1.2rem;
}
.social a {
  color: var(--sidebar-muted);
  display: inline-flex;
  transition: color .2s ease, transform .2s ease;
}
.social a:hover {
  color: var(--accent);
  transform: translateY(-2px);
}
.social svg { width: 19px; height: 19px; }

/* Mobile-only social row (hidden on desktop) */
.social--mobile { display: none; }
.social--mobile a { color: #52575e; }
.social--mobile a:hover { color: var(--accent); }

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 5.4rem 5.5rem 2.8rem;
}

.page { max-width: 720px; width: 100%; }

.page-title {
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 4vw, 2.85rem);
  letter-spacing: .05em;
  font-weight: 400;
}
.page-title .dot { color: var(--accent); }

.title-rule {
  width: 46px; height: 3px;
  background: var(--accent);
  border-radius: 2px;
  margin: 1.5rem 0 2.8rem;
}

/* --- About --- */
.about-body {
  display: flex;
  align-items: flex-start;
  gap: 2.4rem;
}

.photo {
  flex: 0 0 auto;
  width: 112px; height: 112px;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 0 0 1px var(--line), 0 8px 24px rgba(13, 15, 20, .08);
}
.photo img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  filter: grayscale(1) contrast(1.02);
  transition: filter .4s ease;
}
.photo:hover img { filter: grayscale(0); }

.intro { max-width: 560px; }
.intro p {
  font-size: 1.02rem;
  line-height: 1.82;
  color: var(--body);
  margin-bottom: 1.15rem;
}
.intro strong { color: var(--ink); font-weight: 600; }

.tags {
  margin-top: 2.4rem;
  font-size: .74rem;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--muted);
}
.tags span { color: var(--accent); }

/* --- CV page --- */
.cv-text {
  font-size: 1.02rem;
  line-height: 1.82;
  color: var(--body);
  max-width: 480px;
}

.cv-actions {
  margin-top: 2.6rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  padding: 1rem 2.1rem;
  border-radius: 6px;
  font-family: var(--font-display);
  font-size: .8rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background .2s ease, color .2s ease,
              border-color .2s ease, transform .2s ease;
}
.btn svg { width: 15px; height: 15px; }

.btn--primary {
  background: var(--accent);
  color: #fff;
}
.btn--primary:hover {
  background: var(--accent-dark);
  transform: translateY(-2px);
}

.btn--ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid #d4d7dd;
}
.btn--ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

/* --- Footer --- */
.site-footer {
  margin-top: auto;
  padding-top: 4rem;
  font-size: .78rem;
  letter-spacing: .05em;
  color: #a4a9b1;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1100px) {
  .main { padding: 4.5rem 3.5rem 2.5rem; }
}

@media (max-width: 900px) {
  /* Sidebar becomes a clean top header */
  .sidebar {
    position: static;
    width: auto;
    min-height: 0;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    row-gap: .9rem;
    padding: 1.3rem 1.4rem;
  }
  .brand-name { font-size: 1.06rem; letter-spacing: .12em; }
  .brand-name span { display: inline; }
  .brand-name .b2::before { content: "\00a0"; }
  .brand-role, .brand-sub { display: none; }

  .nav { margin-top: 0; flex-direction: row; gap: 1.5rem; }
  .nav a { padding: .3rem 0; font-size: .74rem; letter-spacing: .2em; }
  .nav a.active::before { display: none; }
  .nav a.active {
    color: var(--sidebar-ink);
    box-shadow: inset 0 -2px 0 var(--accent);
  }

  .sidebar .social { display: none; }

  .main { margin-left: 0; padding: 3.4rem 1.5rem 1.8rem; }
  .page { max-width: 640px; }

  /* Show social icons above the footer on mobile */
  .social--mobile {
    display: flex;
    gap: 1.5rem;
    margin-top: auto;
    padding: 3.5rem 0 1.5rem;
  }
  .social--mobile svg { width: 20px; height: 20px; }

  .site-footer { margin-top: 0; padding-top: 0; }
}

@media (max-width: 560px) {
  .about-body { flex-direction: column; gap: 1.8rem; }
  .photo { width: 96px; height: 96px; }
  .title-rule { margin: 1.2rem 0 2.2rem; }
  .cv-actions .btn { width: 100%; justify-content: center; }
}
