/* ==========================================================================
   FernanVibeCoding — styles.css
   Palette: Nyon Castle (Hackert, 18th c.) — near-black base, dusty sky-blue
   accent, sandy beige secondary accent
   ========================================================================== */

:root {
    /* Colours — derived from "Nyon von Südwesten" (Carl Ludwig Hackert) */
    --bg:           #1E1F1D;   /* near-black warm — base */
    --surface:      #28251F;   /* card / panel surfaces */
    --surface-2:    #322E26;   /* slightly lighter surface */
    --border:       rgba(196, 169, 125, 0.12);   /* warm beige border */
    --border-hover: rgba(143, 175, 194, 0.5);    /* sky blue hover */

    --accent:       #8FAFC2;   /* dusty sky blue */
    --accent-hover: #A6C2D2;
    --accent-dim:   rgba(143, 175, 194, 0.12);

    --accent-2:     #C4A97D;   /* sandy beige — secondary accent */

    --text:         #EDE8DF;   /* warm off-white */
    --muted:        #8A8275;   /* warm muted */

    /* Type */
    --font-sans:    'DM Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-mono:    'Space Mono', 'Courier New', monospace;

    /* Spacing */
    --spacing-xs:   0.5rem;
    --spacing-sm:   1rem;
    --spacing-md:   2rem;
    --spacing-lg:   4rem;
    --spacing-xl:   7rem;
    --container-max: 1100px;

    /* Motion */
    --t-fast:  150ms ease;
    --t-base:  220ms ease;
    --t-slow:  350ms ease;
}

/* ==========================================================================
   Reset & Base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    scroll-behavior: smooth;
    scroll-padding-top: 4.5rem;
    font-size: 16px;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.65;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
    font-family: var(--font-mono);
    line-height: 1.15;
    color: var(--text);
}

p { color: var(--text); }

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--t-fast);
}

img { max-width: 100%; display: block; height: auto; }
ul  { list-style: none; }

.visually-hidden {
    position: absolute; width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0,0,0,0); border: 0;
}

.text-center { text-align: center; }
.accent      { color: var(--accent); }

.mono {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

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

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

/* ==========================================================================
   Layout
   ========================================================================== */
.container {
    width: 90%;
    max-width: var(--container-max);
    margin: 0 auto;
}

.container-sm { max-width: 720px; }

.section { padding: var(--spacing-xl) 0; position: relative; }

/* Gradient divider between sections — softer than a hard border */
.section + .section::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--border-hover), transparent);
}

/* Section background alternation — gives scroll-through a sense of rhythm */
.about      { background: var(--bg); }
.work       { background: var(--surface); }
.testimonial{ background: var(--surface-2); }
.contact    { background: var(--bg); }

.section-title {
    font-size: clamp(2.2rem, 5vw, 3.2rem);
    letter-spacing: -0.02em;
    margin-bottom: var(--spacing-sm);
    font-weight: 700;
}

.section-subtitle {
    font-size: 1.125rem;
    color: var(--muted);
    max-width: 560px;
    margin-bottom: var(--spacing-lg);
}

.section-header { margin-bottom: var(--spacing-lg); }

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 1.75rem;
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    letter-spacing: 0.06em;
    font-weight: 700;
    border-radius: 4px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background var(--t-base), color var(--t-base),
                border-color var(--t-base), transform var(--t-fast);
    text-transform: uppercase;
}

.btn-primary {
    background: var(--accent);
    color: var(--bg);
    border-color: var(--accent);
}

.btn-primary:hover, .btn-primary:focus-visible {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    transform: translateY(-2px);
}

.btn-secondary {
    background: transparent;
    color: var(--accent);
    border-color: var(--accent);
}

.btn-secondary:hover, .btn-secondary:focus-visible {
    background: var(--accent);
    color: var(--bg);
    transform: translateY(-2px);
}

.btn-block { width: 100%; }

/* ==========================================================================
   Header
   ========================================================================== */
.header {
    position: fixed;
    top: 0; left: 0;
    width: 100%;
    z-index: 1000;
    padding: 1.5rem 0;
    transition: padding var(--t-base), background var(--t-base), border-color var(--t-base);
    border-bottom: 1px solid transparent;
}

.header.scrolled {
    padding: 1rem 0;
    background: rgba(30,31,29,0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom-color: var(--border);
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--text);
    z-index: 1001;
}

.logo span { color: var(--accent); }

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

.nav-link {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
    padding-bottom: 2px;
    border-bottom: 1px solid transparent;
    transition: color var(--t-fast), border-color var(--t-fast);
}

.nav-link:hover, .nav-link.active {
    color: var(--text);
    border-bottom-color: var(--text);
}

.cta-link {
    color: var(--accent);
    border: 1px solid rgba(143,175,194,0.35);
    border-radius: 4px;
    padding: 0.4rem 0.875rem;
}

.cta-link:hover, .cta-link.active {
    background: var(--accent);
    color: var(--bg);
    border-color: var(--accent);
}

/* Hamburger */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    z-index: 1001;
    background: none;
    border: none;
    padding: 4px;
}

.hamburger span {
    display: block;
    width: 22px;
    height: 1.5px;
    background: var(--text);
    transition: var(--t-base);
}

@media (max-width: 768px) {
    .hamburger { display: flex; }

    .nav-links {
        position: fixed;
        top: 0; right: -100%;
        width: 100%; height: 100vh;
        background: var(--bg);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 2.5rem;
        transition: right var(--t-slow);
        z-index: 1000;
    }

    .nav-links.active { right: 0; }

    .nav-link { font-size: 1rem; }

    .hamburger.active span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
    .hamburger.active span:nth-child(2) { opacity: 0; }
    .hamburger.active span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }
}

/* ==========================================================================
   Hero — Nyon Castle painting background
   ========================================================================== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 6rem;
    padding-bottom: 4rem;
    overflow: hidden;
    position: relative;

    background-image:
        linear-gradient(to bottom, rgba(20,18,15,0.55) 0%, rgba(20,18,15,0.72) 100%),
        url('assets/nyon-hero.png');
    background-size: cover;
    background-position: center 20%;
    background-repeat: no-repeat;
}

/* Bottom fade — lets the hero bleed into the next section */
.hero::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 18vh;
    background: linear-gradient(to bottom, transparent 0%, var(--bg) 100%);
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 700px;
}

.hero-eyebrow {
    color: var(--muted);
    margin-bottom: 1.5rem;
    display: block;
}

.hero-title {
    font-size: clamp(2.8rem, 7vw, 5.5rem);
    letter-spacing: -0.03em;
    margin-bottom: 1.5rem;
    line-height: 1.05;
}

.hero-subtitle {
    font-size: clamp(1.05rem, 2.5vw, 1.3rem);
    color: var(--muted);
    margin-bottom: 2.5rem;
    max-width: 560px;
    font-family: var(--font-sans);
}

.hero-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* ==========================================================================
   About
   ========================================================================== */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.lead-text {
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 1.25rem;
    font-family: var(--font-sans);
}

.about-text p {
    color: var(--muted);
    margin-bottom: 1.25rem;
    font-family: var(--font-sans);
}

.about-stats {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.875rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    transition: border-color var(--t-base);
}

.stat-item:hover { border-color: var(--border-hover); }

.stat-icon { font-size: 1.2rem; }

.stat-text {
    font-family: var(--font-sans);
    color: var(--muted);
    font-size: 0.9375rem;
}

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

/* Code panel */
.code-panel {
    background: #0A0906;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 0 60px rgba(143, 175, 194, 0.06);
}

.code-panel-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.dot {
    width: 10px; height: 10px;
    border-radius: 50%;
}

.dot-r { background: #FF5F57; }
.dot-y { background: #FFBD2E; }
.dot-g { background: #28C840; }

.code-panel-label {
    margin-left: auto;
    color: var(--muted);
}

.code-snippet {
    padding: 1.75rem;
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    line-height: 1.7;
    color: var(--text);
}

.code-keyword  { color: #f43f5e; }
.code-variable { color: var(--accent); }
.code-operator { color: #38bdf8; }
.code-string   { color: #34d399; }
.code-function { color: #a78bfa; }

@media (max-width: 900px) {
    .about-grid { grid-template-columns: 1fr; gap: 2.5rem; }
}

/* ==========================================================================
   Work
   ========================================================================== */
.work-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.75rem;
}

.project-card {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-top: 2px solid transparent;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    transition: border-color var(--t-base), transform var(--t-base), box-shadow var(--t-base);
    overflow: hidden;
}

.project-card:hover {
    border-color: var(--border-hover);
    border-top-color: var(--accent);
    transform: translateY(-4px);
    box-shadow: 0 16px 40px rgba(0,0,0,0.4);
}

.project-image {
    width: 100%;
    height: 200px;
    background: var(--surface-2);
    background-size: cover;
    background-position: top center;
    transition: transform var(--t-slow);
}

.project-card:hover .project-image { transform: scale(1.03); }

/* Screenshot placeholders — replace with real images in assets/ */
.project-img-1 { background-image: url('assets/le-jardin-dore.jpg'); }
.project-img-2 { background-image: url('assets/fishermens-pub-hero.jpg'); }
.project-img-3 { background-image: url('assets/saas_landing_mockup_1774274272405.png'); }

.project-info {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.project-title {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.project-desc {
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 1.25rem;
    flex-grow: 1;
    font-family: var(--font-sans);
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin-bottom: 1.25rem;
}

.project-tags span {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.25rem 0.625rem;
    background: var(--accent-dim);
    color: var(--accent);
    border-radius: 3px;
    border: 1px solid rgba(143,175,194,0.15);
}

.project-links {
    display: flex;
    gap: 1.25rem;
}

.project-link {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--muted);
    transition: color var(--t-fast);
}

.project-link:hover { color: var(--accent); }

/* ==========================================================================
   Testimonial
   ========================================================================== */
.testimonial-quote {
    border-left: 3px solid var(--accent-2);
    padding-left: 2rem;
}

.testimonial-quote p {
    font-family: var(--font-sans);
    font-size: clamp(1.1rem, 2.5vw, 1.4rem);
    font-style: italic;
    color: var(--text);
    line-height: 1.55;
    margin-bottom: 1.25rem;
}

.testimonial-source {
    color: var(--muted);
    display: block;
}

/* ==========================================================================
   Clients
   ========================================================================== */
.clients { padding: 3rem 0; }

.clients-label {
    color: var(--muted);
    margin-bottom: 2rem;
    display: block;
}

.clients-grid {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4rem;
    flex-wrap: wrap;
}

.client-logo {
    height: 60px;
    width: auto;
    opacity: 0.6;
    filter: grayscale(100%);
    transition: opacity 200ms ease, filter 200ms ease;
}

.client-logo:hover {
    opacity: 1;
    filter: grayscale(0%);
}

/* ==========================================================================
   Parallax band — Martigny, Switzerland
   ========================================================================== */
.parallax-band {
    position: relative;
    width: 100%;
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: url('assets/martigny-parallax.jpg') center / cover no-repeat;
    background-attachment: fixed;
}

.parallax-band::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(30, 31, 29, 0.5);
}

.parallax-band-content {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 0 var(--spacing-md);
    color: var(--text);
}

.parallax-eyebrow {
    color: var(--accent);
    margin-bottom: var(--spacing-sm);
    display: block;
}

.parallax-line {
    font-family: var(--font-sans);
    font-size: clamp(1.75rem, 5vw, 3.5rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.15;
}

@media (max-width: 768px) {
    .parallax-band {
        background-attachment: scroll;
        min-height: 50vh;
    }
}

@media (prefers-reduced-motion: reduce) {
    .parallax-band {
        background-attachment: scroll;
    }
}

/* ==========================================================================
   Contact
   ========================================================================== */
.contact-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 3rem 2.5rem;
}

.contact-desc {
    color: var(--muted);
    font-family: var(--font-sans);
    font-size: 1.05rem;
    margin-bottom: 0.75rem;
}

.contact-guarantee {
    color: var(--accent-2);
    font-family: var(--font-sans);
    font-weight: 600;
    margin-bottom: 2.5rem;
    font-size: 0.9375rem;
}

.contact-form {
    max-width: 480px;
    margin: 0 auto;
    text-align: left;
}

.form-group { margin-bottom: 1.25rem; }

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 1rem;
    transition: border-color var(--t-fast), background var(--t-fast);
}

.contact-form input::placeholder,
.contact-form textarea::placeholder { color: var(--muted); }

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(143,175,194,0.04);
}

.contact-form textarea { resize: vertical; }

.form-message {
    margin-top: 1rem;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 600;
}

.form-message.success { color: #4ade80; }
.form-message.error   { color: #f87171; }

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
    border-top: 1px solid var(--border);
    padding: 3rem 0;
}

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

.footer-brand p {
    color: var(--muted);
    font-family: var(--font-sans);
    font-size: 0.875rem;
    margin-top: 0.75rem;
    line-height: 1.6;
}

.footer-socials { display: flex; gap: 2rem; }

.social-link {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
    transition: color var(--t-fast);
}

.social-link:hover { color: var(--accent); }

.footer-bottom {
    text-align: center;
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

/* ==========================================================================
   Animations — fade-in scroll reveal + hero entrance
   ========================================================================== */
.fade-in {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.55s ease-out, transform 0.55s ease-out;
}

.fade-in.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.fade-in-up {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.7s ease-out forwards;
}

@keyframes fadeInUp {
    to { opacity: 1; transform: translateY(0); }
}

.delay-1 { animation-delay: 0.15s; transition-delay: 0.1s; }
.delay-2 { animation-delay: 0.3s;  transition-delay: 0.2s; }
.delay-3 { animation-delay: 0.45s; transition-delay: 0.3s; }

/* Reduced motion — disable everything */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }

    .fade-in,
    .fade-in-up {
        opacity: 1;
        transform: none;
        transition: none;
        animation: none;
    }

    * {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}
