/*
 * Mobile-first breakpoints:
 * Base (default): mobile
 * min-width: 376px  – small phones landscape
 * min-width: 481px  – large phones / small tablets
 * min-width: 769px  – tablet / desktop
 * min-width: 993px  – desktop (e.g. portfolio 3 columns)
 */

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


body {
    font-family: 'Georgia', serif;
    overflow-x: hidden;
    background: #0a0a0a;
    color: #fff;
    overscroll-behavior: none;
}

/* All major sections snap and are exactly 100vh (mobile base) */
.snap-section {
    scroll-snap-align: start;
    height: 100vh;
    min-height: 100vh;
    max-height: 100vh;
    overflow-y: hidden;
    overflow-x: hidden;
    position: relative;
}

/* Use dynamic viewport height on mobile for better support */
@supports (height: 100dvh) {
    .snap-section {
        height: 100dvh;
        min-height: 100dvh;
        max-height: 100dvh;
    }
    
    .hero {
        height: 100dvh;
    }
    
    .split-section {
        height: 100dvh;
    }
    
    .text-morph-section {
        height: 100dvh;
    }
    
    .synthesis {
        min-height: 100dvh;
    }
    
    .contact-section {
        min-height: 100dvh;
    }
    
    .stars-container {
        height: 100dvh;
    }
    
    .fixed-bg-container {
        height: 100dvh;
    }
}

/* Tablet/desktop: single overflow */
@media (min-width: 769px) {
    .snap-section {
        overflow: hidden;
    }
}

.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.hero::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    background: 
        repeating-linear-gradient(90deg, transparent, transparent 40px, rgba(255,255,255,0.03) 40px, rgba(255,255,255,0.03) 41px),
        repeating-linear-gradient(0deg, transparent, transparent 40px, rgba(255,255,255,0.03) 40px, rgba(255,255,255,0.03) 41px);
    animation: gridMove 20s linear infinite;
}

@keyframes gridMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(41px, 41px); }
}

/* Hero animated square and circle */
.hero-square,
.hero-circle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    overflow: visible;
    pointer-events: none;
}

.hero-square {
    width: 500px;
    height: 500px;
}

.hero-circle {
    width: 550px;
    height: 550px;
}

.hero-square-path {
    fill: none;
    stroke: rgba(255, 255, 255, 0.2);
    stroke-width: 2;
    stroke-dasharray: 1200;
    stroke-dashoffset: 1200;
    stroke-linecap: square;
    animation: drawHeroSquareLoop 8s ease-in-out infinite;
}

.hero-circle-path {
    fill: none;
    stroke: rgba(255, 255, 255, 0.2);
    stroke-width: 2;
    stroke-dasharray: 1260;
    stroke-dashoffset: 1260;
    stroke-linecap: round;
    animation: drawHeroCircleLoop 8s ease-in-out 0.5s infinite;
}

@keyframes drawHeroSquareLoop {
    0% {
        stroke-dashoffset: 1200;
        opacity: 1;
    }
    40% {
        stroke-dashoffset: 0;
        opacity: 1;
    }
    60% {
        stroke-dashoffset: 0;
        opacity: 1;
    }
    90% {
        stroke-dashoffset: -1200;
        opacity: 0.5;
    }
    100% {
        stroke-dashoffset: -1200;
        opacity: 0;
    }
}

@keyframes drawHeroCircleLoop {
    0% {
        stroke-dashoffset: 1260;
        opacity: 1;
    }
    40% {
        stroke-dashoffset: 0;
        opacity: 1;
    }
    60% {
        stroke-dashoffset: 0;
        opacity: 1;
    }
    90% {
        stroke-dashoffset: -1260;
        opacity: 0.5;
    }
    100% {
        stroke-dashoffset: -1260;
        opacity: 0;
    }
}

.hero-content {
    text-align: center;
    z-index: 1;
    position: relative;
}

.hero-title-prefix {
    font-size: 1.8rem;
    font-weight: 300;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    opacity: 0;
    transform: translateY(20px);
    margin-bottom: 0.5rem;
    color: rgba(255, 255, 255, .7);
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    font-weight: 300;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    opacity: 0;
    transform: translateY(30px);
}

.hero .subtitle {
    font-size: 1.5rem;
    opacity: 0;
    font-style: italic;
    transform: translateY(20px);
}

/* Fixed background container: mobile = stacked (top/bottom), desktop = side by side (left/right) */
.fixed-bg-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    transition: opacity 0.4s ease;
}

.fixed-bg-left {
    flex: 1;
    width: 100%;
    height: 50%;
    background: linear-gradient(135deg, #0a3b75 0%, #1a5a9e 30%, #487eac 70%, #3a6d99 100%);
    transition: flex 0.5s ease;
    position: relative;
}

.fixed-bg-right {
    flex: 1;
    width: 100%;
    height: 50%;
    background: linear-gradient(135deg, #d4c4a8 0%, #e8dcc8 25%, #f5efe5 50%, #e8dcc8 75%, #c9b896 100%);
    transition: flex 0.5s ease;
    position: relative;
}

.fixed-bg-divider {
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    bottom: auto;
    width: 100%;
    height: 3px;
    transition: left 0.5s ease, top 0.5s ease;
    background: linear-gradient(to bottom, 
        transparent 0%, 
        rgba(96, 78, 54, 0.4) 15%,
        rgba(96, 78, 54, 0.6) 50%, 
        rgba(96, 78, 54, 0.4) 85%, 
        transparent 100%);
    box-shadow: 
        -2px 0 8px rgba(10, 59, 117, 0.3),
        2px 0 8px rgba(96, 78, 54, 0.3);
    pointer-events: none;
}

.fixed-bg-left::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 200%;
    height: 200%;
    background: 
        repeating-linear-gradient(90deg, transparent, transparent 40px, rgba(255,255,255,0.08) 40px, rgba(255,255,255,0.08) 41px),
        repeating-linear-gradient(0deg, transparent, transparent 40px, rgba(255,255,255,0.08) 40px, rgba(255,255,255,0.08) 41px);
    animation: gridMove 20s linear infinite;
}

/* Smaller grid lines for more detail on blueprint */
.fixed-bg-left::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 200%;
    height: 200%;
    background: 
        repeating-linear-gradient(90deg, transparent, transparent 10px, rgba(255,255,255,0.03) 10px, rgba(255,255,255,0.03) 11px),
        repeating-linear-gradient(0deg, transparent, transparent 10px, rgba(255,255,255,0.03) 10px, rgba(255,255,255,0.03) 11px);
    animation: gridMove 30s linear infinite reverse;
    pointer-events: none;
}

/* Parchment texture on right side */
.fixed-bg-right::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse at center, transparent 40%, rgba(139, 119, 85, 0.15) 100%);
    pointer-events: none;
}

.fixed-bg-right::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 30%, rgba(139, 119, 85, 0.08) 0%, transparent 30%),
        radial-gradient(circle at 80% 70%, rgba(139, 119, 85, 0.06) 0%, transparent 25%),
        radial-gradient(circle at 60% 20%, rgba(139, 119, 85, 0.05) 0%, transparent 20%);
    pointer-events: none;
}

/* Animated compass circles */
.compass-circle {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 500px;
    height: 500px;
    transform: translate(-50%, -50%);
    overflow: visible;
}

.compass-circle-inner {
    width: 300px;
    height: 300px;
}

.compass-circle-path {
    fill: none;
    stroke: rgba(96, 78, 54, 0.3);
    stroke-width: 2;
    stroke-dasharray: 1560;
    stroke-dashoffset: 1560;
    stroke-linecap: round;
    transform-origin: center;
}

.compass-circle-inner .compass-circle-path {
    stroke: rgba(96, 78, 54, 0.2);
    stroke-width: 1;
    stroke-dasharray: 930;
    stroke-dashoffset: 930;
}

/* When animated class is added, start the looping animation */
.compass-circle.animate .compass-circle-path {
    animation: drawCircleLoop 6s ease-in-out infinite;
}

.compass-circle-inner.animate .compass-circle-path {
    animation: drawCircleLoopInner 6s ease-in-out 0.3s infinite;
}

@keyframes drawCircleLoop {
    0% {
        stroke-dashoffset: 1560;
        opacity: 1;
    }
    40% {
        stroke-dashoffset: 0;
        opacity: 1;
    }
    60% {
        stroke-dashoffset: 0;
        opacity: 1;
    }
    90% {
        stroke-dashoffset: -1560;
        opacity: 0.5;
    }
    100% {
        stroke-dashoffset: -1560;
        opacity: 0;
    }
}

@keyframes drawCircleLoopInner {
    0% {
        stroke-dashoffset: 930;
        opacity: 1;
    }
    40% {
        stroke-dashoffset: 0;
        opacity: 1;
    }
    60% {
        stroke-dashoffset: 0;
        opacity: 1;
    }
    90% {
        stroke-dashoffset: -930;
        opacity: 0.5;
    }
    100% {
        stroke-dashoffset: -930;
        opacity: 0;
    }
}

.split-section {
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: relative;
    z-index: 1;
    overflow: hidden;
}

/* First 3 sections have transparent backgrounds to show fixed bg */
.split-section.use-fixed-bg .half {
    background: transparent !important;
}

.split-section.use-fixed-bg .half::before,
.split-section.use-fixed-bg .half::after {
    display: none !important;
}

/* Hide dividers on sections using fixed background */
.split-section.use-fixed-bg .divider {
    display: none !important;
}

/* Craft intro section: standalone intro before Code/Design */
.craft-intro-section {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0a0a1a 0%, #141428 50%, #0a0a1a 100%);
    position: relative;
    z-index: 1;
}

.craft-intro-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 30% 30%, rgba(74, 158, 255, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 70% 70%, rgba(212, 165, 116, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

.craft-intro-container {
    max-width: 36em;
    text-align: center;
    padding: 3rem 2rem;
    z-index: 1;
}

.craft-intro-container .eyebrow-text {
    font-size: 1.1rem;
    font-weight: 300;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin: 0 0 1.5rem;
    color: rgba(255, 255, 255, 0.6);
    opacity: 0.8;
}

.craft-intro-title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 400;
    letter-spacing: 0.03em;
    line-height: 1.3;
    margin: 0 0 1.75rem;
    background: linear-gradient(90deg, #a8c5e2 0%, #d4a574 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-transform: none;
}

.craft-intro-sub {
    font-size: clamp(1rem, 2vw, 1.2rem);
    line-height: 1.7;
    opacity: 0.85;
    margin: 0;
    font-style: italic;
    color: rgba(255, 255, 255, 0.9);
    max-width: 30em;
    margin-left: auto;
    margin-right: auto;
}

/* Webpage reveal section: outline drawn then filled to look real */
.webpage-reveal-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0a0a1a 0%, #141428 50%, #0a0a1a 100%);
    position: relative;
    z-index: 1;
    overflow: hidden;
}

.webpage-reveal-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 30% 30%, rgba(74, 158, 255, 0.06) 0%, transparent 50%),
        radial-gradient(circle at 70% 70%, rgba(212, 165, 116, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

.webpage-reveal-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    z-index: 1;
    padding: 3rem 2rem;
    position: relative;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.webpage-reveal-wrapper {
    position: relative;
    width: 100%;
    max-width: min(1800px, 98vw);
    margin: 0 auto;
    box-sizing: border-box;
}

.webpage-reveal-svg {
    width: 100%;
    height: auto;
    aspect-ratio: 380 / 260;
    filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.4));
    display: block;
    box-sizing: border-box;
}

.webpage-outline {
    vector-effect: non-scaling-stroke;
}

.webpage-outline-path {
    stroke-dasharray: 1500;
    stroke-dashoffset: 1500;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.webpage-reveal-caption {
    font-size: 1rem;
    font-style: italic;
    color: rgba(255, 255, 255, 0.6);
    margin: 0;
}

/* Code writing animation overlay */
.webpage-code-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    z-index: 2;
    box-sizing: border-box;
    overflow: hidden;
}

.webpage-code-container {
    background: #1e1e1e;
    border-radius: 8px;
    padding: 1.5rem;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(74, 158, 255, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.webpage-code-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.webpage-code-dots {
    display: flex;
    gap: 0.5rem;
}

.webpage-code-dots span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #5c5c5c;
}

.webpage-code-dots span:nth-child(1) {
    background: #ff5f56;
}

.webpage-code-dots span:nth-child(2) {
    background: #ffbd2e;
}

.webpage-code-dots span:nth-child(3) {
    background: #27c93f;
}

.webpage-code-title {
    color: #858585;
    font-size: 0.9rem;
    font-family: 'Courier New', monospace;
}

.webpage-code-content {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.8;
    color: #d4d4d4;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 0.5rem;
}

.webpage-code-content::-webkit-scrollbar {
    width: 6px;
}

.webpage-code-content::-webkit-scrollbar-track {
    background: #1a1a1a;
}

.webpage-code-content::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 3px;
}

.webpage-code-content::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.webpage-code-line {
    opacity: 0;
    white-space: pre;
}

.webpage-code-line.visible {
    opacity: 1;
}

.webpage-code-keyword {
    color: #569cd6;
}

.webpage-code-function {
    color: #dcdcaa;
}

.webpage-code-string {
    color: #ce9178;
}

.webpage-code-comment {
    color: #6a9955;
    font-style: italic;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.typing-cursor {
    display: inline-block;
    font-weight: bold;
    margin-left: 2px;
}

/* Portfolio section: no inner Y scroll; grid scrolls horizontally */
.portfolio-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    background: linear-gradient(135deg, #0a0a1a 0%, #141428 50%, #0a0a1a 100%);
    position: relative;
    z-index: 1;
    overflow: hidden;
    height: 100vh;
    max-height: 100vh;
    padding: 2rem 0;
}

@supports (height: 100dvh) {
    .portfolio-section {
        height: 100dvh;
        max-height: 100dvh;
    }
}

.portfolio-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 30% 30%, rgba(74, 158, 255, 0.06) 0%, transparent 50%),
        radial-gradient(circle at 70% 70%, rgba(212, 165, 116, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

.portfolio-container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 1.5rem 1.25rem 2rem;
    z-index: 1;
}

.portfolio-header {
    text-align: center;
    margin: 2rem 0;
}

.portfolio-section .eyebrow-text {
    font-size: 1.1rem;
    font-weight: 300;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin: 0 0 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    opacity: 0.9;
}

.portfolio-title {
    font-size: 1.5rem;
    font-weight: 400;
    letter-spacing: 0.03em;
    line-height: 1.3;
    margin: 0 0 0.75rem;
    background: linear-gradient(90deg, #a8c5e2 0%, #d4a574 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-transform: none;
}

.portfolio-sub {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
    max-width: 28em;
    margin-left: auto;
    margin-right: auto;
}

/* Mobile: horizontal scroller – free drag, snap to center of card on release (no CSS scroll-snap) */
.portfolio-grid {
    display: flex;
    flex-direction: row;
    gap: 0.875rem;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 0 1rem 0.5rem;
    margin: 0 -1rem;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-snap-type: none;
}

.portfolio-grid::-webkit-scrollbar {
    display: none;
}

.portfolio-card {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    width: 280px;
    min-width: 280px;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    transition: background 0.3s ease, border-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    font-size: inherit;
}

.portfolio-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(168, 197, 226, 0.3);
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
}

.portfolio-card__tag {
    font-size: 0.7rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(168, 197, 226, 0.9);
    margin-bottom: 0.75rem;
}

.portfolio-card__title {
    font-size: 1.15rem;
    font-weight: 600;
    margin: 0 0 0.5rem;
    color: #fff;
    font-family: var(--font-heading, Georgia, 'Times New Roman', serif);
    text-transform: none;
    letter-spacing: 0.02em;
}

.portfolio-card__desc {
    font-size: 0.9rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.65);
    margin: 0 0 1rem;
    flex-grow: 1;
}

.portfolio-card__link {
    font-size: 0.85rem;
    color: rgba(212, 165, 116, 0.95);
    margin-top: auto;
    transition: color 0.3s ease, transform 0.3s ease;
}

.portfolio-card:hover .portfolio-card__link {
    color: #d4a574;
}

/* Carousel dots (mobile only) */
.portfolio-carousel-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 0 0;
    flex-shrink: 0;
}

.portfolio-carousel-dots .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.4);
    background: transparent;
    cursor: pointer;
    padding: 0;
    transition: background 0.25s ease, transform 0.25s ease, border-color 0.25s ease;
    flex-shrink: 0;
}

.portfolio-carousel-dots .dot:hover {
    border-color: rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.2);
}

.portfolio-carousel-dots .dot.is-active {
    background: rgba(212, 165, 116, 0.9);
    border-color: rgba(212, 165, 116, 1);
    transform: scale(1.2);
}

/* Hide dots on tablet/desktop (grid layout) */
@media (min-width: 769px) {
    .portfolio-carousel-dots {
        display: none !important;
    }
}

/* Portfolio Modal */
.portfolio-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.portfolio-modal.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.portfolio-modal__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
}

.portfolio-modal__container {
    position: relative;
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    background: linear-gradient(135deg, #0a0a1a 0%, #141428 50%, #0a0a1a 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
    z-index: 1;
}

@supports (height: 100dvh) {
    .portfolio-modal__container {
        max-height: 85dvh;
    }
}

.portfolio-modal.is-open .portfolio-modal__container {
    transform: scale(1) translateY(0);
}

.portfolio-modal__close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

.portfolio-modal__close:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    color: #fff;
    transform: rotate(90deg);
}

.portfolio-modal__close svg {
    width: 20px;
    height: 20px;
}

.portfolio-modal__content {
    padding: 2.5rem;
    overflow-y: auto;
    max-height: calc(85vh - 5rem);
}

@supports (height: 100dvh) {
    .portfolio-modal__content {
        max-height: calc(85dvh - 5rem);
    }
}

.portfolio-modal__image-wrapper {
    width: 100%;
    margin-bottom: 1.5rem;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.portfolio-modal__image {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

.portfolio-modal__tag {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(168, 197, 226, 0.9);
    margin-bottom: 0.75rem;
}

.portfolio-modal__title {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 400;
    letter-spacing: 0.03em;
    line-height: 1.3;
    margin: 0 0 1rem;
    color: #fff;
    background: linear-gradient(90deg, #a8c5e2 0%, #d4a574 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-transform: none;
}

.portfolio-modal__body {
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.7;
    font-size: 1rem;
}

.portfolio-modal__body p {
    margin-bottom: 1rem;
}

.portfolio-modal__footer {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.portfolio-modal__footer .btn-external {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: rgba(168, 197, 226, 0.15);
    border: 1px solid rgba(168, 197, 226, 0.3);
    border-radius: 6px;
    color: #a8c5e2;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.portfolio-modal__footer .btn-external:hover {
    background: rgba(168, 197, 226, 0.25);
    border-color: rgba(168, 197, 226, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.half {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem 1.5rem;
    position: relative;
    overflow: hidden;
    transition: flex 0.5s ease;
    z-index: 1;
    pointer-events: auto;
}

.half:hover {
    z-index: 2;
}

/* Click-to-expand effect for content halves - expanded side covers the other; clip so SVG stays in bounds */
.split-section .half.expanded {
    flex: 1.5;
    z-index: 10;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Expanded half gets matching background so it visually covers the collapsed side */
.split-section.use-fixed-bg-tools .half.blueprint-tool-side.expanded {
    background: linear-gradient(135deg, #0a3b75 0%, #1a5a9e 30%, #487eac 70%, #3a6d99 100%) !important;
}

.split-section.use-fixed-bg-tools .half.parchment-tool-side.expanded {
    background: linear-gradient(135deg, #d4c4a8 0%, #e8dcc8 25%, #f5efe5 50%, #e8dcc8 75%, #c9b896 100%) !important;
}

.split-section.has-expanded .half:not(.expanded) {
    flex: 0.4;
    overflow: hidden;
    z-index: 1;
}

.square-side {
    background: linear-gradient(135deg, #0a3b75 0%, #1a5a9e 30%, #487eac 70%, #3a6d99 100%);
}

.compass-side {
    background: linear-gradient(135deg, #d4c4a8 0%, #e8dcc8 25%, #f5efe5 50%, #e8dcc8 75%, #c9b896 100%);
}

.square-side::before {
    display: none !important;
}

.compass-side::before {
    display: none !important;
}

.compass-side::after {
    display: none !important;
}

/* Dark text for parchment background */
.compass-side .content-wrapper {
    color: #4a3f2f;
}

.compass-side .content-wrapper h2 {
    color: #3a2f1f;
}

.compass-side .content-wrapper .descriptor {
    color: rgba(74, 63, 47, 0.8);
}

.compass-side .content-wrapper .icon {
    color: #5a4a3a;
}

.compass-side .examples li {
    color: #4a3f2f;
}

.compass-side .examples li::before {
    color: rgba(74, 63, 47, 0.5);
}

/* Mobile: hide code-design examples until the side is expanded */
.split-section[data-section="code-design"] .half:not(.expanded) .examples {
    visibility: hidden;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    margin: 0;
    padding: 0;
    transition: visibility 0.3s ease, opacity 0.3s ease, max-height 0.3s ease;
}

.split-section[data-section="code-design"] .half.expanded .examples {
    visibility: visible;
    opacity: 1;
    max-height: 50vh;
    overflow: visible;
}

.split-section[data-section="code-design"] .half.expanded .examples li {
    opacity: 1;
    transform: translateX(0);
}

.content-wrapper {
    max-width: 500px;
    position: relative;
    opacity: 0;
    transform: translateY(50px);
    white-space: nowrap;
}

.icon {
    font-size: 4rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
    font-weight: 400;
    letter-spacing: 0.05em;
}

.descriptor {
    font-size: 1.3rem;
    opacity: 0.7;
    margin-bottom: 2rem;
    font-style: italic;
}

.examples {
    list-style: none;
    font-size: 1.1rem;
    line-height: 2;
}

.examples li {
    opacity: 0;
    transform: translateX(-20px);
}

.examples li::before {
    content: '▪';
    margin-right: 0.5rem;
    opacity: 0.5;
}

.divider {
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    bottom: auto;
    width: 100%;
    height: 2px;
    transform: scaleX(0);
    background: linear-gradient(to bottom, 
        transparent 0%, 
        rgba(96, 78, 54, 0.4) 15%,
        rgba(96, 78, 54, 0.6) 50%, 
        rgba(96, 78, 54, 0.4) 85%, 
        transparent 100%);
    z-index: 2;
    box-shadow: 
        -2px 0 8px rgba(10, 59, 117, 0.3),
        2px 0 8px rgba(96, 78, 54, 0.3);
    pointer-events: none;
}

/* ========== BLUEPRINT & PARCHMENT TOOLS SECTION ========== */

/* Fixed background for blueprint/parchment section */
.fixed-bg-container-tools {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
    display: flex;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.fixed-bg-container-tools.visible {
    opacity: 1;
}

.fixed-bg-blueprint {
    flex: 1;
    background: linear-gradient(135deg, #0a3b75 0%, #1a5a9e 30%, #487eac 70%, #3a6d99 100%);
    position: relative;
    overflow: hidden;
    transition: flex 0.5s ease;
}

/* Blueprint grid overlay - matching hero style */
.blueprint-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 200%;
    height: 200%;
    background: 
        repeating-linear-gradient(90deg, transparent, transparent 40px, rgba(255,255,255,0.08) 40px, rgba(255,255,255,0.08) 41px),
        repeating-linear-gradient(0deg, transparent, transparent 40px, rgba(255,255,255,0.08) 40px, rgba(255,255,255,0.08) 41px);
    animation: gridMove 20s linear infinite;
}

/* Smaller grid lines for more detail */
.fixed-bg-blueprint::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 200%;
    height: 200%;
    background: 
        repeating-linear-gradient(90deg, transparent, transparent 10px, rgba(255,255,255,0.03) 10px, rgba(255,255,255,0.03) 11px),
        repeating-linear-gradient(0deg, transparent, transparent 10px, rgba(255,255,255,0.03) 10px, rgba(255,255,255,0.03) 11px);
    animation: gridMove 30s linear infinite reverse;
    pointer-events: none;
}

.fixed-bg-parchment {
    flex: 1;
    background: linear-gradient(135deg, #d4c4a8 0%, #e8dcc8 25%, #f5efe5 50%, #e8dcc8 75%, #c9b896 100%);
    position: relative;
    overflow: hidden;
    transition: flex 0.5s ease;
}

/* Parchment texture overlay */
.parchment-texture {
    position: absolute;
    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.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.08;
    mix-blend-mode: multiply;
}

/* Parchment aged edges/vignette */
.fixed-bg-parchment::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse at center, transparent 40%, rgba(139, 119, 85, 0.15) 100%);
    pointer-events: none;
}

/* Subtle stain marks on parchment */
.fixed-bg-parchment::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 30%, rgba(139, 119, 85, 0.08) 0%, transparent 30%),
        radial-gradient(circle at 80% 70%, rgba(139, 119, 85, 0.06) 0%, transparent 25%),
        radial-gradient(circle at 60% 20%, rgba(139, 119, 85, 0.05) 0%, transparent 20%);
    pointer-events: none;
}


/* Section using the tools fixed background */
.split-section.use-fixed-bg-tools .half {
    background: transparent !important;
}

.split-section.use-fixed-bg-tools .half::before,
.split-section.use-fixed-bg-tools .half::after {
    display: none !important;
}

.blueprint-tool-side,
.parchment-tool-side {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

/* SVG container styling */
.svg-container {
    width: 100%;
    max-width: 600px;
    height: 60vh;
    min-height: 300px;
    max-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
}

@supports (height: 100dvh) {
    .svg-container {
        height: 60dvh;
    }
}

.tool-svg {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: center;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
    pointer-events: none;
}

/* SVG visible state */
.tool-svg.animate {
    opacity: 1;
    transform: translateY(0);
}

/* Tool content styling */
.tool-content {
    text-align: center;
    opacity: 0;
    transform: translateY(30px);
}

.tool-content.animate {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.6s ease 0.3s, transform 0.6s ease 0.3s;
}

/* Blueprint side text styling */
.blueprint-tool-side .tool-content h2 {
    font-family: 'Courier New', monospace;
    color: #e8f4ff;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-shadow: 0 0 20px rgba(72, 126, 172, 0.5);
}

.blueprint-tool-side .tool-content .descriptor {
    font-family: 'Courier New', monospace;
    color: rgba(232, 244, 255, 0.7);
    font-size: 1.1rem;
}

/* Parchment side text styling */
.parchment-tool-side .tool-content h2 {
    font-family: 'highest-praise', cursive;
    color: #4a3f2f;
    letter-spacing: 0.05em;
    font-weight: 300;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.5);
}

.parchment-tool-side .tool-content .descriptor {
    font-family: 'Georgia', serif;
    font-style: italic;
    color: rgba(74, 63, 47, 0.8);
    font-size: 1.1rem;
}


/* ========== END BLUEPRINT & PARCHMENT TOOLS SECTION ========== */

/* ========== MORPHING TOOLS SECTION ========== */
/* The morphing section starts like tools-symbols, then morphs to square-compass layout */
.morphing-section .half {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    background: transparent !important;
}


/* SVG container - starts large and centered */
.morphing-section .svg-container {
    width: 100%;
    max-width: 80%;
    height: 35vh;
    min-height: 200px;
    max-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

@supports (height: 100dvh) {
    .morphing-section .svg-container {
        height: 25dvh;
    }
}

/* Tool content wrapper (title) */
.morphing-section .tool-content {
    text-align: center;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.morphing-section .tool-content.animate {
    opacity: 1;
    transform: translateY(0);
}

/* ===== TYPEWRITER EFFECT (The Square) ===== */
.typewriter-text {
    font-family: 'Courier New', monospace;
    color: #e8f4ff;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-shadow: 0 0 20px rgba(72, 126, 172, 0.5);
    display: inline-flex;
    align-items: center;
}

.typewriter-content {
    display: inline;
}


/* ===== PAINTED TEXT EFFECT (The Compass) ===== */
.painted-text {
    font-family: 'highest-praise', cursive;
    font-size: 3rem;
    letter-spacing: 0.05em;
    font-weight: 300;
}

.painted-letter {
    display: inline;
    opacity: 0;
    transition: opacity 0.6s ease-out;
}

.painted-letter.animate {
    opacity: 1;
    color: #4a3f2f;
}

/* Space character */
.painted-letter.space-char {
    opacity: 1;
}

/* Morph details - collapsed by default; animate with opacity/max-height/transform only (no display toggle) */
.morphing-section .morph-details {
    display: block;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    text-align: center;
    transform: translateY(12px);
    pointer-events: none;
    transition: opacity 0.5s ease 0.1s, max-height 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.05s, transform 0.5s ease 0.1s;
}

/* Mobile: show morph-details only on the expanded half - smooth fade + slide-up */
.morphing-section .half.expanded .morph-details {
    opacity: 1;
    max-height: 70vh;
    overflow: visible;
    transform: translateY(0);
    pointer-events: auto;
    padding-bottom: 1.5rem;
    transition: opacity 0.5s ease 0.15s, max-height 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.1s, transform 0.45s ease 0.15s;
}

.morphing-section .half.expanded .morph-details .examples li {
    opacity: 1;
    transform: translateX(0);
}

.morphing-section .half.expanded .morph-details .examples li:nth-child(1) { transition: all 0.4s ease 0.1s; }
.morphing-section .half.expanded .morph-details .examples li:nth-child(2) { transition: all 0.4s ease 0.2s; }
.morphing-section .half.expanded .morph-details .examples li:nth-child(3) { transition: all 0.4s ease 0.3s; }
.morphing-section .half.expanded .morph-details .examples li:nth-child(4) { transition: all 0.4s ease 0.4s; }
.morphing-section .half.expanded .morph-details .examples li:nth-child(5) { transition: all 0.4s ease 0.5s; }

.morphing-section .morph-details .descriptor {
    font-size: 1.3rem;
    opacity: 0.7;
    margin-bottom: 2rem;
    font-style: italic;
}

.morphing-section .morph-details .examples {
    list-style: none;
    font-size: 1.1rem;
    line-height: 2;
}

.morphing-section .morph-details .examples li {
    opacity: 0;
    transform: translateX(-30px);
}

.morphing-section .morph-details .examples li::before {
    content: '▪';
    margin-right: 0.5rem;
    opacity: 0.5;
}

/* ===== MORPHED STATE ===== */
.morphing-section.morphed .svg-container {
    max-width: 70px;
    height: 70px;
    margin-bottom: 1.5rem;
}

.morphing-section.morphed .tool-svg {
    width: 100%;
    height: 100%;
}

.morphing-section.morphed .morph-details {
    opacity: 1;
    max-height: 500px;
}

.morphing-section.morphed .morph-details .examples li {
    opacity: 1;
    transform: translateX(0);
}

/* Staggered animation for list items */
.morphing-section.morphed .morph-details .examples li:nth-child(1) { transition: all 0.4s ease 0.1s; }
.morphing-section.morphed .morph-details .examples li:nth-child(2) { transition: all 0.4s ease 0.2s; }
.morphing-section.morphed .morph-details .examples li:nth-child(3) { transition: all 0.4s ease 0.3s; }
.morphing-section.morphed .morph-details .examples li:nth-child(4) { transition: all 0.4s ease 0.4s; }
.morphing-section.morphed .morph-details .examples li:nth-child(5) { transition: all 0.4s ease 0.5s; }

/* Blueprint side styling */
.morphing-section .blueprint-tool-side .morph-details .descriptor {
    font-family: 'Courier New', monospace;
    color: rgba(232, 244, 255, 0.7);
}

.morphing-section .blueprint-tool-side .morph-details .examples li {
    color: #e8f4ff;
}

.morphing-section .blueprint-tool-side .morph-details .examples li::before {
    color: rgba(232, 244, 255, 0.5);
}

/* Parchment side styling */
.morphing-section .parchment-tool-side .morph-details .descriptor {
    font-family: 'Georgia', serif;
    color: rgba(74, 63, 47, 0.8);
}

.morphing-section .parchment-tool-side .morph-details .examples li {
    color: #4a3f2f;
}

.morphing-section .parchment-tool-side .morph-details .examples li::before {
    color: rgba(74, 63, 47, 0.5);
}


/* ========== END MORPHING TOOLS SECTION ========== */

.coding-side {
    background: #1e1e1e !important;
    position: relative;
}

.coding-side::before {
    display: none;
}

.code-screen {
    background: #252526;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    max-width: 100%;
    opacity: 0;
    transform: translateY(30px) rotateX(10deg);
}

.code-header {
    background: #323233;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.code-dots {
    display: flex;
    gap: 6px;
}

.code-dots span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #5c5c5c;
}

.code-dots span:nth-child(1) {
    background: #ff5f56;
}

.code-dots span:nth-child(2) {
    background: #ffbd2e;
}

.code-dots span:nth-child(3) {
    background: #27c93f;
}

.code-title {
    color: #858585;
    font-size: 0.9rem;
    font-family: 'Courier New', monospace;
}

.code-content {
    padding: 20px;
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
    line-height: 1.6;
    color: #d4d4d4;
}

.line-num {
    color: #858585;
    margin-right: 20px;
    user-select: none;
}

.keyword {
    color: #569cd6;
}

.function {
    color: #dcdcaa;
}

.param {
    color: #9cdcfe;
}

.boolean {
    color: #569cd6;
}

.blueprint-side {
    background: #0d47a1 !important;
    position: relative;
}

.blueprint-side::before,
.blueprint-side::after {
    display: none;
}

.blueprint-content {
    position: relative;
    opacity: 0;
    transform: translateY(30px) rotateX(-10deg);
}

.blueprint-svg {
    filter: drop-shadow(0 0 20px rgba(255,255,255,0.2));
}

.text-morph-section {
    height: 100vh;
    background: linear-gradient(135deg, #1a1a1f 0%, #2a2a32 50%, #1a1a1f 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.text-morph-section::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, 
        transparent 0%, 
        rgba(255, 215, 0, 0.3) 15%,
        rgba(255, 215, 0, 0.5) 50%, 
        rgba(255, 215, 0, 0.3) 85%, 
        transparent 100%);
    z-index: 1;
    box-shadow: 
        0 0 15px rgba(255, 215, 0, 0.2),
        0 0 30px rgba(255, 215, 0, 0.1);
}

.morph-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    position: relative;
    height: 200px;
}

.morph-half-left {
    position: absolute;
    left: 0;
    top: 0;
    width: 50%;
    height: 100%;
    overflow: hidden;
    display: flex;
    align-items: center;
}

.morph-half-right {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    clip-path: inset(0 0 0 50%);
    pointer-events: none;
}

.morph-word {
    position: absolute;
    font-size: clamp(1rem, 6.5vw, 2rem);
    font-weight: 300;
    white-space: nowrap;
    max-width: 40vw;
    overflow: hidden;
    text-overflow: ellipsis;
}

.morph-word.left-word {
    font-family: 'Courier New', monospace;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #a8c5e2;
    text-shadow: 0 0 20px rgba(168, 197, 226, 0.3);
    left: 5%;
}

.morph-word.right-word {
    font-family: 'highest-praise', cursive;
    color: #d4a574;
    text-shadow: 0 0 20px rgba(212, 165, 116, 0.3);
    left: 5%;
}

/* Dimensions Section - Point to Line to Surface to Solid */
.dimensions-section {
    background: linear-gradient(135deg, #0a0a1a 0%, #141428 50%, #0a0a1a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.dimensions-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 30% 30%, rgba(74, 158, 255, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 70% 70%, rgba(217, 70, 239, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

.dimensions-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 1;
}

.dimension-stage {
    position: relative;
    width: 400px;
    height: 400px;
}

.dimensions-section .dimension-stage {
    width: 100%;
    height: 200px;
    max-width: 280px;
    margin: 0 auto;
}

.dim-svg {
    width: 100%;
    height: 100%;
}

/* Vertices (points) */
.vertex {
    fill: #fff;
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.8));
    transition: fill 0.5s ease;
}

/* Edges (lines) */
.edge {
    stroke: #4a9eff;
    stroke-width: 3;
    stroke-linecap: round;
    filter: drop-shadow(0 0 6px rgba(74, 158, 255, 0.6));
    transition: stroke 0.5s ease;
}

/* Cube faces */
.cube-face {
    opacity: 0;
    transition: opacity 0.5s ease;
}

.cube-front { fill: rgba(255, 215, 0, 0.15); }
.cube-top { fill: rgba(255, 215, 0, 0.22); }
.cube-right { fill: rgba(255, 215, 0, 0.18); }
.cube-left { fill: rgba(255, 215, 0, 0.08); }
.cube-back { fill: rgba(255, 215, 0, 0.05); }
.cube-bottom { fill: rgba(255, 215, 0, 0.03); }

/* Color transitions for different phases */
.dimensions-section[data-phase="line"] .edge {
    stroke: #4a9eff;
}

.dimensions-section[data-phase="surface"] .edge {
    stroke: #d946ef;
}

.dimensions-section[data-phase="solid"] .edge {
    stroke: #ffd700;
}

/* Dimension labels */
.dimension-labels {
    display: flex;
    gap: 2rem;
    margin-top: 1rem;
}

.dimensions-section .dimension-labels {
    gap: 0.5rem;
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

.dimensions-section .dim-label .dim-number {
    font-size: 1.1rem;
}

.dimensions-section .dim-label .dim-name {
    font-size: 0.8rem;
}

.dim-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    opacity: 0.2;
    transform: translateY(0);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.dim-label.active {
    opacity: 1;
    transform: scale(1.1);
}

.dim-label .dim-number {
    font-family: 'Courier New', monospace;
    font-size: 1.5rem;
    font-weight: bold;
    letter-spacing: 0.1em;
}

.dim-label .dim-name {
    font-family: 'Georgia', serif;
    font-size: 1rem;
    opacity: 0.7;
    font-style: italic;
}

.dim-label-0d .dim-number { color: #fff; }
.dim-label-1d .dim-number { color: #4a9eff; }
.dim-label-2d .dim-number { color: #d946ef; }
.dim-label-3d .dim-number { color: #ffd700; }
.dim-label-4d .dim-number { color: #00ffaa; }

/* ========== 4D TESSERACT STYLES ========== */
.dimensions-section[data-phase="tesseract"] .edge {
    stroke: #00ffaa;
}

.dimensions-section[data-phase="tesseract"] .vertex {
    fill: #00ffaa;
}

/* Inner cube has slightly different styling */
.vertex-4d {
    filter: drop-shadow(0 0 10px rgba(0, 255, 170, 0.8));
}

.edge-4d {
    filter: drop-shadow(0 0 8px rgba(0, 255, 170, 0.6));
}
/* ========== END 4D TESSERACT STYLES ========== */

.synthesis {
    min-height: 100vh;
    height: auto;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 50%, #0a0a0a 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding: 0.75rem 1rem 0.75rem;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.synthesis::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(255,215,0,0.1) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    animation: pulse 4s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.5; }
    50% { transform: translate(-50%, -50%) scale(1.1); opacity: 0.8; }
}

/* Stars */
.stars-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.stars {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-repeat: repeat;
}

.stars-small {
    background-image: 
        radial-gradient(1px 1px at 20px 30px, rgba(255,255,255,0.8), transparent),
        radial-gradient(1px 1px at 40px 70px, rgba(255,255,255,0.6), transparent),
        radial-gradient(1px 1px at 50px 160px, rgba(255,255,255,0.7), transparent),
        radial-gradient(1px 1px at 90px 40px, rgba(255,255,255,0.5), transparent),
        radial-gradient(1px 1px at 130px 80px, rgba(255,255,255,0.6), transparent),
        radial-gradient(1px 1px at 160px 120px, rgba(255,255,255,0.8), transparent),
        radial-gradient(1px 1px at 200px 50px, rgba(255,255,255,0.5), transparent),
        radial-gradient(1px 1px at 220px 140px, rgba(255,255,255,0.7), transparent),
        radial-gradient(1px 1px at 260px 90px, rgba(255,255,255,0.6), transparent),
        radial-gradient(1px 1px at 300px 170px, rgba(255,255,255,0.8), transparent);
    background-size: 320px 200px;
    animation: starZoomSlow 30s linear infinite, twinkle 4s ease-in-out infinite;
    transform-origin: center center;
}

.stars-medium {
    background-image: 
        radial-gradient(1.5px 1.5px at 100px 50px, rgba(255,255,255,0.9), transparent),
        radial-gradient(1.5px 1.5px at 200px 150px, rgba(255,255,255,0.7), transparent),
        radial-gradient(1.5px 1.5px at 300px 80px, rgba(255,255,255,0.8), transparent),
        radial-gradient(1.5px 1.5px at 400px 200px, rgba(255,255,255,0.6), transparent),
        radial-gradient(1.5px 1.5px at 500px 120px, rgba(255,255,255,0.9), transparent);
    background-size: 600px 300px;
    animation: starZoomMedium 20s linear infinite, twinkle 5s ease-in-out 0.5s infinite;
    transform-origin: center center;
}

.stars-large {
    background-image: 
        radial-gradient(2px 2px at 150px 100px, rgba(255,215,0,0.9), transparent),
        radial-gradient(2px 2px at 400px 250px, rgba(255,215,0,0.7), transparent),
        radial-gradient(2.5px 2.5px at 600px 150px, rgba(255,255,255,1), transparent),
        radial-gradient(2px 2px at 800px 300px, rgba(255,215,0,0.8), transparent);
    background-size: 1000px 400px;
    animation: starZoomFast 12s linear infinite, twinkleBright 3s ease-in-out infinite;
    transform-origin: center center;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

@keyframes twinkleBright {
    0%, 100% { opacity: 0.6; }
    25% { opacity: 1; }
    75% { opacity: 0.4; }
}

/* Zoom forward effect - scale up and reset */
@keyframes starZoomSlow {
    0% { transform: scale(1); opacity: 0.6; }
    100% { transform: scale(1.15); opacity: 0.4; }
}

@keyframes starZoomMedium {
    0% { transform: scale(1); opacity: 0.7; }
    100% { transform: scale(1.25); opacity: 0.3; }
}

@keyframes starZoomFast {
    0% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(1.4); opacity: 0.2; }
}

/* Golden Ratio Spirals */
.golden-spirals-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.golden-spiral {
    position: absolute;
    pointer-events: none;
}

.spiral-1 {
    width: 280px;
    height: 175px;
    bottom: 8%;
    right: 5%;
    animation: rotateSpiral1 120s linear infinite;
}

.spiral-2 {
    width: 180px;
    height: 112px;
    top: 10%;
    left: 8%;
    animation: rotateSpiral2 90s linear infinite;
}

.spiral-3 {
    width: 140px;
    height: 87px;
    top: 15%;
    right: 12%;
    animation: rotateSpiral3 100s linear infinite;
}

.spiral-4 {
    width: 100px;
    height: 62px;
    bottom: 20%;
    left: 15%;
    animation: rotateSpiral4 80s linear infinite;
}

@keyframes rotateSpiral1 {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes rotateSpiral2 {
    from { transform: rotate(0deg); }
    to { transform: rotate(-360deg); }
}

@keyframes rotateSpiral3 {
    from { transform: rotate(45deg); }
    to { transform: rotate(405deg); }
}

@keyframes rotateSpiral4 {
    from { transform: rotate(-30deg); }
    to { transform: rotate(-390deg); }
}

.golden-rect {
    opacity: 0;
}

@keyframes fadeInRect {
    to { opacity: 1; }
}

.golden-spiral-path {
    stroke-dasharray: 450;
    stroke-dashoffset: 450;
}

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

.synthesis-content {
    max-width: 100%;
    padding: 0 0.5rem;
    text-align: center;
    z-index: 1;
    box-sizing: border-box;
    margin: auto;
    width: 100%;
}

.union-heading {
    display: flex;
    align-items: center;
    justify-content: space-evenly;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    opacity: 0;
    transform: translateY(30px);
}

.synthesis h2 {
    font-size: 2rem;
    margin: 0;
    background: linear-gradient(90deg, #4a9eff 0%, #d946ef 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.union-square-svg,
.union-circle-svg {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    overflow: visible;
}

.union-square-path {
    fill: none;
    stroke: #4a9eff;
    stroke-width: 3;
    stroke-linecap: square;
    stroke-dasharray: 160;
    stroke-dashoffset: 160;
    filter: drop-shadow(0 0 6px rgba(74, 158, 255, 0.6));
}

.union-circle-path {
    fill: none;
    stroke: #ffd700;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-dasharray: 126;
    stroke-dashoffset: 126;
    filter: drop-shadow(0 0 6px rgba(255, 215, 0, 0.6));
}

/* Animation triggered when section is in view */
.synthesis.in-view .union-square-path {
    animation: drawUnionSquare 2s ease-out forwards;
}

.synthesis.in-view .union-circle-path {
    animation: drawUnionCircle 2s ease-out 0.3s forwards;
}

@keyframes drawUnionSquare {
    0% {
        stroke-dashoffset: 160;
    }
    100% {
        stroke-dashoffset: 0;
    }
}

@keyframes drawUnionCircle {
    0% {
        stroke-dashoffset: 126;
    }
    100% {
        stroke-dashoffset: 0;
    }
}

.synthesis-intro {
    font-size: 0.9rem;
    opacity: 0;
    margin-bottom: 1rem;
    line-height: 1.5;
    transform: translateY(20px);
}

.synthesis-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
    margin-top: 0.5rem;
    width: 100%;
    max-width: 100%;
    padding: 0 0.25rem;
    box-sizing: border-box;
}

.synthesis-card {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 1rem;
    border-radius: 10px;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(30px);
}

.synthesis-card:hover {
    background: rgba(255,255,255,0.08);
    transform: translateY(-5px) !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.synthesis-card h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: #ffd700;
}

.synthesis-card p {
    font-size: 0.85rem;
    opacity: 0.8;
    line-height: 1.6;
}

/* Short viewport (e.g. iPhone): compress synthesis so grid fits (header size unchanged) */
@media (max-height: 700px) and (max-width: 768px) {
    .synthesis {
        padding: 0.4rem 0.75rem 0.4rem;
    }

    .synthesis-intro {
        font-size: 0.8rem;
        margin-bottom: 0.35rem;
        line-height: 1.4;
    }

    .synthesis-grid {
        gap: 0.35rem;
        margin-top: 0.35rem;
        padding: 0 0.15rem;
    }

    .synthesis-card {
        padding: 0.5rem 0.65rem;
    }

    .synthesis-card h3 {
        font-size: 1rem;
        margin-bottom: 0.25rem;
    }

    .synthesis-card p {
        font-size: 0.75rem;
        line-height: 1.45;
    }

    .synthesis-card .dimensions-section .dimension-stage,
    .dimensions-section .dimension-stage {
        height: 140px !important;
        max-width: 220px;
        margin-bottom: 0.5rem !important;
        transform: scale(1);
    }

    .dimensions-section .dimension-labels {
        gap: 0.35rem;
        font-size: 0.75rem;
        margin-top: 0.35rem;
    }

    .dimensions-section .dim-label .dim-number {
        font-size: 0.95rem;
    }

    .dimensions-section .dim-label .dim-name {
        font-size: 0.7rem;
    }

    /* Contact section: compress for short viewport */
    .contact-section {
        padding: 0.5rem 0.75rem;
    }

    .contact-header {
        margin-bottom: 0.25rem;
    }

    .contact-intro {
        font-size: 0.9rem;
        margin-bottom: 0.35rem;
    }

    .contact-title {
        font-size: 1.5rem;
    }

    .contact-form {
        padding: 0.5rem 0;
    }

    .contact-form .wpcf7-form p {
        margin: 0 0 1rem 0;
    }

    .contact-form .wpcf7-text,
    .contact-form .wpcf7-email,
    .contact-form .wpcf7-textarea {
        padding: 0.75rem 1rem;
    }

    .contact-form .wpcf7-textarea {
        min-height: 72px;
    }

    .contact-form .wpcf7-submit {
        padding: 0.75rem 1.75rem;
        font-size: 0.9rem;
    }

    .contact-form .wpcf7-response-output {
        margin-top: 0.75rem;
        padding: 0.75rem;
        font-size: 0.85rem;
    }

    .contact-footer {
        padding-top: 1rem;
    }

    .contact-footer p {
        font-size: 0.85rem;
    }
}

.content-wrapper {
    pointer-events: auto;
}

/* ========== CONTACT SECTION ========== */
.contact-section {
    min-height: 100vh;
    height: auto;
    background: linear-gradient(135deg, #0a0a0f 0%, #1a1a2e 50%, #0a0a0f 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    z-index: 1;
    padding: 0 1rem;
}

.contact-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 30%, rgba(74, 158, 255, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(212, 165, 116, 0.05) 0%, transparent 40%);
    pointer-events: none;
}

.contact-container {
    max-width: 500px;
    width: 95%;
    z-index: 1;
    text-align: center;
}

.contact-header {
    margin-bottom: 0;
}

.contact-intro {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 0.5rem;
    font-style: italic;
}

.contact-title {
    font-size: 1.8rem;
    font-weight: 300;
    letter-spacing: 0.05em;
    background: linear-gradient(90deg, #a8c5e2 0%, #d4a574 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.contact-form {
    display: flex;
    flex-direction: column;
    padding: 0;
}

.form-group {
    text-align: left;
}

.form-group label {
    display: block;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 0.5rem;
    letter-spacing: 0.05em;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fff;
    font-family: 'Georgia', serif;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: rgba(168, 197, 226, 0.5);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 20px rgba(168, 197, 226, 0.1);
}

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


/* Contact Form 7 Specific Styles */
.contact-form .wpcf7 {
    width: 100%;
    text-align: left;
}

.contact-form .wpcf7-form {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.contact-form .wpcf7-form p {
    margin: 0 0 .5rem 0;
    text-align: left;
}

.contact-form .wpcf7-form label {
    display: block;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 0.5rem;
    letter-spacing: 0.05em;
    text-align: left;
}

.contact-form .wpcf7-form p:has(.wpcf7-submit) {
    margin: 0.5rem 0 0 0;
}

.contact-form .wpcf7-form-control-wrap {
    display: block;
    width: 100%;
    margin-top: 0.5rem;
}

.contact-form .wpcf7-form label br {
    display: block;
    content: "";
    margin-bottom: 0.5rem;
}

.contact-form .wpcf7-text,
.contact-form .wpcf7-email,
.contact-form .wpcf7-textarea {
    width: 100%;
    padding: 1.25rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fff;
    font-family: 'Georgia', serif;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.contact-form .wpcf7-text::placeholder,
.contact-form .wpcf7-email::placeholder,
.contact-form .wpcf7-textarea::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.contact-form .wpcf7-text:focus,
.contact-form .wpcf7-email:focus,
.contact-form .wpcf7-textarea:focus {
    outline: none;
    border-color: rgba(168, 197, 226, 0.5);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 20px rgba(168, 197, 226, 0.1);
}

.contact-form .wpcf7-textarea {
    resize: vertical;
    min-height: 100px;
}

.contact-form .wpcf7-form p:has(.wpcf7-submit) {
    text-align: center;
}

.contact-form .wpcf7-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem 2.5rem;
    background: linear-gradient(135deg, rgba(168, 197, 226, 0.2) 0%, rgba(212, 165, 116, 0.2) 100%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: #fff;
    font-family: 'Georgia', serif;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 0.5rem;
    width: 100%;
}

.contact-form .wpcf7-submit:hover {
    background: linear-gradient(135deg, rgba(168, 197, 226, 0.3) 0%, rgba(212, 165, 116, 0.3) 100%);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.contact-form .wpcf7-spinner {
    margin-left: 1rem;
}

.contact-form .wpcf7-response-output {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
}

.contact-form .wpcf7-validation-errors {
    background: rgba(255, 100, 100, 0.1);
    border: 1px solid rgba(255, 100, 100, 0.3);
    color: #ffaaaa;
}

.contact-form .wpcf7-mail-sent-ok {
    background: rgba(100, 255, 100, 0.1);
    border: 1px solid rgba(100, 255, 100, 0.3);
    color: #aaffaa;
}

.contact-form .wpcf7-not-valid-tip {
    color: #ffaaaa;
    font-size: 0.85rem;
    margin-top: 0.3rem;
    display: block;
}

.submit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem 2.5rem;
    background: linear-gradient(135deg, rgba(168, 197, 226, 0.2) 0%, rgba(212, 165, 116, 0.2) 100%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: #fff;
    font-family: 'Georgia', serif;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 0.5rem;
}

.submit-btn:hover {
    background: linear-gradient(135deg, rgba(168, 197, 226, 0.3) 0%, rgba(212, 165, 116, 0.3) 100%);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.submit-btn .btn-icon {
    transition: transform 0.3s ease;
}

.submit-btn:hover .btn-icon {
    transform: translateX(5px);
}

.contact-footer {
    margin-top: 0;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.contact-footer p {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.4);
    font-style: italic;
}

/* ========== END CONTACT SECTION ========== */

/* Tablet: portfolio grid back to 2-column grid (same as before) */
@media (min-width: 769px) {
    .portfolio-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 1.25rem;
        overflow-x: visible;
        overflow-y: visible;
        -webkit-overflow-scrolling: unset;
        scroll-snap-type: none;
        padding: 0;
        margin: 0;
    }

    .portfolio-card {
        flex-shrink: unset;
        width: auto;
        min-width: unset;
        scroll-snap-align: unset;
    }
}

/* Desktop: portfolio grid 3 columns */
@media (min-width: 993px) {
    .portfolio-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Tablet/desktop overrides (mobile-first: base = mobile above) */
@media (min-width: 769px) {
    .split-section {
        flex-direction: row;
    }

    .hero h1 {
        font-size: 5rem;
    }

    h2 {
        font-size: 3rem;
    }

    .divider {
        left: 50%;
        top: 0;
        bottom: 0;
        width: 3px;
        height: auto;
        transform: scaleY(0);
        transform-origin: center;
    }

    .morph-word {
        font-size: 5rem;
        max-width: none;
        overflow: visible;
        text-overflow: unset;
    }

    .morph-word.left-word,
    .morph-word.right-word {
        left: 0;
    }

    .code-screen {
        max-width: 500px;
    }

    .split-section .half {
        padding: 5rem 3rem;
    }

    .split-section .half.expanded {
        flex: 3;
    }

    .split-section.has-expanded .half:not(.expanded) {
        flex: 1;
    }

    /* Desktop: always show code-design examples in both halves */
    .split-section[data-section="code-design"] .half .examples {
        visibility: visible;
        opacity: 1;
        max-height: none;
        overflow: visible;
        margin: revert;
        padding: revert;
    }

    .fixed-bg-container {
        flex-direction: row;
    }

    .fixed-bg-left,
    .fixed-bg-right {
        width: 50%;
        height: 100%;
        flex: none;
    }

    .fixed-bg-divider {
        left: 50%;
        right: auto;
        top: 0;
        bottom: 0;
        width: 3px;
        height: 100%;
    }

    .fixed-bg-container-tools {
        flex-direction: row;
    }

    .fixed-bg-blueprint,
    .fixed-bg-parchment {
        width: 50%;
        height: 100%;
        flex: none;
    }

    .craft-intro-container {
        padding: 3rem 2rem;
    }

    .craft-intro-container .eyebrow-text {
        font-size: 1rem;
        margin-bottom: 1.25rem;
    }

    .craft-intro-title {
        font-size: 2rem;
        margin-bottom: 1.5rem;
    }

    .craft-intro-sub {
        font-size: 1.1rem;
        line-height: 1.7;
    }

    .webpage-reveal-container {
        padding: 2rem;
        gap: 1.5rem;
    }

    .webpage-reveal-wrapper {
        max-width: 600px;
    }

    .webpage-reveal-svg {
        max-width: 100%;
    }

    .webpage-reveal-caption {
        font-size: 1rem;
    }

    .webpage-code-container {
        padding: 1.5rem;
    }

    .webpage-code-content {
        font-size: 0.85rem;
    }

    .portfolio-container {
        padding: 2rem 2.5rem 3rem;
    }

    .portfolio-header {
        margin-bottom: 2rem;
    }

    .portfolio-section .eyebrow-text {
        font-size: 1rem;
    }

    .portfolio-title {
        font-size: 2.5rem;
    }

    .portfolio-sub {
        font-size: 1.1rem;
    }

    .portfolio-card {
        padding: 1.5rem;
    }

    .portfolio-card__tag {
        font-size: 0.75rem;
        margin-bottom: 0.6rem;
    }

    .portfolio-card__title {
        font-size: 1.25rem;
        margin-bottom: 0.5rem;
    }

    .portfolio-card__desc {
        font-size: 0.9rem;
        margin-bottom: 1rem;
        line-height: 1.5;
    }

    .portfolio-card__link {
        font-size: 0.9rem;
    }

    .portfolio-modal__container {
        width: 90%;
        max-height: 85vh;
    }

    .portfolio-modal__content {
        padding: 2.5rem;
        max-height: calc(85vh - 5rem);
    }

    .portfolio-modal__image-wrapper {
        margin-bottom: 1.5rem;
    }

    .portfolio-modal__close {
        top: 1rem;
        right: 1rem;
        width: 40px;
        height: 40px;
    }

    .portfolio-modal__title {
        font-size: clamp(1.5rem, 3vw, 2rem);
    }

    .portfolio-modal__body {
        font-size: 1rem;
    }

    .blueprint-tool-side,
    .parchment-tool-side {
        padding: 2rem;
        overflow: visible;
    }

    .svg-container {
        max-width: 600px;
        width: 100%;
        height: 60vh;
        min-height: 300px;
        max-height: 500px;
    }

    .morphing-section .svg-container {
        max-width: 600px;
        height: 60vh;
        min-height: 300px;
        max-height: 500px;
    }

    .morphing-section.morphed .svg-container {
        max-width: 180px;
        height: 180px;
    }

    .blueprint-tool-side .tool-content h2,
    .parchment-tool-side .tool-content h2 {
        font-size: 2rem;
        margin-bottom: 0.75rem;
    }

    .tool-content .descriptor {
        font-size: 1rem;
        margin-bottom: 0.75rem;
    }

    .morphing-section .morph-details {
        opacity: 1;
        max-height: none;
        transform: translateY(0);
        overflow: visible;
        pointer-events: auto;
    }

    .contact-title {
        font-size: 2.5rem;
    }

    .contact-intro {
        font-size: 1.2rem;
    }

    .contact-container {
        width: 90%;
    }

    .contact-header {
        margin-bottom: 2.5rem;
    }

    .contact-footer {
        margin-top: 1.5rem;
    }

    .contact-section {
        padding: 0;
    }

    .contact-form {
        padding: 2rem 0;
    }

    .contact-form .wpcf7-form p {
        margin: 0 0 2rem 0;
    }

    .contact-form .wpcf7-submit {
        width: auto;
        padding: 1rem 2.5rem;
    }

    .synthesis-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        max-width: 900px;
        padding: 0 1rem;
    }

    .synthesis-card {
        padding: 1rem;
        font-size: 1rem;
    }

    .synthesis-card h3 {
        font-size: 1.5rem;
        margin-bottom: 0.75rem;
    }

    .synthesis-card p {
        font-size: 0.95rem;
    }

    .synthesis-card svg {
        max-width: 80px;
        height: auto;
        margin-bottom: 0.75rem;
    }

    .dimensions-section .dimension-stage {
        width: 280px;
        height: 280px;
        max-width: none;
        margin: 0 auto;
    }

    .dimensions-section .dimension-labels {
        gap: 0.75rem;
        font-size: 1rem;
        margin-top: 0.5rem;
    }

    .dimensions-section .dim-label .dim-number {
        font-size: 1.5rem;
    }

    .dimensions-section .dim-label .dim-name {
        font-size: 0.9rem;
    }

    .synthesis h2 {
        font-size: 3rem;
    }

    .union-heading {
        gap: 1rem;
    }

    .union-square-svg,
    .union-circle-svg {
        width: 60px;
        height: 60px;
    }

    .synthesis-intro {
        font-size: 1.3rem;
        margin-bottom: 1rem;
    }

    .synthesis {
        padding: 1.5rem 1.5rem 1rem;
        justify-content: center;
    }

    .synthesis-content {
        max-width: 900px;
        width: auto;
        padding: 0;
    }

    .synthesis h2 {
        font-size: 4rem;
    }
}

/* Larger phones: step up morph-word */
@media (min-width: 376px) {
    .morph-word {
        font-size: clamp(1.2rem, 7vw, 2.5rem);
        max-width: 42vw;
    }
}

/* Large phones / small tablets: step up morph-word */
@media (min-width: 481px) {
    .morph-word {
        font-size: clamp(1.5rem, 8vw, 3rem);
        max-width: 45vw;
    }
}
