/* 
  Intraface Brand Identity 
  Paper-like, warm, distinctive.
  Based on Cardinal design system.
*/

@import url('https://fonts.googleapis.com/css2?family=Inika:wght@400;700&family=Inter:wght@400;500;600&display=swap');

:root {
    /* Brand Colors */
    --bg-primary: #FFFBF3;
    --bg-secondary: #FDF8ED;
    --text-primary: #000000;
    --text-secondary: #22211F;
    --text-tertiary: #808080;

    --brand-coral: #FF7052;
    --brand-orange: #F37618;
    --brand-burnt: #E65C10;

    --surface-card: rgba(207, 198, 172, 0.3);
    --border-primary: #000000;

    /* Typography */
    --font-serif: 'Inika', serif;
    --font-sans: 'Inika', serif;

    /* Spacing */
    --container-width: 900px;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 4rem;
    --spacing-xl: 8rem;
    --spacing-text: 1.5rem;

    /* Effects */
    --shadow-hard: 0px 4px 0px 0px rgba(0, 0, 0, 1);
    --shadow-card: 0px 4px 20px rgba(0, 0, 0, 0.05);
    --radius-button: 12px;
    --radius-card: 24px;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg-primary: #22211F;
        --bg-secondary: #2C2A28;
        --text-primary: #FFFFFF;
        --text-secondary: #FFFBF3;
        --text-tertiary: #A0A0A0;
        --border-primary: #FFFFFF;
        --surface-card: rgba(255, 251, 243, 0.1);
        --shadow-hard: 0px 4px 0px 0px rgba(255, 255, 255, 0.8);
    }
}

/* Forced dark mode */
:root[data-theme="dark"] {
    --bg-primary: #22211F;
    --bg-secondary: #2C2A28;
    --text-primary: #FFFFFF;
    --text-secondary: #FFFBF3;
    --text-tertiary: #A0A0A0;
    --border-primary: #FFFFFF;
    --surface-card: rgba(255, 251, 243, 0.1);
    --shadow-hard: 0px 4px 0px 0px rgba(255, 255, 255, 0.8);
}

/* Forced light mode */
:root[data-theme="light"] {
    --bg-primary: #FFFBF3;
    --bg-secondary: #FDF8ED;
    --text-primary: #000000;
    --text-secondary: #22211F;
    --text-tertiary: #808080;
    --border-primary: #000000;
    --surface-card: rgba(207, 198, 172, 0.3);
    --shadow-hard: 0px 4px 0px 0px rgba(0, 0, 0, 1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.6;
    font-size: 18px;
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Typography */
h1,
h2,
h3,
h4 {
    font-family: var(--font-serif);
    font-weight: 700;
    line-height: 1.1;
}

h1 {
    font-size: clamp(2.5rem, 6vw, 4rem);
}

h2 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    margin-bottom: var(--spacing-md);
}

h3 {
    font-size: clamp(1.25rem, 3vw, 1.5rem);
    margin-bottom: var(--spacing-sm);
}

p {
    color: var(--text-secondary);
    max-width: 60ch;
}

a {
    color: var(--brand-coral);
    text-decoration: none;
    transition: opacity 0.2s ease;
}

a:hover {
    opacity: 0.8;
}

/* Layout Utilities */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 var(--spacing-md);
    width: 100%;
}

.section {
    padding: var(--spacing-lg) 0;
}

main {
    flex: 1;
}

/* Navigation */
.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem var(--spacing-md);
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: var(--nav-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: padding 0.3s ease, background-color 0.3s ease;
    border-bottom: 1px solid var(--nav-border);
    /* Full width with centered content */
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding-left: max(var(--spacing-md), calc((100% - var(--container-width)) / 2 + var(--spacing-md)));
    padding-right: max(var(--spacing-md), calc((100% - var(--container-width)) / 2 + var(--spacing-md)));
}

:root {
    --nav-bg: rgba(255, 251, 243, 0.95);
    --nav-border: rgba(0, 0, 0, 0.05);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --nav-bg: rgba(34, 33, 31, 0.95);
        --nav-border: rgba(255, 255, 255, 0.08);
    }
}

:root[data-theme="dark"] {
    --nav-bg: rgba(34, 33, 31, 0.95);
    --nav-border: rgba(255, 255, 255, 0.08);
}

:root[data-theme="light"] {
    --nav-bg: rgba(255, 251, 243, 0.95);
    --nav-border: rgba(0, 0, 0, 0.05);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-serif);
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--text-primary);
    text-decoration: none;
}

/* Logo Icon - Layered SVGs */
.logo-icon {
    position: relative;
    width: 36px;
    height: 36px;
}

.logo-icon img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    -webkit-user-drag: none;
    user-drag: none;
    pointer-events: none;
}

.logo-body {
    /* Body adapts to theme */
}

.logo-accent {
    /* Accent stays constant */
}

@media (prefers-color-scheme: dark) {

    :root:not([data-theme="light"]) .logo-body,
    :root:not([data-theme="light"]) .avatar-body {
        filter: invert(1);
    }
}

/* Forced theme SVG handling */
:root[data-theme="dark"] .logo-body,
:root[data-theme="dark"] .avatar-body {
    filter: invert(1);
}

:root[data-theme="light"] .logo-body,
:root[data-theme="light"] .avatar-body {
    filter: none;
}

.nav-links {
    display: flex;
    gap: var(--spacing-md);
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    position: relative;
    letter-spacing: 0.02em;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0%;
    height: 2px;
    background-color: var(--brand-coral);
    transition: width 0.3s ease;
}

.nav-link:hover {
    opacity: 1;
    color: var(--text-primary);
}

.nav-link:hover::after {
    width: 100%;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: var(--spacing-xl) 0;
    min-height: 60vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: var(--spacing-text);
}

.hero h1 {
    max-width: 14ch;
}

.hero-description {
    color: var(--text-secondary);
    font-size: 1.25rem;
    max-width: 50ch;
    margin: 0 auto;
    line-height: 1.6;
}

/* Page Header */
.page-header {
    text-align: center;
    padding: var(--spacing-lg) 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

@media (prefers-color-scheme: dark) {
    .page-header {
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }
}

.page-header h1 {
    margin-bottom: var(--spacing-sm);
}

.page-header p {
    margin: 0 auto;
}

/* Content Sections */
.content-section {
    padding: var(--spacing-lg) 0;
}

.content-section h2 {
    text-align: left;
    margin-bottom: var(--spacing-sm);
}

.content-section p {
    margin-bottom: var(--spacing-text);
}

.content-section p:last-child {
    margin-bottom: 0;
}

/* Team Section */
.team-member {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--bg-secondary);
    border-radius: var(--radius-card);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

@media (prefers-color-scheme: dark) {
    .team-member {
        border: 1px solid rgba(255, 255, 255, 0.08);
    }
}

.team-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    border: 2px solid var(--border-primary);
}

/* Avatar Layers */
.avatar-layers {
    position: relative;
    width: 100%;
    height: 100%;
}

.avatar-layers img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    height: 80%;
    object-fit: contain;
    -webkit-user-drag: none;
    user-drag: none;
    pointer-events: none;
}

.avatar-body {
    /* Body adapts to theme - handled in combined rules above */
}

.avatar-accent {
    /* Accent stays constant */
}

.team-avatar img {
    width: 80%;
    height: 80%;
    object-fit: contain;
}

.team-info h3 {
    margin-bottom: 0.25rem;
}

.team-role {
    color: var(--brand-coral);
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.team-bio {
    color: var(--text-tertiary);
    font-size: 0.95rem;
}

/* Contact Card */
.contact-card {
    text-align: center;
    padding: var(--spacing-lg);
    background: var(--bg-secondary);
    border-radius: var(--radius-card);
    border: 1px solid rgba(0, 0, 0, 0.05);
    max-width: 500px;
    margin: 0 auto;
}

@media (prefers-color-scheme: dark) {
    .contact-card {
        border: 1px solid rgba(255, 255, 255, 0.08);
    }
}

.contact-card h2 {
    text-align: center;
}

.contact-card p {
    margin: 0 auto var(--spacing-md);
}

.contact-email {
    display: inline-block;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--brand-coral);
    padding: 1rem 2rem;
    border: 2px solid var(--border-primary);
    border-radius: var(--radius-button);
    box-shadow: 0px 4px 0px var(--border-primary);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.contact-email:hover {
    transform: translateY(-2px);
    box-shadow: 0px 6px 0px var(--border-primary);
    opacity: 1;
}

.contact-email:active {
    transform: translateY(2px);
    box-shadow: 0px 0px 0px var(--border-primary);
}

/* Footer */
footer {
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    padding: var(--spacing-md) 0;
    margin-top: auto;
}

@media (prefers-color-scheme: dark) {
    footer {
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-md);
}

.footer-links {
    display: flex;
    gap: var(--spacing-md);
}

.copyright {
    width: 100%;
    text-align: center;
    margin-top: var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    opacity: 0.5;
    font-size: 0.9rem;
}

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

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

/* Mobile Responsive */
@media (max-width: 768px) {
    .nav {
        padding: 1rem var(--spacing-sm);
    }

    .nav-links {
        gap: var(--spacing-sm);
    }

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

    .hero {
        padding: var(--spacing-lg) 0;
        min-height: auto;
    }

    .team-member {
        flex-direction: column;
        text-align: center;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    .footer-links {
        justify-content: center;
    }

    .copyright {
        margin-top: 0;
    }
}

/* Theme Toggle */
.theme-toggle {
    display: flex;
    align-items: center;
    gap: 0;
}

.theme-toggle button {
    background: transparent;
    border: none;
    padding: 0;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.2s ease;
    letter-spacing: 0.02em;
}

.theme-toggle button:hover {
    color: var(--text-primary);
}

.theme-toggle button.active {
    color: var(--brand-coral);
}

.theme-toggle .separator {
    color: var(--text-tertiary);
    padding: 0 0.5rem;
    font-size: 0.95rem;
    user-select: none;
}

@media (max-width: 768px) {
    .theme-toggle {
        margin-top: var(--spacing-sm);
    }
}