:root {
    --bg-color: #0a0a0a;
    --text-color: #e0e0e0;
    --heading-color: #ffffff;
    --light-grey: #333333;
    --accent-color: #A37C43;
    --font-heading: 'Space Mono', monospace;
    --font-body: 'Inter', sans-serif;
}

/* --- ANIMATION SETUP (FOR BOTH FRAMES) --- */
@property --angle { syntax: '<angle>'; initial-value: 0deg; inherits: false; }
@keyframes spin { to { --angle: 360deg; } }


/* --- Global Styles & Resets --- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    background-color: var(--bg-color); color: var(--text-color);
    font-family: var(--font-body); line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
#main-content { opacity: 0; transition: opacity 1s ease-in-out; }
#main-content.loaded { opacity: 1; }
h1, h2, h3, h4 { font-family: var(--font-heading); color: var(--heading-color); font-weight: 400; }
section { padding: 4rem 2rem; max-width: 1200px; margin: 0 auto; border-top: 1px solid var(--light-grey); }
a { color: var(--text-color); text-decoration: none; transition: color 0.3s ease; }
a:hover { color: var(--accent-color); }

/* --- Preloader --- */
#preloader {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: #000; display: flex; justify-content: center;
    align-items: center; z-index: 9999;
    transition: opacity 0.8s ease-in-out; cursor: pointer;
}
#preloader.fade-out { opacity: 0; pointer-events: none; }
#language-hello {
    color: var(--heading-color); font-family: var(--font-body); font-size: 2.5rem;
    opacity: 0; transition: opacity 0.5s ease-in-out;
}

/* --- Navigation --- */
.sticky-nav { position: sticky; top: 0; width: 100%; z-index: 1000; background-color: rgba(10, 10, 10, 0.85); backdrop-filter: blur(10px); border-bottom: 1px solid var(--light-grey); padding: 1.5rem 0; }
.sticky-nav nav { display: flex; justify-content: center; gap: 3rem; }
.sticky-nav nav a { color: var(--text-color); font-family: var(--font-heading); text-transform: uppercase; letter-spacing: 0.2em; font-size: 0.9rem; }

/* --- Hero Section --- */
#hero { min-height: 80vh; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; border-top: none; }
#hero h1 { font-size: 3rem; letter-spacing: 0.5em; margin-bottom: 1rem; text-transform: uppercase; padding-left: 0.5em; }
#hero p { font-size: 1.1rem; color: #aaa; }

/* --- Projects Section --- */
#projects h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 4rem;
    background: linear-gradient(90deg, #ffffff 0%, var(--accent-color) 50%, #ffffff 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 4s ease-in-out infinite;
}
@keyframes shimmer {
    0%, 100% { background-position: 0% center; }
    50% { background-position: 200% center; }
}
.projects-layout { display: flex; gap: 4rem; align-items: flex-start; }

/* Timeline */
.timeline-graphic {
    flex: 1; position: relative; align-self: stretch;
    display: flex; flex-direction: column;
}
.timeline-graphic .line {
    width: 2px; height: 100%; position: absolute; left: 10%; top: 0;
    background: linear-gradient(180deg, var(--accent-color), var(--light-grey));
    transform: scaleY(0); transform-origin: top; transition: transform 1s ease-out 0.2s;
}
.timeline-graphic.visible .line { transform: scaleY(1); }
.timeline-graphic .branch {
    position: relative; flex: 1; margin-left: 10%;
}
.timeline-graphic .branch::before {
    content: ''; position: absolute; width: calc(100% - 10%); height: 2px; top: 50%; left: 0;
    background: linear-gradient(90deg, var(--accent-color), var(--light-grey));
    transform: scaleX(0); transform-origin: left; transition: transform 0.7s ease-out;
}
.timeline-graphic.visible .branch::before { transform: scaleX(1); }
.timeline-graphic.visible .branch:nth-of-type(1)::before { transition-delay: 0.5s; }
.timeline-graphic.visible .branch:nth-of-type(2)::before { transition-delay: 0.7s; }
.timeline-graphic.visible .branch:nth-of-type(3)::before { transition-delay: 0.9s; }
.timeline-graphic .node {
    position: absolute; width: 16px; height: 16px; border-radius: 50%;
    border: 2px solid var(--accent-color); background-color: var(--bg-color);
    right: 0; top: 50%; transform: translateY(-50%) scale(0);
    transition: transform 0.5s ease-out;
    box-shadow: 0 0 12px rgba(163, 124, 67, 0.5);
}
.timeline-graphic.visible .node { transform: translateY(-50%) scale(1); }
.timeline-graphic.visible .branch:nth-of-type(1) .node { transition-delay: 0.8s; }
.timeline-graphic.visible .branch:nth-of-type(2) .node { transition-delay: 1s; }
.timeline-graphic.visible .branch:nth-of-type(3) .node { transition-delay: 1.2s; }

/* Cards */
.projects-list { flex: 2; display: flex; flex-direction: column; gap: 2rem; }
.project-item {
    display: block; position: relative; background-color: #111;
    border: 1px solid var(--light-grey); padding: 2.5rem 2rem;
    transition: transform 0.4s ease, background-color 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
    overflow: hidden;
}
.project-item::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-color), transparent);
    opacity: 0; transition: opacity 0.4s ease;
}
.project-item:hover {
    transform: translateY(-4px);
    background-color: #151515;
    border-color: rgba(163, 124, 67, 0.3);
    box-shadow: 0 8px 32px rgba(163, 124, 67, 0.1), 0 0 0 1px rgba(163, 124, 67, 0.1);
}
.project-item:hover::before { opacity: 1; }
.project-number {
    display: block; font-family: var(--font-heading); font-size: 0.8rem;
    color: var(--accent-color); letter-spacing: 0.15em; margin-bottom: 0.75rem;
    opacity: 0.7;
}
.project-item h3 { font-size: 1.6rem; margin-bottom: 0.75rem; transition: color 0.3s ease; }
.project-item:hover h3 { color: var(--accent-color); }
.project-desc { color: #777; font-size: 0.9rem; line-height: 1.7; }

/* --- "Currently Working At" Section --- */
#work-feature { text-align: center; }
#work-feature h2 { margin-bottom: 2rem; }
.lux-frame {
    display: inline-block;
    position: relative;
    padding: 3px;
    background-color: #111;
    border: 1px solid transparent;
    border-image: conic-gradient(from var(--angle), #555, #ddd, #555) 1;
    animation: spin 3s linear infinite;
    box-shadow: 0 0 15px rgba(221, 221, 221, 0.2);
}
.lux-frame-content {
    background-color: #111;
    padding: 3rem 5rem;
    color: var(--text-color);
    font-family: var(--font-heading);
    font-size: 1.2rem;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.5);
}

/* --- Projects & Work Section --- */
#work h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 3rem;
}
.work-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}
.work-card {
    background-color: #111;
    border: 1px solid var(--light-grey);
    padding: 2rem;
    transition: transform 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
    position: relative;
    overflow: hidden;
}
.work-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-color), transparent);
    opacity: 0; transition: opacity 0.4s ease;
}
.work-card:hover {
    transform: translateY(-4px);
    border-color: rgba(163, 124, 67, 0.3);
    box-shadow: 0 8px 32px rgba(163, 124, 67, 0.1);
}
.work-card:hover::before { opacity: 1; }
.work-card-context {
    display: block;
    font-family: var(--font-heading);
    font-size: 0.75rem;
    color: var(--accent-color);
    letter-spacing: 0.1em;
    margin-bottom: 0.75rem;
    opacity: 0.8;
}
.work-card h3 {
    font-size: 1.4rem;
    margin-bottom: 0.75rem;
    transition: color 0.3s ease;
}
.work-card:hover h3 { color: var(--accent-color); }
.work-card p {
    color: #777;
    font-size: 0.9rem;
    line-height: 1.7;
    margin-bottom: 1rem;
}
.work-card-tag {
    display: inline-block;
    font-family: var(--font-heading);
    font-size: 0.7rem;
    color: #999;
    letter-spacing: 0.1em;
    border: 1px solid var(--light-grey);
    padding: 0.3rem 0.8rem;
    border-radius: 2px;
}
/* Recommendation Letter Frame */
.rec-letter {
    margin-top: 1.5rem;
}
.rec-letter-label {
    display: block;
    font-family: var(--font-heading);
    font-size: 0.7rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--accent-color);
    margin-bottom: 0.75rem;
    opacity: 0.8;
}
.rec-letter-frame {
    padding: 3px;
    background: conic-gradient(from var(--angle), var(--light-grey), var(--accent-color), white, var(--accent-color), var(--light-grey));
    animation: spin 4s linear infinite;
    display: inline-block;
    box-shadow: 0 4px 24px rgba(163, 124, 67, 0.15), 0 0 0 1px rgba(163, 124, 67, 0.1);
    cursor: pointer;
    transition: box-shadow 0.4s ease, transform 0.4s ease;
}
.rec-letter-frame:hover {
    box-shadow: 0 8px 40px rgba(163, 124, 67, 0.3), 0 0 0 1px rgba(163, 124, 67, 0.2);
    transform: translateY(-2px);
}
.rec-letter-frame img {
    display: block;
    width: 100%;
    max-width: 360px;
    height: auto;
    background-color: #111;
}
/* Dissertation quote — dark-glass plaque inside the gold frame */
.diss-card { display: block; max-width: 360px; }
.diss-inner {
    position: relative;
    overflow: hidden;
    padding: 2.2rem 1.7rem 1.4rem;
    text-align: center;
    background:
        radial-gradient(130% 90% at 25% 0%, rgba(163, 124, 67, 0.22), transparent 55%),
        linear-gradient(165deg, #16130d 0%, #0b0b0b 70%);
}
/* sheen sweep on hover */
.diss-inner::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.07) 50%, transparent 70%);
    transform: translateX(-120%);
    transition: transform 0.7s ease;
}
.rec-letter-frame:hover .diss-inner::before { transform: translateX(120%); }
.diss-mark {
    display: block;
    font-family: var(--font-heading);
    font-size: 2.8rem;
    line-height: 0.6;
    color: var(--accent-color);
    opacity: 0.45;
}
.diss-quote {
    position: relative;
    margin: 0.5rem 0 1.3rem;
    font-family: var(--font-heading);
    font-size: 0.92rem;
    line-height: 1.55;
    letter-spacing: 0.03em;
    color: var(--heading-color);
    text-shadow: 0 1px 12px rgba(0, 0, 0, 0.6);
}
.diss-cta {
    display: inline-block;
    padding-top: 0.85rem;
    border-top: 1px solid rgba(163, 124, 67, 0.25);
    font-family: var(--font-heading);
    font-size: 0.6rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--accent-color);
    transition: letter-spacing 0.4s ease;
}
.rec-letter-frame:hover .diss-cta { letter-spacing: 0.28em; }

/* Inline Viz Sections (inside work cards) */
.viz-label {
    display: block;
    font-family: var(--font-heading);
    font-size: 0.7rem;
    color: #666;
    letter-spacing: 0.08em;
    margin-bottom: 0.75rem;
}

.viz-section {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--light-grey);
}

/* Dot Grid — 32 customers */
.dot-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--accent-color);
    opacity: 0;
    transform: scale(0);
    animation: dotPop 0.3s ease forwards;
    position: relative;
    cursor: default;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.dot:hover {
    transform: scale(1.4) !important;
}
/* Tier colors */
.dot--60 { background-color: var(--accent-color); }
.dot--30 { background-color: #7a6a4a; }
.dot--20 { background-color: #4a4035; }
.dot--60:hover { box-shadow: 0 0 10px rgba(163, 124, 67, 0.6); }
.dot--30:hover { box-shadow: 0 0 10px rgba(122, 106, 74, 0.6); }
.dot--20:hover { box-shadow: 0 0 10px rgba(74, 64, 53, 0.6); }
/* Tooltip on hover */
.dot::after {
    content: attr(data-tier);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%) scale(0.8);
    font-family: var(--font-heading);
    font-size: 0.65rem;
    color: var(--heading-color);
    background-color: #1a1a1a;
    border: 1px solid var(--light-grey);
    padding: 2px 6px;
    border-radius: 3px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease, transform 0.15s ease;
}
.dot:hover::after {
    opacity: 1;
    transform: translateX(-50%) scale(1);
}
/* Legend */
.dot-legend {
    display: flex;
    gap: 1.25rem;
    margin-top: 0.75rem;
}
.dot-legend-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.7rem;
    color: #555;
    font-family: var(--font-heading);
}
.dot-swatch {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}
.dot-swatch--60 { background-color: var(--accent-color); }
.dot-swatch--30 { background-color: #7a6a4a; }
.dot-swatch--20 { background-color: #4a4035; }
@keyframes dotPop {
    to { opacity: 0.85; transform: scale(1); }
}
/* Stagger the 32 dots */
.dot:nth-child(1)  { animation-delay: 0.05s; }
.dot:nth-child(2)  { animation-delay: 0.07s; }
.dot:nth-child(3)  { animation-delay: 0.09s; }
.dot:nth-child(4)  { animation-delay: 0.11s; }
.dot:nth-child(5)  { animation-delay: 0.13s; }
.dot:nth-child(6)  { animation-delay: 0.15s; }
.dot:nth-child(7)  { animation-delay: 0.17s; }
.dot:nth-child(8)  { animation-delay: 0.19s; }
.dot:nth-child(9)  { animation-delay: 0.21s; }
.dot:nth-child(10) { animation-delay: 0.23s; }
.dot:nth-child(11) { animation-delay: 0.25s; }
.dot:nth-child(12) { animation-delay: 0.27s; }
.dot:nth-child(13) { animation-delay: 0.29s; }
.dot:nth-child(14) { animation-delay: 0.31s; }
.dot:nth-child(15) { animation-delay: 0.33s; }
.dot:nth-child(16) { animation-delay: 0.35s; }
.dot:nth-child(17) { animation-delay: 0.37s; }
.dot:nth-child(18) { animation-delay: 0.39s; }
.dot:nth-child(19) { animation-delay: 0.41s; }
.dot:nth-child(20) { animation-delay: 0.43s; }
.dot:nth-child(21) { animation-delay: 0.45s; }
.dot:nth-child(22) { animation-delay: 0.47s; }
.dot:nth-child(23) { animation-delay: 0.49s; }
.dot:nth-child(24) { animation-delay: 0.51s; }
.dot:nth-child(25) { animation-delay: 0.53s; }
.dot:nth-child(26) { animation-delay: 0.55s; }
.dot:nth-child(27) { animation-delay: 0.57s; }
.dot:nth-child(28) { animation-delay: 0.59s; }
.dot:nth-child(29) { animation-delay: 0.61s; }
.dot:nth-child(30) { animation-delay: 0.63s; }
.dot:nth-child(31) { animation-delay: 0.65s; }
.dot:nth-child(32) { animation-delay: 0.67s; }

/* Revenue Bar */
.revenue-bar {
    height: 8px;
    background-color: #1a1a1a;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}
.revenue-fill {
    display: flex;
    height: 100%;
    width: 0%;
    border-radius: 4px;
    animation: fillBar 1.2s ease forwards 0.3s;
}
@keyframes fillBar {
    to { width: var(--target-width); }
}
.revenue-tier {
    display: block;
    height: 100%;
    font-size: 0;
}
.revenue-tier:nth-child(1) { background-color: rgba(163, 124, 67, 0.4); }
.revenue-tier:nth-child(2) { background-color: rgba(163, 124, 67, 0.65); }
.revenue-tier:nth-child(3) { background-color: var(--accent-color); }
.revenue-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: #444;
}

/* Documentary Embed */
.doc-embed { margin-top: 0.25rem; }
.doc-meta {
    display: block;
    font-size: 0.7rem;
    color: #444;
    margin-top: 0.5rem;
    line-height: 1.5;
}

/* Video Frame */
.video-frame {
    width: 100%;
    max-width: 100%;
}
.video-frame iframe {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    background-color: #111;
}

/* Inception — recursive site-within-site (Droste effect). One rule drives every
   depth: each nested frame is a container, so % + cqi sizing self-scales as it
   compounds inward. Markup + depth live in script.js. */
.inception { position: relative; }
.inception-frame {
    padding: 2px;
    background: conic-gradient(from var(--angle), var(--light-grey), var(--accent-color), white, var(--accent-color), var(--light-grey));
    animation: spin 4s linear infinite;
    box-shadow: 0 4px 20px rgba(163, 124, 67, 0.12);
    container-type: inline-size;
}
/* Every nested level: a smaller copy embedded INLINE mid-page. width<100% and
   opacity<1 compound with depth → shrink + fade for free; each frame is its own
   container so the cqi-sized modules below self-scale per level. */
.inception-frame .inception-frame {
    width: 62%;
    margin: 6% auto;
    opacity: 0.94;
    transition: transform 0.4s ease;
}
.inception:hover .inception-frame .inception-frame { transform: translateY(-1%); }
.inception-site {
    overflow: hidden;
    background-color: #0a0a0a;
    display: flex;
    flex-direction: column;
    gap: 5.5%;
    padding: 7% 6%;
}
.inception-nav {
    display: flex;
    gap: 5%;
    justify-content: center;
    margin-bottom: 1%;
}
.inception-nav span {
    width: 4%;
    height: clamp(1px, 0.6cqi, 2px);
    background: #333;
    border-radius: 1px;
}
.inception-hero {
    font-family: var(--font-heading);
    color: var(--heading-color);
    font-size: clamp(0.18rem, 3cqi, 0.7rem);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
}
.inception-bar {
    height: clamp(1px, 1cqi, 3px);
    background: linear-gradient(90deg, var(--accent-color), #222);
    border-radius: 1px;
    opacity: 0.5;
}
.inception-bar.short { width: 65%; }
.inception-bar.shorter { width: 40%; }
/* detail modules — each scales per level via cqi */
.inception-label {
    width: 28%;
    height: clamp(1px, 0.9cqi, 3px);
    background: var(--accent-color);
    opacity: 0.55;
    border-radius: 1px;
    margin-bottom: 1%;
}
.inception-rule {
    height: 1px;
    background: #1c1c1c;
    margin: 1% 0;
}
.inception-row {
    display: flex;
    gap: 4%;
}
.inception-cardlet {
    flex: 1;
    aspect-ratio: 3 / 5;
    background: linear-gradient(160deg, #161616, #0d0d0d);
    border: 1px solid #222;
    border-radius: 2px;
}
.inception-foot {
    width: 45%;
    height: clamp(2px, 1.4cqi, 5px);
    background: #1a1a1a;
    border-radius: 1px;
    align-self: center;
    margin-top: 2%;
}

.work-cards .fade-in:nth-child(2) { transition-delay: 0.15s; }
.work-cards .fade-in:nth-child(3) { transition-delay: 0.3s; }
.work-cards .fade-in:nth-child(4) { transition-delay: 0.45s; }
.work-cards .fade-in:nth-child(5) { transition-delay: 0.6s; }

/* Equalizer — music visualizer */
.equalizer {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 48px;
    margin-bottom: 0.75rem;
}
.eq-bar {
    flex: 1;
    height: var(--h);
    background: var(--accent-color);
    border-radius: 2px 2px 0 0;
    animation: eqBounce 0.8s ease-in-out infinite alternate;
    animation-delay: var(--d);
    opacity: 0.75;
}
@keyframes eqBounce {
    from { height: calc(var(--h) * 0.25); }
    to   { height: var(--h); }
}
.eq-source-link {
    display: inline-block;
    font-family: var(--font-heading);
    font-size: 0.7rem;
    color: #555;
    letter-spacing: 0.06em;
    transition: color 0.3s ease;
}
.eq-source-link:hover { color: var(--accent-color); }
/* Two links sit on this card now; inline-block would otherwise butt them together. */
.eq-source-link + .eq-source-link { margin-left: 1.1rem; }

/* --- Contact Display Section --- */
#contact .large-heading { font-size: 2.5rem; letter-spacing: 0.05em; font-weight: 500; margin-bottom: 1.5rem; }
.contact-details { display: flex; flex-direction: column; gap: 0.5rem; }
.contact-details a, .contact-details span { font-size: 1.1rem; font-family: var(--font-heading); }

/* --- About Me Section --- */
#about-me { padding: 5rem 2rem; }
.about-layout { display: flex; justify-content: space-between; align-items: flex-start; gap: 3rem; }
.about-text { flex: 2; }
.about-text h4 { font-family: var(--font-body); font-size: 1rem; color: #aaa; margin-bottom: 2rem; }
.about-text blockquote { font-family: var(--font-body); font-size: 2rem; line-height: 1.4; font-weight: 500; color: var(--heading-color); border: none; padding: 0; margin: 0 0 2rem 0; }
.about-text .cta-link { font-size: 1.1rem; }
.about-image-container { flex: 1; max-width: 250px; text-align: left; }
.image-frame {
    padding: 3px;
    margin-bottom: 1.5rem;
    background: conic-gradient(from var(--angle), var(--light-grey), var(--accent-color), white, var(--accent-color), var(--light-grey));
    animation: spin 4s linear infinite;
}
.image-frame img {
    width: 100%;
    height: auto;
    display: block; /* Removes unwanted space */
}
.image-socials { display: flex; flex-direction: column; gap: 0.5rem; }
.image-socials a { font-size: 1rem; }

/* --- Contact Form Section --- */
#contact-form-section { padding-top: 5rem; }
#contact-form-section h2 { text-align: center; font-size: 2rem; margin-bottom: 3rem; }
#contact-form { max-width: 600px; margin: 0 auto; display: flex; flex-direction: column; gap: 1.5rem; }
.form-group input, .form-group textarea { width: 100%; background: transparent; border: none; border-bottom: 1px solid var(--light-grey); padding: 0.8rem 0; color: var(--heading-color); font-family: var(--font-body); font-size: 1rem; }
.form-group input:focus, .form-group textarea:focus { outline: none; border-bottom-color: var(--accent-color); }
.ghost-button { background: transparent; border: 1px solid var(--light-grey); color: var(--text-color); padding: 1rem 2rem; font-family: var(--font-heading); cursor: pointer; transition: background-color 0.3s ease, color 0.3s ease; align-self: center; margin-top: 1rem; }
.ghost-button:hover { background-color: var(--accent-color); border-color: var(--accent-color); color: #000; }

/* --- Footer --- */
footer { background-color: var(--bg-color); padding: 2rem; border-top: 1px solid var(--light-grey); }
.footer-content { max-width: 1200px; margin: 0 auto; display: flex; justify-content: space-between; font-size: 0.9rem; color: #888; }
.footer-right { display: flex; gap: 2rem; }

/* --- Animations --- */
.fade-in { opacity: 0; transform: translateY(20px); transition: opacity 0.6s ease-out, transform 0.6s ease-out; }
.fade-in.visible { opacity: 1; transform: translateY(0); }
.projects-list .fade-in:nth-child(2) { transition-delay: 0.2s; }
.projects-list .fade-in:nth-child(3) { transition-delay: 0.4s; }

/* --- Responsive Design --- */
@media (max-width: 768px) {
    section { padding: 4rem 1.5rem; }
    #hero h1 { font-size: 2rem; }
    .projects-layout, .about-layout { flex-direction: column; }
    .timeline-graphic { display: none; }
    .about-image-container { max-width: 100%; text-align: center; margin-top: 2rem; }
    .image-frame { display: inline-block; /* Center the frame properly on mobile */ }
    .revenue-meta { flex-direction: column; gap: 0.15rem; }
}

/* --- Keypad --- */
.keypad-wrapper {
    max-width: 1200px;
    margin: 2rem auto 4rem auto; /* Top, horizontal, bottom margins */
    padding: 0 2rem; /* Match section padding */
    display: flex;
    justify-content: flex-end; /* Pushes keypad to the right */
}

#keypad-container {
    background-color: rgba(10, 10, 10, 0.9);
    backdrop-filter: blur(5px);
    border: 1px solid var(--light-grey);
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 5px 25px rgba(0,0,0,0.5);
    width: 220px;
}

#keypad-display {
    background-color: var(--bg-color);
    color: var(--heading-color);
    font-family: var(--font-heading);
    font-size: 1.5rem;
    text-align: right;
    padding: 0.5rem 0.8rem;
    border-radius: 4px;
    border: 1px solid var(--light-grey);
    margin-bottom: 1rem;
    min-height: 40px;
    letter-spacing: 0.2em;
}

#keypad-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.keypad-btn {
    background: transparent;
    border: 1px solid var(--light-grey);
    color: var(--text-color);
    padding: 0.8rem;
    font-family: var(--font-heading);
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
    border-radius: 4px;
    font-size: 1.1rem;
}

.keypad-btn:hover {
    background-color: var(--accent-color);
    color: #000;
    border-color: var(--accent-color);
}

.keypad-btn:active {
    transform: scale(0.95);
}

.keypad-action {
    color: var(--accent-color);
}