/* tanso.biz - Hand-drawn circuit diagram on a coastal morning */

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

:root {
    --morning-sand: #f5efe4;
    --driftwood: #d4c4a8;
    --tide-teal: #4a8a7a;
    --coral-flash: #e87461;
    --deep-water: #2a3a4a;
    --offshore-blue: #4a7a9a;
    --seafoam: #a8d8c8;
    --pencil-gray: #5a7a8a;
    --body-text: #3a4a5a;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--morning-sand);
    color: var(--body-text);
    font-family: 'Nunito', sans-serif;
    font-size: 17px;
    line-height: 1.75;
    overflow-x: hidden;
}

.svg-defs {
    position: absolute;
    width: 0;
    height: 0;
}

/* ---- Hero Section ---- */
.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 60px 40px;
    background: linear-gradient(90deg, var(--morning-sand) 0%, var(--morning-sand) 40%, rgba(168,216,200,0.2) 100%);
    overflow: hidden;
}

.hero-left {
    flex: 0 0 40%;
    padding-right: 40px;
}

.hero-right {
    flex: 1;
    display: flex;
    justify-content: center;
}

#hero-title {
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: clamp(2rem, 5vw, 3.5rem);
    color: var(--deep-water);
    margin-bottom: 16px;
}

#hero-title span {
    display: inline-block;
    opacity: 0;
    transform: scale(0.8);
    animation: letterScale 0.3s ease forwards;
}

#hero-title span:nth-child(1) { animation-delay: 0.2s; }
#hero-title span:nth-child(2) { animation-delay: 0.24s; }
#hero-title span:nth-child(3) { animation-delay: 0.28s; }
#hero-title span:nth-child(4) { animation-delay: 0.32s; }
#hero-title span:nth-child(5) { animation-delay: 0.36s; }
#hero-title span:nth-child(6) { animation-delay: 0.40s; }
#hero-title span:nth-child(7) { animation-delay: 0.44s; }
#hero-title span:nth-child(8) { animation-delay: 0.48s; }
#hero-title span:nth-child(9) { animation-delay: 0.52s; }

@keyframes letterScale {
    to { opacity: 1; transform: scale(1); }
}

.hero-tagline {
    font-family: 'Nunito', sans-serif;
    font-weight: 400;
    font-size: 18px;
    color: var(--pencil-gray);
    margin-bottom: 12px;
    opacity: 0;
    animation: fadeIn 0.5s ease forwards 0.8s;
}

.hero-annotation {
    font-family: 'Architects Daughter', cursive;
    font-size: 14px;
    color: var(--pencil-gray);
    opacity: 0;
    animation: fadeIn 0.5s ease forwards 1.2s;
}

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

.circuit-tree {
    width: 100%;
    max-width: 400px;
    height: auto;
}

.tree-draw {
    stroke-dasharray: 500;
    stroke-dashoffset: 500;
    animation: drawPath 2s ease forwards 0.3s;
}

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

/* ---- Wave Transitions ---- */
.wave-transition {
    height: 30px;
    position: relative;
}

.wave-sand {
    background: var(--morning-sand);
    clip-path: ellipse(55% 100% at 50% 0%);
}

.wave-ocean {
    background: var(--seafoam);
    clip-path: ellipse(55% 100% at 50% 0%);
    opacity: 0.3;
}

/* ---- Ocean Sections (full-width, light) ---- */
.ocean-section {
    background: rgba(168, 216, 200, 0.1);
    padding: 80px 20px;
}

.ocean-content {
    max-width: 800px;
    margin: 0 auto;
}

/* ---- Shore Sections (narrow, darker) ---- */
.shore-section {
    background: var(--morning-sand);
    padding: 80px 20px;
}

.shore-content {
    max-width: 700px;
    margin: 0 auto;
}

/* ---- Content Blocks ---- */
.content-block h2 {
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: clamp(1.5rem, 3vw, 2.4rem);
    color: var(--deep-water);
    margin-bottom: 14px;
}

.content-block p {
    margin-bottom: 14px;
}

.tech-data {
    display: block;
    font-family: 'Source Code Pro', monospace;
    font-size: 13px;
    color: var(--tide-teal);
    margin-top: 4px;
}

.annotation-hand {
    display: block;
    font-family: 'Architects Daughter', cursive;
    font-size: 14px;
    color: var(--pencil-gray);
    margin-top: 12px;
}

/* ---- Scale-in animation ---- */
.scale-in {
    opacity: 0;
    transform: scale(0.97);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.scale-in.visible {
    opacity: 1;
    transform: scale(1);
}

/* ---- Trace Connectors ---- */
.trace-connector {
    display: flex;
    justify-content: center;
    padding: 10px 0;
}

.trace-connector svg {
    width: 40px;
    height: 80px;
}

.trace-draw {
    stroke-dasharray: 200;
    stroke-dashoffset: 200;
    transition: stroke-dashoffset 0.8s ease;
}

.trace-connector.visible .trace-draw {
    stroke-dashoffset: 0;
}

/* ---- Card Grid ---- */
.junction-title {
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: clamp(1.5rem, 3vw, 2.4rem);
    color: var(--deep-water);
    text-align: center;
    margin-bottom: 36px;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    max-width: 600px;
    margin: 0 auto;
}

.sketch-card {
    position: relative;
    background: var(--morning-sand);
    padding: 0;
    transition: transform 0.2s ease-out, box-shadow 0.2s ease-out;
    cursor: default;
}

.sketch-card:hover {
    transform: scale(1.03);
    box-shadow: 0 4px 20px rgba(42, 58, 74, 0.12);
}

.card-border {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.card-inner {
    padding: 24px 20px;
    position: relative;
    z-index: 1;
}

.card-icon {
    width: 28px;
    height: 28px;
    margin-bottom: 8px;
}

.card-label {
    display: block;
    font-family: 'Architects Daughter', cursive;
    font-size: 16px;
    color: var(--tide-teal);
    margin-bottom: 6px;
}

.sketch-card p {
    font-size: 14px;
    color: var(--pencil-gray);
    line-height: 1.5;
}

/* ---- Horizon Footer ---- */
.horizon-footer {
    background: linear-gradient(180deg, var(--driftwood) 0%, #a8c8e8 40%, var(--offshore-blue) 100%);
    padding: 80px 20px 40px;
    text-align: center;
}

.footer-content {
    max-width: 500px;
    margin: 0 auto;
}

.footer-tree svg {
    width: 40px;
    height: 60px;
    margin-bottom: 16px;
    animation: treePulse 3s ease-in-out infinite;
}

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

.footer-domain {
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: 22px;
    color: var(--deep-water);
    margin-bottom: 6px;
}

.footer-tagline {
    font-family: 'Architects Daughter', cursive;
    font-size: 15px;
    color: var(--deep-water);
    opacity: 0.7;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .hero-section {
        flex-direction: column;
        padding: 40px 20px;
    }

    .hero-left {
        flex: none;
        padding-right: 0;
        margin-bottom: 30px;
        text-align: center;
    }

    .card-grid {
        grid-template-columns: 1fr;
    }
}
