/* global */

/* fonts */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:ital,wght@0,100..700;1,100..700&family=Playfair+Display:ital,wght@0,400..900;1,400..900&display=swap');

/* root var */
:root {
    /* colour*/
    --color-bg: #FAF3EB;
    --color-bg-alt: #F2E9DE;
    --color-surface: #FFFFFF;
    --color-surface-glass: rgba(255, 255, 255, 0.7);
    --color-text: #1A1206;
    --color-text-secondary: #6B5D4F;
    --color-text-muted: #9A8C7E;
    --color-accent: #E76F51;
    --color-accent-hover: #D4573A;
    --color-accent-light: rgba(231, 111, 81, 0.1);
    --color-border: rgba(30, 18, 6, 0.08);
    --color-border-strong: rgba(30, 18, 6, 0.15);
    --color-success: #2e7d32;
    --color-error: #c62828;

    /* type */
    --font-heading: 'Playfair Display', Georgia, 'Times New Roman', serif;
    --font-body: 'IBM Plex Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    /* space */
    --space-2xs: 0.125rem;
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;
    --space-4xl: 6rem;

    /* radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 18px;
    --radius-xl: 32px;
    --radius-full: 9999px;

    /* shadow */
    --shadow-xs: 0 1px 2px rgba(30, 18, 6, 0.04);
    --shadow-sm: 0 4px 12px rgba(30, 18, 6, 0.06);
    --shadow-md: 0 12px 32px rgba(30, 18, 6, 0.08);
    --shadow-lg: 0 20px 48px rgba(30, 18, 6, 0.12);
    --shadow-xl: 0 32px 80px rgba(30, 18, 6, 0.16);

    /* transition */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
    --duration-fast: 200ms;
    --duration-normal: 350ms;
    --duration-slow: 600ms;

    /* layout */
    --nav-height: 72px;
    --max-width: 1200px;
    --content-padding: 2rem;
}

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--color-text);
    background-color: var(--color-bg);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    position: relative;
}

body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.04;
    pointer-events: none;
    z-index: 9999;
}

#scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: var(--color-accent);
    z-index: 2000;
    transition: width 0.1s ease;
}

img,
svg {
    display: block;
    max-width: 100%;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--duration-fast) var(--ease-out), opacity var(--duration-fast) var(--ease-out);
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
    color: inherit;
    transition: all var(--duration-fast) var(--ease-out);
}

ul,
ol {
    list-style: none;
}

/* type */
h1,
h2,
h3,
h4 {
    font-family: var(--font-heading);
    font-weight: 600;
    line-height: 1.2;
    color: var(--color-text);
}

h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    letter-spacing: -0.5px;
}

h2 {
    font-size: clamp(2rem, 4vw, 3rem);
    letter-spacing: -0.3px;
}

h3 {
    font-size: clamp(1.25rem, 2.5vw, 1.75rem);
}

h4 {
    font-size: 1.125rem;
}

p {
    line-height: 1.75;
    color: var(--color-text-secondary);
}

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

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

/* navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--content-padding);
    z-index: 1000;
    transition: background-color var(--duration-normal) var(--ease-out),
        box-shadow var(--duration-normal) var(--ease-out),
        backdrop-filter var(--duration-normal) var(--ease-out);
}

.navbar.transparent {
    background-color: transparent;
}

.navbar.solid,
.navbar.transparent.is-open {
    background-color: rgba(250, 243, 235, 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    box-shadow: 0 1px 0 var(--color-border), 0 4px 12px rgba(30, 18, 6, 0.03);
}

.nav-logo {
    height: 36px;
    width: auto;
    transition: opacity var(--duration-fast) ease;
}

.nav-logo:hover {
    opacity: 0.7;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.nav-link {
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    padding: 0.4rem 0.9rem;
    border-radius: var(--radius-full);
    transition: color var(--duration-fast) ease,
        background-color var(--duration-fast) ease;
    letter-spacing: 0.2px;
}

.nav-link:hover {
    background-color: var(--color-accent-light);
}

.nav-link.active {
    color: var(--color-accent);
    background-color: var(--color-accent-light);
}

/* hamburger menu */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 28px;
    height: 28px;
    padding: 2px;
}

.nav-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background-color: var(--color-text);
    border-radius: 1px;
    transition: transform var(--duration-normal) var(--ease-out),
        opacity var(--duration-fast) ease;
}

.nav-toggle.open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.nav-toggle.open span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* menu overlay */
.nav-mobile {
    display: none;
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(250, 243, 235, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 999;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-lg);
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity var(--duration-normal) var(--ease-out),
        transform var(--duration-normal) var(--ease-out);
    pointer-events: none;
}

.nav-mobile.open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.nav-mobile .nav-link {
    font-size: 1.5rem;
    padding: 0.8rem 2rem;
}

@media (max-width: 640px) {
    .nav-links {
        display: none;
    }

    .nav-toggle {
        display: flex;
    }

    .nav-mobile {
        display: flex;
    }
}

/* =footer */
.footer {
    background-color: var(--color-bg-alt);
    padding: var(--space-3xl) var(--content-padding) var(--space-xl);
    position: relative;
}

.footer::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--color-border-strong), transparent);
}

.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xl);
}

.footer-heading {
    font-family: var(--font-heading);
    font-size: 1.75rem;
}

.footer-links {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
}

.footer-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 0.95rem;
    color: var(--color-text-secondary);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-sm);
    transition: color var(--duration-fast) ease,
        background-color var(--duration-fast) ease,
        transform var(--duration-fast) ease;
}

.footer-link:hover {
    color: var(--color-accent);
    background-color: var(--color-accent-light);
    transform: translateY(-2px);
}

.footer-copy {
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

/* buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0.75rem 1.75rem;
    border-radius: var(--radius-md);
    transition: all var(--duration-normal) var(--ease-out);
    letter-spacing: 0.3px;
    white-space: nowrap;
}

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

.btn-primary:hover {
    background-color: #2c1e12;
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.btn-primary:active {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background-color: var(--color-surface-glass);
    color: var(--color-text);
    border: 1px solid var(--color-border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.btn-secondary:hover {
    background-color: var(--color-surface);
    border-color: var(--color-accent);
    color: var(--color-accent);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.btn-accent {
    background-color: var(--color-accent);
    color: #fff;
    box-shadow: 0 4px 12px rgba(231, 111, 81, 0.2);
}

.btn-accent:hover {
    background-color: var(--color-accent-hover);
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(231, 111, 81, 0.35);
}

.btn-accent:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(231, 111, 81, 0.2);
}

.btn-lg {
    padding: 1.1rem 2.8rem;
    font-size: 1.1rem;
    border-radius: var(--radius-lg);
}

/* utils */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--content-padding);
}

/* section divider accent */
.section-divider {
    width: 48px;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--color-accent), transparent);
    border-radius: 2px;
    margin: 0 auto var(--space-xl);
}

/* animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.fade-in-up {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}

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

/* delays */
.stagger>*:nth-child(1) {
    transition-delay: 0ms;
}

.stagger>*:nth-child(2) {
    transition-delay: 80ms;
}

.stagger>*:nth-child(3) {
    transition-delay: 160ms;
}

.stagger>*:nth-child(4) {
    transition-delay: 240ms;
}

/* form */
.form-section {
    padding: var(--space-3xl) var(--content-padding) var(--space-4xl);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.form-section h2 {
    margin-bottom: var(--space-xs);
}

.form-subtitle {
    text-align: center;
    color: var(--color-text-muted);
    font-size: 0.95rem;
    margin-bottom: var(--space-xl);
}

.form-card {
    width: 100%;
    max-width: 560px;
    background: var(--color-surface-glass);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    padding: var(--space-xl); /* Reduced from 2xl */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
}

.form-group {
    margin-bottom: var(--space-lg);
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    margin-bottom: 6px;
    letter-spacing: 0.2px;
}

.form-input.invalid,
.form-select.invalid {
    border-bottom-color: var(--color-error);
    background-color: rgba(198, 40, 40, 0.02);
}

.form-input {
    width: 100%;
    height: 44px;
    padding: 0 var(--space-sm);
    border: none;
    border-bottom: 1.5px solid var(--color-border-strong);
    background: transparent;
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--color-text);
    outline: none;
    transition: border-color var(--duration-normal) ease;
}

.form-input:focus {
    border-bottom-color: var(--color-accent);
}

.form-input::placeholder {
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

.form-select {
    width: 100%;
    height: 44px;
    padding: 0 var(--space-sm);
    border: none;
    border-bottom: 1.5px solid var(--color-border-strong);
    background: transparent;
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--color-text);
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='8' viewBox='0 0 14 8' fill='none' stroke='%239A8C7E' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M1 1l6 6 6-6'/></svg>");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 14px;
    transition: border-color var(--duration-normal) ease;
}

.form-select:focus {
    border-bottom-color: var(--color-accent);
}

.form-submit {
    width: 100%;
    height: 52px;
    margin-top: var(--space-lg); /* Space between last input and button */
    background-color: var(--color-text);
    color: var(--color-bg);
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: all var(--duration-normal) ease;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.form-submit:hover {
    background-color: #3a2a1a;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.form-submit.loading {
    color: transparent;
    pointer-events: none;
}

.form-submit.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 22px;
    height: 22px;
    margin: -11px 0 0 -11px;
    border: 2.5px solid rgba(250, 243, 235, 0.2);
    border-top-color: var(--color-bg);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.form-submit.success {
    background-color: var(--color-success) !important;
    color: transparent !important;
}

.form-submit.error {
    background-color: var(--color-error) !important;
    color: transparent !important;
}

.form-submit.success::after,
.form-submit.error::after {
    display: none; /* Hide old after elements */
}

.draw-svg {
    width: 28px;
    height: 28px;
    fill: none;
    stroke: white;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.tick-path {
    stroke-dasharray: 24;
    stroke-dashoffset: 24;
    animation: drawLine 0.6s var(--ease-out) forwards;
}

.x-path {
    stroke-dasharray: 20;
    stroke-dashoffset: 20;
    animation: drawLine 0.4s var(--ease-out) forwards;
}

@keyframes drawLine {
    to {
        stroke-dashoffset: 0;
    }
}

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

.form-status {
    text-align: center;
    font-size: 0.9rem;
    opacity: 0;
    max-height: 0;
    margin-top: 0;
    transform: translateY(10px);
    transition: all var(--duration-normal) var(--ease-out);
    pointer-events: none;
    overflow: hidden;
}

.form-status.show {
    opacity: 1;
    max-height: 100px; /* Allow expansion */
    margin-top: var(--space-lg);
    transform: translateY(0);
}

.form-status.success {
    color: var(--color-success);
}

.form-status.error {
    color: var(--color-error);
}

@media (max-width: 480px) {
    .form-card {
        padding: var(--space-xl) var(--space-lg);
    }
}