/*
 * Mohamed Harir Portfolio
 * Professional. Clear. Memorable.
 */

:root {
    --bg: #fcfcfc;
    --surface: #ffffff;
    --text: #111;
    --text-2: #444;
    --text-3: #777;
    --accent: #1a56db;
    --accent-subtle: #eef3ff;
    --border: #e5e5e5;
    --green: #0d7c4a;
    --green-bg: #ecfdf5;
    --radius: 4px;
    --font: 'Inter', -apple-system, sans-serif;
    --font-display: 'Fraunces', Georgia, serif;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0a0a0a;
        --surface: #141414;
        --text: #f5f5f5;
        --text-2: #bbb;
        --text-3: #888;
        --accent: #6b9fff;
        --accent-subtle: #1a2744;
        --border: #262626;
        --green: #34d399;
        --green-bg: #0d2818;
    }
}

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

html, body { 
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.65;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

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

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Background animation */
.bg-animation {
  position: fixed;
  top: 0;
  left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    opacity: 0.08;
    pointer-events: none;
    overflow: hidden;
    margin: 0;
    padding: 0;
}

.bg-animation dotlottie-wc {
    display: block;
    width: 100vw;
    height: 100vh;
    margin: 0;
    padding: 0;
}

/* Content layers above background */
.header,
main,
.footer,
.loader {
    position: relative;
    z-index: 1;
}

/* Loader */
.loader {
  position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
    z-index: 9999 !important;
    animation: loader-fade-out 0.5s ease-out 2.5s forwards;
    pointer-events: none;
}

.loader.hidden {
    display: none;
}

.loader-shape {
    width: 200px;
    height: 200px;
    color: var(--accent);
    animation: loader-spin 2s ease-in-out infinite;
}

.loader-shape svg {
    width: 100%;
    height: 100%;
}

.loader-layer {
    opacity: 0;
    animation: loader-layer-in 0.4s ease-out forwards;
}

.l1 { animation-delay: 0s; }
.l2 { animation-delay: 0.1s; }
.l3 { animation-delay: 0.2s; }
.l4 { animation-delay: 0.3s; }
.l5 { animation-delay: 0.4s; }
.l6 { animation-delay: 0.5s; }

@keyframes loader-layer-in {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes loader-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes loader-fade-out {
    from { opacity: 1; }
    to { opacity: 0; visibility: hidden; }
}

h1, h2, h3 { font-family: var(--font-display); font-weight: 600; }

h2 {
    font-size: 1.1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-3);
    margin-bottom: 2rem;
}

h3 { font-size: 1.1rem; font-weight: 600; margin-bottom: 0.5rem; }

p { margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

ul { margin-left: 1.2rem; }
li { margin-bottom: 0.35rem; color: var(--text-2); }

strong { font-weight: 600; color: var(--text); }

/* Layout */
.header {
    position: sticky;
    top: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    z-index: 100;
}

.nav {
    max-width: 960px;
  margin: 0 auto;
    padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: var(--font-display);
  font-weight: 700;
    font-size: 1.1rem;
    color: var(--text);
    text-decoration: none;
}

.logo:hover {
    text-decoration: none;
}

.logo-icon {
    width: 32px;
    height: 32px;
    color: var(--accent);
}

.logo-text {
    color: var(--text);
}

.nav-links { display: flex; gap: 2rem; align-items: center; }

.nav-links a {
    font-size: 0.9rem;
    color: var(--text-2);
  text-decoration: none;
}
.nav-links a:hover { color: var(--text); }

.nav-cta {
    background: var(--text);
    color: var(--bg) !important;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    font-weight: 500;
}
.nav-cta:hover { opacity: 0.85; text-decoration: none !important; }

main {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Hero */
.hero {
  display: flex;
  align-items: center;
    gap: 4rem;
    padding: 5rem 0 3rem;
    min-height: 70vh;
}

.hero-shape {
    flex-shrink: 0;
    width: 320px;
    height: 320px;
    color: var(--text-3);
    opacity: 0.4;
  position: relative;
}

.hero-shape svg {
  width: 100%;
  height: 100%;
}

/* Pupil - the conscious eye */
.pupil-group {
    transition: transform 0.1s ease-out;
}

.pupil-core {
    animation: breathe 4s ease-in-out infinite;
}

.pupil-ring {
    animation: breathe 4s ease-in-out infinite 0.5s;
}

.iris-outer {
    animation: breathe-subtle 6s ease-in-out infinite;
}

@keyframes breathe {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(0.95); }
}

@keyframes breathe-subtle {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 0.4; }
}

.shape-layer {
    opacity: 0;
    animation: shape-fade-in 1.5s ease-out forwards;
}

.shape-1 { animation-delay: 0.1s; }
.shape-2 { animation-delay: 0.2s; }
.shape-3 { animation-delay: 0.3s; }
.shape-4 { animation-delay: 0.4s; }
.shape-5 { animation-delay: 0.5s; }
.shape-6 { animation-delay: 0.6s; }
.shape-7 { animation-delay: 0.7s; opacity: 0; }
.shape-8 { animation-delay: 0.8s; }

@keyframes shape-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes shape-rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Pulse effect on center circle */
.shape-7 {
    animation: shape-fade-in 1.5s ease-out 0.7s forwards, shape-pulse 3s ease-in-out 2s infinite;
}

@keyframes shape-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.hero-content {
  flex: 1;
}

.hero-role {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--accent);
  text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
    animation: pulse-glow 4s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.hero h1 {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.25;
    max-width: 720px;
    margin-bottom: 1.5rem;
}

.hero-context {
    font-size: 1.1rem;
    color: var(--text-2);
    max-width: 560px;
    line-height: 1.7;
}

.hero-location {
    margin-top: 2rem;
    font-size: 0.9rem;
    color: var(--text-3);
}

/* Numbers strip */
.numbers-strip {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    padding: 2rem 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.number-item { text-align: center; }

.number-item .num {
    display: block;
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1;
}

.number-item .label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-3);
    margin-top: 0.4rem;
    text-transform: lowercase;
}

/* Sections */
.section {
    padding: 4rem 0;
    border-bottom: 1px solid var(--border);
  position: relative;
}

.section-with-accent {
  position: relative;
}

.section-accent {
  position: absolute;
    top: 4rem;
  left: 0;
    width: 50px;
    height: 50px;
    color: var(--accent);
    opacity: 0.25;
    animation: accent-rotate 40s linear infinite;
    pointer-events: none;
}

.section-accent.accent-right {
    left: auto;
    right: 0;
    animation-direction: reverse;
}

@keyframes accent-rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.section-accent svg {
    width: 100%;
    height: 100%;
}

.section-desc {
    color: var(--text-2);
    margin-top: -1rem;
    margin-bottom: 2rem;
}

/* Philosophy section */
.philosophy-section {
    border-bottom: none;
    padding-bottom: 2rem;
}

.philosophy-content {
    max-width: 720px;
}

.philosophy-content p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-2);
    margin-bottom: 1.25rem;
}

.philosophy-content strong {
    color: var(--text);
}

.philosophy-closing {
    font-size: 1.15rem;
    color: var(--text);
    border-left: 3px solid var(--accent);
    padding-left: 1rem;
    margin-top: 1.5rem;
}

/* Two Modes section */
.modes-section {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 3rem;
    margin: 2rem 0;
}

.modes-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    margin-top: 2rem;
}

.mode-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
}

.mode-header {
  text-align: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.mode-icon {
  font-size: 2.5rem;
    display: block;
    margin-bottom: 0.75rem;
}

.mode-header h3 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
}

.mode-context {
    font-size: 0.85rem;
    color: var(--text-3);
    margin: 0;
}

.mode-evidence h4,
.mode-fit h4 {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-3);
    margin-bottom: 0.5rem;
}

.mode-evidence {
    margin-bottom: 1.5rem;
}

.mode-evidence ul {
    margin: 0;
    padding-left: 1.25rem;
}

.mode-evidence li {
    font-size: 0.9rem;
    color: var(--text-2);
    margin-bottom: 0.4rem;
}

.mode-fit p {
    font-size: 0.9rem;
    color: var(--text-2);
    margin: 0;
}

.mode-note {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
    font-size: 0.85rem;
    color: var(--accent);
    font-style: italic;
}

.modes-note {
    text-align: center;
    margin-top: 2rem;
  font-size: 1rem;
    color: var(--text);
    font-style: italic;
}

@media (max-width: 768px) {
    .modes-grid {
        grid-template-columns: 1fr;
    }
    
    .modes-section {
        padding: 1.5rem;
    }
}

/* Approach grid */
.approach-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.approach-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
}

.approach-full-width {
    grid-column: span 2;
}

@media (max-width: 768px) {
    .approach-grid {
        grid-template-columns: 1fr;
    }
    
    .approach-full-width {
        grid-column: span 1;
    }
}

.approach-item h3 {
    font-family: var(--font);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--accent);
}

.approach-item p {
    font-size: 0.9rem;
    color: var(--text-2);
    margin-bottom: 0.5rem;
}

.approach-item p strong {
    color: var(--text);
    font-weight: 500;
}

.approach-outcome {
    font-size: 0.85rem;
    color: var(--green);
    font-weight: 500;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}

/* Lessons section */
.lessons-section {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 3rem;
    margin: 2rem 0;
}

.lessons-grid {
  display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.lesson-item {
    padding: 1.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
}

.lesson-header {
    margin-bottom: 1rem;
}

.lesson-label {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent);
    background: var(--accent-subtle);
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    margin-bottom: 0.5rem;
}

.lesson-item h3 {
    font-family: var(--font);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    margin: 0;
}

.lesson-item p {
    font-size: 0.9rem;
    color: var(--text-2);
    margin-bottom: 0.75rem;
    line-height: 1.7;
}

.lesson-item p:last-child {
    margin-bottom: 0;
}

.lesson-item p strong {
    color: var(--text);
    font-weight: 500;
}

.lesson-outcome {
    font-size: 0.85rem;
    color: var(--green);
    font-weight: 500;
    margin-top: 0.5rem;
}

@media (max-width: 768px) {
    .lessons-grid {
        grid-template-columns: 1fr;
    }
    
    .lessons-section {
        padding: 1.5rem;
    }
}

/* Experience */
.exp-list {
  display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.exp-item {
    position: relative;
    padding-left: 1.25rem;
    border-left: 2px solid var(--border);
}

.exp-item.exp-current { border-left-color: var(--accent); }

.exp-header {
  display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.exp-title h3 {
    font-family: var(--font);
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 0.15rem;
}

.exp-company {
    font-size: 0.95rem;
    color: var(--text-2);
}

.exp-date {
    font-size: 0.85rem;
    color: var(--text-3);
    white-space: nowrap;
}

.exp-context {
    font-size: 0.9rem;
    color: var(--text-3);
    margin-bottom: 0.75rem;
    font-style: italic;
}

.exp-highlights {
    margin: 0;
    margin-top: 0.75rem;
}

.exp-highlights li {
    font-size: 0.95rem;
}

/* Projects */
.projects-list {
  display: flex;
    flex-direction: column;
    gap: 1rem;
}

.project {
  display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2rem;
    padding: 1.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    text-decoration: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

a.project:hover {
    border-color: var(--accent);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    text-decoration: none;
}

.project-private {
    opacity: 0.7;
}

.project-main { flex: 1; }

.project-main h3 {
    font-family: var(--font);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.project-main h3 .arrow {
    opacity: 0.4;
    margin-left: 0.25rem;
    transition: opacity 0.2s;
}

a.project:hover h3 .arrow { opacity: 1; }

.project-type {
    font-size: 0.85rem;
    color: var(--text-3);
    margin-bottom: 0.5rem;
}

.project-main p:last-of-type {
    font-size: 0.95rem;
    color: var(--text-2);
}

.project-meta {
  display: flex;
  flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
    flex-shrink: 0;
}

.project-stack {
    font-size: 0.75rem;
    color: var(--text-3);
}

.project-status {
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-3);
}

.project-status.live {
    background: var(--green-bg);
    border-color: transparent;
    color: var(--green);
}

/* Stack */
.stack-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
}

.stack-col h3 {
    font-family: var(--font);
    font-size: 0.85rem;
    font-weight: 600;
  text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-3);
    margin-bottom: 0.75rem;
}

.stack-col ul {
    list-style: none;
    margin: 0;
}

.stack-col li {
  font-size: 0.9rem;
    margin-bottom: 0.4rem;
    color: var(--text-2);
}

/* References */
.refs-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.ref {
    display: flex;
    flex-direction: column;
}

.ref-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.ref-role {
    font-size: 0.85rem;
    color: var(--text-3);
}

.ref-location {
    font-size: 0.8rem;
    color: var(--text-3);
    opacity: 0.8;
}

/* Contact */
.contact-section {
    border-bottom: none;
    padding-bottom: 5rem;
}

.contact-intro {
    font-size: 1.05rem;
    color: var(--text-2);
    max-width: 560px;
    margin-bottom: 2rem;
}

.contact-methods {
  display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.contact-primary {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text);
}
.contact-primary:hover { color: var(--accent); }

.contact-secondary {
  font-size: 1rem;
    color: var(--text-2);
}

.contact-links {
    display: flex;
    gap: 1.5rem;
}

.contact-links a {
    font-size: 0.9rem;
    color: var(--text-3);
}
.contact-links a:hover { color: var(--accent); }

/* Footer */
.footer {
  display: flex;
    justify-content: space-between;
    padding: 2rem 1.5rem;
    max-width: 960px;
    margin: 0 auto;
    font-size: 0.85rem;
    color: var(--text-3);
    border-top: 1px solid var(--border);
}

/* Responsive */
@media (max-width: 768px) {
    .section-accent {
        display: none;
    }
}

@media (max-width: 900px) {
  .hero {
    flex-direction: column;
        gap: 2rem;
        min-height: auto;
    }
    
    .hero-shape {
        width: 200px;
        height: 200px;
        opacity: 0.3;
  }
}

@media (max-width: 768px) {
    .nav-links { gap: 1rem; }
    
    .hero { padding: 3rem 0 2rem; }
    .hero h1 { font-size: 1.75rem; }
    .hero-context { font-size: 1rem; }
    
    .hero-shape {
        width: 150px;
        height: 150px;
    }
    
    .approach-grid {
    grid-template-columns: 1fr;
    }
    
    .numbers-strip {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    .number-item .num { font-size: 1.5rem; }
    
    .what-grid { grid-template-columns: 1fr; gap: 1.5rem; }
    
    .section { padding: 3rem 0; }
    
    .project {
    flex-direction: column;
        gap: 1rem;
    }
    .project-meta {
        flex-direction: row;
    align-items: center;
        width: 100%;
        justify-content: space-between;
  }
  
    .stack-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
  }
  
    .refs-grid {
    grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .footer {
    flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .nav { flex-direction: column; gap: 1rem; }
    .numbers-strip { grid-template-columns: 1fr 1fr; }
    .stack-grid { grid-template-columns: 1fr; }
}

/* Print */
@media print {
    .header { display: none; }
    .hero { padding: 1rem 0; }
    .section { padding: 2rem 0; page-break-inside: avoid; }
    .project { break-inside: avoid; }
}
