/* ========================================
   Phaneron Robotics — Clean Editorial v4
   ======================================== */

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

:root, [data-theme="dark"] {
    --bg:      #1c1c1e;
    --surface: #242426;
    --border:  #2e2e30;
    --fg:      #e0e0e0;
    --fg2:     #999999;
    --fg3:     #555555;
    --accent:  #3b9ece;
    --accent-hover: #4fb3e3;
    --nav-bg:  rgba(28,28,30,0.9);
    --input-bg: #161616;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

[data-theme="light"] {
    --bg:      #fafafa;
    --surface: #ffffff;
    --border:  #e4e4e4;
    --fg:      #1a1a1a;
    --fg2:     #666666;
    --fg3:     #aaaaaa;
    --accent:  #1a7fad;
    --accent-hover: #1590c7;
    --nav-bg:  rgba(250,250,250,0.9);
    --input-bg: #f0f0f0;
}

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--fg);
    -webkit-font-smoothing: antialiased;
    transition: background 0.35s, color 0.35s;
}

a { color: inherit; text-decoration: none; }

/* ---- NAV ---- */
.nav {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 860px;
    margin: 0 auto;
    padding: 20px 28px;
    background: var(--nav-bg);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: -0.01em;
}

.nav-mark { color: var(--accent); }

.nav-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.nav-link {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--fg2);
    transition: color 0.2s;
}
.nav-link:hover { color: var(--accent); }

.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: transparent;
    color: var(--fg2);
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); }

[data-theme="dark"]  .icon-sun  { display: block; }
[data-theme="dark"]  .icon-moon { display: none;  }
[data-theme="light"] .icon-sun  { display: none;  }
[data-theme="light"] .icon-moon { display: block; }

/* ---- LAYOUT ---- */
.hero, .pillars, .contact, .footer {
    max-width: 860px;
    margin: 0 auto;
    padding-left: 28px;
    padding-right: 28px;
}

/* ---- HERO ---- */
.hero {
    padding-top: 120px;
    padding-bottom: 80px;
}

.pill {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
    border: 1px solid var(--border);
    border-radius: 100px;
    padding: 4px 14px;
    margin-bottom: 28px;
}

.hero h1 {
    font-size: clamp(2.4rem, 6vw, 3.8rem);
    font-weight: 800;
    letter-spacing: -0.035em;
    line-height: 1.1;
    margin-bottom: 20px;
}

.hero-lead {
    font-size: 1.15rem;
    color: var(--fg2);
    margin-bottom: 16px;
}

.hero-body {
    font-size: 0.95rem;
    color: var(--fg3);
    line-height: 1.7;
    max-width: 480px;
    margin-bottom: 32px;
}

.cta {
    display: inline-block;
    font-family: var(--font);
    font-size: 0.85rem;
    font-weight: 500;
    color: #fff;
    background: var(--accent);
    padding: 10px 24px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
}
.cta:hover { background: var(--accent-hover); }

/* ---- DIVIDER ---- */
.divider {
    max-width: 860px;
    margin: 0 auto;
    height: 1px;
    background: var(--border);
    margin-left: 28px;
    margin-right: 28px;
}

/* ---- PILLARS ---- */
.pillars {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    padding-top: 64px;
    padding-bottom: 64px;
}

.pillar-num {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--accent);
    letter-spacing: 0.08em;
    margin-bottom: 12px;
}

.pillar h3 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 8px;
    letter-spacing: -0.01em;
}

.pillar p {
    font-size: 0.85rem;
    color: var(--fg2);
    line-height: 1.65;
}

/* ---- CONTACT ---- */
.contact {
    padding-top: 64px;
    padding-bottom: 100px;
}

.contact-header {
    margin-bottom: 36px;
}

.contact-header h2 {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
}

.contact-header p {
    font-size: 0.9rem;
    color: var(--fg2);
    line-height: 1.65;
    max-width: 460px;
}

/* ---- FORM ---- */
.form { max-width: 560px; }

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.form label {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form label span {
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--fg2);
}

.form label span small {
    text-transform: none;
    letter-spacing: 0;
    color: var(--fg3);
    font-weight: 400;
}

.form input,
.form select,
.form textarea {
    font-family: var(--font);
    font-size: 0.88rem;
    padding: 10px 12px;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--fg);
    outline: none;
    transition: border-color 0.2s, background 0.35s;
    width: 100%;
}

.form input:focus,
.form select:focus,
.form textarea:focus {
    border-color: var(--accent);
}

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

.form select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23999' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

.form select option {
    background: var(--surface);
    color: var(--fg);
}

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

.form .full { margin-bottom: 20px; }

.cta-submit { width: 100%; text-align: center; padding: 12px; }

.form-status {
    text-align: center;
    font-size: 0.85rem;
    margin-top: 12px;
    font-weight: 500;
}
.form-status.success { color: var(--accent); }
.form-status.error { color: #d35; }

/* ---- FOOTER ---- */
.footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 20px;
    padding-bottom: 20px;
    border-top: 1px solid var(--border);
    font-size: 0.72rem;
    color: var(--fg3);
}
.footer a { transition: color 0.2s; }
.footer a:hover { color: var(--accent); }

/* ---- ANIMATIONS ---- */
@media (prefers-reduced-motion: no-preference) {
    .hero   { animation: up 0.7s ease both; }
    .pillars { animation: up 0.6s ease 0.15s both; }
    .contact { animation: up 0.6s ease 0.25s both; }
}
@keyframes up {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ---- RESPONSIVE ---- */
@media (max-width: 640px) {
    .hero { padding-top: 80px; padding-bottom: 56px; }
    .pillars { grid-template-columns: 1fr; gap: 28px; }
    .form-row { grid-template-columns: 1fr; }
    .footer { flex-direction: column; gap: 6px; text-align: center; }
}
