/* Google Fonts Import */
@import url('https://fonts.googleapis.com/css2?family=Roboto+Mono:wght@400;700&display=swap');

/* ---- Theme tokens (light defaults) ---- */
:root {
    --bg: #e7ecf1;
    --surface: #f3f6fa;
    --text: #1d2733;
    --heading: #155e75;
    --border: #c3ced9;
    --link: #155e75;
    --link-hover: #0c4a5c;
    --font: 'Roboto Mono', monospace;
    --title: #155e75;
    --robot: '🤖';
    --pattern-size: 26px 26px;
    /* Faint blueprint grid — the "day" tech counterpart to the night sky */
    --stars:
        linear-gradient(rgba(21, 94, 117, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(21, 94, 117, 0.06) 1px, transparent 1px);
}

/* Dark palette, shared by the system default and the manual override */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #0b1120;
        --surface: #131c2e;
        --text: #d6dce6;
        --heading: #f39c12;
        --border: #243049;
        --link: #f1f1f3;
        --link-hover: #f39c12;
        --title: #ffd700;
        --robot: '🤖';
        --pattern-size: 240px 240px;
        --stars:
            radial-gradient(1.5px 1.5px at 30px 40px, #ffffff, transparent),
            radial-gradient(1px 1px at 90px 120px, rgba(255, 255, 255, 0.8), transparent),
            radial-gradient(1px 1px at 160px 70px, rgba(255, 255, 255, 0.7), transparent),
            radial-gradient(1.5px 1.5px at 200px 180px, #ffffff, transparent),
            radial-gradient(1px 1px at 60px 200px, rgba(255, 255, 255, 0.75), transparent),
            radial-gradient(1px 1px at 130px 30px, rgba(255, 255, 255, 0.6), transparent);
    }
}

:root[data-theme="dark"] {
    --bg: #0b1120;
    --surface: #131c2e;
    --text: #d6dce6;
    --heading: #f39c12;
    --border: #243049;
    --link: #f1f1f3;
    --link-hover: #f39c12;
    --title: #ffd700;
    --robot: '🤖';
    --pattern-size: 240px 240px;
    --stars:
        radial-gradient(1.5px 1.5px at 30px 40px, #ffffff, transparent),
        radial-gradient(1px 1px at 90px 120px, rgba(255, 255, 255, 0.8), transparent),
        radial-gradient(1px 1px at 160px 70px, rgba(255, 255, 255, 0.7), transparent),
        radial-gradient(1.5px 1.5px at 200px 180px, #ffffff, transparent),
        radial-gradient(1px 1px at 60px 200px, rgba(255, 255, 255, 0.75), transparent),
        radial-gradient(1px 1px at 130px 30px, rgba(255, 255, 255, 0.6), transparent);
}

/* Basic Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font);
    background-color: var(--bg);
    background-image: var(--stars);
    background-repeat: repeat;
    background-size: var(--pattern-size);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: grid;
    /* Center horizontally, anchor to the top vertically */
    place-items: start center;
    transition: background-color 0.4s ease, color 0.4s ease;
}

/* Container */
.container {
    max-width: 800px;
    margin: auto;
    padding: 20px;
}

/* Links */
a {
    color: var(--link);
    text-decoration: none;
    font-weight: 400;
}

a:hover {
    color: var(--link-hover);
    text-decoration: underline;
}

/* Header */
header {
    background-color: var(--surface);
    color: var(--text);
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid var(--border);
    transition: background-color 0.4s ease, border-color 0.4s ease;
}

header h1.org.fn {
    margin-bottom: 10px;
    font-size: 2.2em;
    font-weight: 700;
    color: var(--title);
    position: relative;
    display: inline-block;
}

/*
 * Animated robots flanking the title — a nod to the AI-generated
 * "robot" theme. They render whenever --robot is set (both day and night).
 */
header h1.org.fn::before,
header h1.org.fn::after {
    content: var(--robot);
    position: absolute;
    top: 50%;
    font-size: 0.85em;
    line-height: 1;
    animation: robot-spin 5s linear infinite;
}

header h1.org.fn::before {
    left: -1.8em;
}

header h1.org.fn::after {
    right: -1.8em;
    animation-direction: reverse;
}

@keyframes robot-spin {
    from { transform: translateY(-50%) rotate(0deg); }
    to { transform: translateY(-50%) rotate(360deg); }
}

header summary {
    font-size: 1.2em;
    font-weight: 400;
    margin-top: 10px;
}

/* Main Content */
main {
    padding: 20px;
}

/* Customer Cases Section */
.customer-cases h2,
.consultants h2 {
    color: var(--heading);
    margin-bottom: 10px;
    font-size: 1.6em;
    font-weight: 700;
}

.customer-cases ul,
.consultants ul {
    list-style: disc;
    padding-left: 1.5em;
    margin: 0;
}

.customer-cases li,
.consultants li {
    margin-bottom: 8px;
}

.customer-cases li::marker,
.consultants li::marker {
    color: var(--heading);
}

/* Contact and Company Information */
aside {
    background-color: var(--surface);
    padding: 20px;
    margin: 20px 0;
    border: 1px solid var(--border);
    transition: background-color 0.4s ease, border-color 0.4s ease;
}

aside h2 {
    margin-bottom: 10px;
    font-size: 1.4em;
    font-weight: 700;
}

aside address p {
    line-height: 1.6;
}

/* Footer */
footer {
    background-color: var(--surface);
    color: var(--text);
    text-align: center;
    padding: 20px;
    border-top: 1px solid var(--border);
    transition: background-color 0.4s ease, border-color 0.4s ease;
}

footer h3 {
    margin-bottom: 10px;
    font-size: 1.4em;
    font-weight: 700;
}

footer p {
    font-size: 0.9em;
}

/* ---- Theme toggle button ---- */
#theme-toggle {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 1001;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background-color: var(--surface);
    color: var(--text);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: grid;
    place-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
    transition: transform 0.15s ease, background-color 0.4s ease, border-color 0.4s ease;
}

#theme-toggle:hover {
    transform: scale(1.08);
}

#theme-toggle:focus-visible {
    outline: 2px solid var(--link);
    outline-offset: 2px;
}

/* ---- Sunrise / sunset animation overlay ---- */
#theme-fx {
    position: fixed;
    inset: 0;
    z-index: 1000;
    overflow: hidden;
    pointer-events: none;
    display: none;
}

#theme-fx.run {
    display: block;
}

#theme-fx .sun {
    position: absolute;
    left: 50%;
    bottom: -140px;
    width: 88px;
    height: 88px;
    margin-left: -44px;
    border-radius: 50%;
    opacity: 0;
}

#theme-fx.rise .sun {
    background: radial-gradient(circle at 50% 45%, #fff6c4, #ffd23f 55%, #ff9f43);
    box-shadow: 0 0 50px 16px rgba(255, 205, 90, 0.55);
    animation: sun-rise 1.7s ease-out forwards;
}

#theme-fx.set .sun {
    background: radial-gradient(circle at 50% 45%, #ffd9a0, #ff8c42 55%, #e0533a);
    box-shadow: 0 0 50px 16px rgba(255, 120, 60, 0.5);
    animation: sun-set 1.7s ease-in forwards;
}

@keyframes sun-rise {
    0% { bottom: -140px; opacity: 0; }
    25% { opacity: 1; }
    100% { bottom: 72%; opacity: 0; }
}

@keyframes sun-set {
    0% { bottom: 72%; opacity: 0; }
    20% { opacity: 1; }
    100% { bottom: -140px; opacity: 0; }
}

/* Respect users who prefer no motion */
@media (prefers-reduced-motion: reduce) {
    #theme-fx { display: none !important; }
    #theme-toggle,
    body,
    header,
    aside,
    footer {
        transition: none;
    }
    header h1.org.fn::before,
    header h1.org.fn::after {
        animation: none;
    }
}

