/* ══════════════════════════════════════════════
   Roman — Personal Website
   Design System & Styles
   ══════════════════════════════════════════════ */

/* ─── Custom Properties ─── */
:root {
    --bg: #FAF7F2;
    --bg-card: #FFFFFF;
    --text-primary: #1A1A1A;
    --text-secondary: #6B6560;
    --text-tertiary: #9B9590;
    --accent: #C8963E;
    --accent-hover: #A87A2F;
    --accent-light: rgba(200, 150, 62, 0.1);
    --border: rgba(26, 26, 26, 0.06);
    --font-heading: 'Playfair Display', Georgia, 'Times New Roman', serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --radius: 12px;
    --radius-lg: 20px;
    --transition: 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --transition-slow: 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --max-width: 1080px;
}

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg);
    color: var(--text-primary);
    line-height: 1.7;
    font-weight: 400;
    overflow-x: hidden;
    cursor: none;
}

/* ─── Grain Overlay ─── */
.grain-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.35;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.5'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 200px 200px;
}

/* ─── Custom Cursor ─── */
.cursor-dot {
    width: 8px;
    height: 8px;
    background-color: var(--accent);
    border-radius: 50%;
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 10001;
    transform: translate(-50%, -50%);
    transition: width 0.2s, height 0.2s, background-color 0.2s;
}

.cursor-ring {
    width: 36px;
    height: 36px;
    border: 1.5px solid var(--accent);
    border-radius: 50%;
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 10000;
    transform: translate(-50%, -50%);
    transition: width 0.25s, height 0.25s, border-color 0.25s, opacity 0.25s;
    opacity: 0.5;
}

.cursor-dot.hovering {
    width: 12px;
    height: 12px;
    background-color: var(--accent-hover);
}

.cursor-ring.hovering {
    width: 50px;
    height: 50px;
    border-color: var(--accent-hover);
    opacity: 0.3;
}

/* ─── Container ─── */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 40px;
}

/* ─── Sections ─── */
.section {
    padding: 120px 0;
}

.section-label {
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 40px;
}

.section-content {
    max-width: 640px;
}

/* ─── Reveal Animation ─── */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
        transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* stagger children */
.reveal:nth-child(2) {
    transition-delay: 0.08s;
}

.reveal:nth-child(3) {
    transition-delay: 0.16s;
}

.reveal:nth-child(4) {
    transition-delay: 0.24s;
}

.reveal:nth-child(5) {
    transition-delay: 0.32s;
}

.reveal:nth-child(6) {
    transition-delay: 0.40s;
}

/* ══════════════════════════════════════════════
   HERO
   ══════════════════════════════════════════════ */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 0;
    position: relative;
}

.hero-lastname {
    font-family: var(--font-body);
    font-size: clamp(16px, 2.5vw, 22px);
    font-weight: 300;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 12px;
    animation: heroFadeIn 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

.hero-name {
    font-family: var(--font-heading);
    font-size: clamp(56px, 11vw, 130px);
    font-weight: 400;
    letter-spacing: -0.02em;
    line-height: 1;
    color: var(--text-primary);
    margin-bottom: 24px;
    animation: heroFadeIn 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.15s both;
}

.hero-tagline {
    font-family: var(--font-body);
    font-size: clamp(14px, 2vw, 18px);
    font-weight: 300;
    letter-spacing: 0.12em;
    color: var(--text-secondary);
    text-transform: uppercase;
    animation: heroFadeIn 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.3s both;
}

@keyframes heroFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

/* ══════════════════════════════════════════════
   ABOUT / HOW I WORK
   ══════════════════════════════════════════════ */
.about-text {
    font-size: 18px;
    line-height: 1.8;
    color: var(--text-secondary);
    font-weight: 300;
}

.about-row {
    display: flex;
    align-items: center;
    gap: 48px;
}

.about-photo {
    flex-shrink: 0;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--border);
    transition: border-color var(--transition);
}

.about-photo:hover {
    border-color: var(--accent);
}

.about-photo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.about-content {
    flex: 1;
}

/* ══════════════════════════════════════════════
   SERVICES GRID
   ══════════════════════════════════════════════ */
.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 16px;
}

.service-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 36px 32px;
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.service-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(26, 26, 26, 0.06);
    border-color: rgba(200, 150, 62, 0.2);
}

.service-title {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.service-desc {
    font-size: 14px;
    color: var(--text-tertiary);
    font-weight: 300;
    line-height: 1.6;
}

/* ══════════════════════════════════════════════
   CONTACT
   ══════════════════════════════════════════════ */
.section-contact {
    padding-bottom: 80px;
}

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

.contact-heading {
    font-family: var(--font-heading);
    font-size: clamp(32px, 5vw, 48px);
    font-weight: 400;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.contact-sub {
    font-size: 16px;
    color: var(--text-secondary);
    font-weight: 300;
    margin-bottom: 36px;
}

.cta-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--text-primary);
    color: var(--bg);
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 500;
    padding: 16px 36px;
    border-radius: 999px;
    border: none;
    cursor: none;
    transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
    letter-spacing: 0.02em;
}

.cta-button:hover {
    background: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(200, 150, 62, 0.25);
}

.cta-button svg {
    transition: transform var(--transition);
}

.cta-button:hover svg {
    transform: translateX(4px);
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-top: 48px;
}

.social-link {
    color: var(--text-tertiary);
    transition: color var(--transition), transform var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--border);
    text-decoration: none;
}

.social-link:hover {
    color: var(--accent);
    border-color: rgba(200, 150, 62, 0.3);
    transform: translateY(-2px);
}

/* ══════════════════════════════════════════════
   MODAL
   ══════════════════════════════════════════════ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(26, 26, 26, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 10002;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal {
    background: var(--bg);
    border-radius: var(--radius-lg);
    padding: 48px 40px;
    max-width: 500px;
    width: 100%;
    position: relative;
    transform: translateY(20px) scale(0.97);
    transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.12);
    max-height: 90vh;
    overflow-y: auto;
}

.modal-overlay.active .modal {
    transform: translateY(0) scale(1);
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: none;
    padding: 4px;
    transition: color var(--transition), transform var(--transition);
    border-radius: 50%;
}

.modal-close:hover {
    color: var(--text-primary);
    transform: rotate(90deg);
}

.modal-title {
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 500;
    margin-bottom: 32px;
    color: var(--text-primary);
}

/* ─── Form ─── */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    font-family: var(--font-body);
    font-size: 15px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
    color: var(--text-primary);
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
    cursor: none;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-tertiary);
    font-weight: 300;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.form-group select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%236B6560' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-submit {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--text-primary);
    color: var(--bg);
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 500;
    padding: 16px;
    border-radius: 999px;
    border: none;
    cursor: none;
    transition: background var(--transition), transform var(--transition);
    margin-top: 8px;
}

.form-submit:hover {
    background: var(--accent);
    transform: translateY(-1px);
}

.form-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.form-status {
    text-align: center;
    font-size: 14px;
    margin-top: 16px;
    min-height: 20px;
    font-weight: 400;
}

.form-status.success {
    color: #4CAF50;
}

.form-status.error {
    color: #E53935;
}

/* ══════════════════════════════════════════════
   FOOTER
   ══════════════════════════════════════════════ */
.footer {
    padding: 32px 0;
    text-align: center;
    font-size: 13px;
    color: var(--text-tertiary);
    font-weight: 300;
    letter-spacing: 0.02em;
}

/* ══════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════ */
@media (max-width: 768px) {
    .container {
        padding: 0 24px;
    }

    .section {
        padding: 80px 0;
    }

    .services-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }

    .service-card {
        padding: 28px 24px;
    }

    .about-text {
        font-size: 16px;
    }

    .about-row {
        flex-direction: column;
        gap: 32px;
        text-align: center;
    }

    .about-photo {
        width: 130px;
        height: 130px;
    }

    .modal {
        padding: 36px 28px;
    }

    /* Hide custom cursor on touch devices */
    .cursor-dot,
    .cursor-ring {
        display: none;
    }

    body {
        cursor: auto;
    }

    .cta-button,
    .modal-close,
    .form-group input,
    .form-group select,
    .form-group textarea,
    .form-submit,
    .social-link {
        cursor: pointer;
    }
}

@media (max-width: 480px) {
    .services-grid {
        grid-template-columns: 1fr;
    }

    .section {
        padding: 64px 0;
    }

    .hero-name {
        font-size: 46px;
    }

    .hero-lastname {
        font-size: 14px;
        letter-spacing: 0.2em;
    }

    .about-photo-img {
        width: 120px;
        height: 120px;
    }

    .contact-heading {
        font-size: 28px;
    }

    .cta-button {
        padding: 14px 28px;
        font-size: 14px;
    }

    .modal {
        padding: 28px 20px;
        border-radius: var(--radius);
    }
}

/* ─── Reduced motion ─── */
@media (prefers-reduced-motion: reduce) {
    .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .hero-name,
    .hero-tagline {
        animation: none;
    }

    html {
        scroll-behavior: auto;
    }
}