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

:root {
    --text: #1a1a1a;
    --text-muted: #666;
    --bg: #fafafa;
    --card-bg: #fff;
    --border: #e5e5e5;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --radius: 12px;
    --max-width: 960px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Nav */
header {
    border-bottom: 1px solid var(--border);
    background: var(--card-bg);
}

nav {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--text);
    text-decoration: none;
}

.nav-links { display: flex; gap: 1.5rem; }

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
}

.nav-links a.active,
.nav-links a:hover { color: var(--accent); }

/* Main */
main {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 2rem 1.5rem;
    width: 100%;
    flex: 1;
}

/* Home - Hero */
.hero {
    text-align: center;
    padding: 3rem 0 2rem;
}

.hero h1 {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.tagline {
    color: var(--text-muted);
    font-size: 1.2rem;
    margin-top: 0.5rem;
}

/* Portfolio tiles */
.portfolio { margin-bottom: 3rem; }

.portfolio h2 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
}

.tile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.25rem;
}

.tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.75rem 1.25rem;
    text-decoration: none;
    color: var(--text);
    transition: box-shadow 0.2s, transform 0.2s;
}

.tile:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}

.tile-logo {
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.tile-logo img {
    max-height: 60px;
    max-width: 180px;
    object-fit: contain;
}

.tile h3 {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
}

.tile p {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* Past projects */
.past-projects { margin-bottom: 3rem; }

.past-toggle {
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.75rem 1.25rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    width: 100%;
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: color 0.2s;
}

.past-toggle:hover { color: var(--text); }

.past-toggle .arrow {
    transition: transform 0.2s;
    font-size: 0.8em;
}

.past-projects.open .past-toggle .arrow { transform: rotate(180deg); }

.lab-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
    margin-top: 0;
}

.past-projects.open .lab-content {
    max-height: 2000px;
    margin-top: 1.25rem;
}

.edison-row {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.edison {
    flex-shrink: 0;
    margin: 0;
}

.edison img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    object-position: top;
    border-radius: 50%;
    filter: grayscale(100%);
}

.edison-text {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.edison-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text);
}

.edison-quote {
    font-style: italic;
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.5;
    border: none;
    padding: 0;
    margin: 0;
}

@media (max-width: 600px) {
    .edison-row { flex-direction: column; text-align: center; }
}

/* Era filter buttons */
.era-filters {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 2rem;
}

.era-filters .era-arrow {
    width: 40px;
    height: 2px;
    background: var(--border);
    position: relative;
}

.era-filters .era-arrow::after {
    content: '';
    position: absolute;
    left: -1px;
    top: -4px;
    border: 5px solid transparent;
    border-right-color: var(--border);
}

.era-btn {
    padding: 0.4rem 1rem;
    border: 2px solid var(--border);
    border-radius: 100px;
    background: var(--card-bg);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-muted);
}

.era-btn:hover { border-color: #999; color: var(--text); }

.era-btn[data-era="web1"]  { --era-color: #d97706; }
.era-btn[data-era="saas"]  { --era-color: #2563eb; }
.era-btn[data-era="fintech"] { --era-color: #059669; }
.era-btn[data-era="ai"]    { --era-color: #7c3aed; }

.era-btn.active {
    background: var(--era-color);
    border-color: var(--era-color);
    color: white;
}

/* Era highlight states — applies to both .tile and .lab-item */
.tile, .lab-item { transition: opacity 0.25s, border-color 0.25s, box-shadow 0.25s, max-height 0.3s; }

.tile.era-hidden, .lab-item.era-hidden {
    display: none;
}

.portfolio.era-section-hidden, .past-projects.era-section-hidden {
    display: none;
}

[data-era].era-highlight {
    border-color: var(--border);
    border-top: 3px solid var(--era-active);
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}

[data-era="web1"]  { --era-active: #d97706; }
[data-era="saas"]  { --era-active: #2563eb; }
[data-era="fintech"] { --era-active: #059669; }
[data-era="ai"]    { --era-active: #7c3aed; }

.lab-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.lab-item {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
}

.lab-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;
}

.lab-item h4 {
    font-size: 1rem;
    font-weight: 600;
}

.lab-strategy {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.2rem 0.6rem;
    border-radius: 100px;
    background: #f0f0f0;
    color: var(--text-muted);
}

.lab-item .past-domain {
    display: block;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
}

.lab-item p {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin: 0;
}

.lab-screenshot {
    display: block;
    margin: 0.5rem 0;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--border);
    aspect-ratio: 16 / 9;
}

.lab-screenshot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    display: block;
    opacity: 0.85;
    transition: opacity 0.2s;
}

.lab-screenshot:hover img { opacity: 1; }

.lab-item .past-domain a {
    color: var(--text-muted);
    text-decoration: none;
}

.lab-item .past-domain a:hover {
    color: var(--accent);
    text-decoration: underline;
}

/* Blog index */
.blog-index h1 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
}

.post-list {
    list-style: none;
}

.post-list li { border-bottom: 1px solid var(--border); }

.post-list a {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    padding: 1rem 0;
    text-decoration: none;
    color: var(--text);
    transition: color 0.15s;
}

.post-list a:hover { color: var(--accent); }

.post-list-title {
    font-weight: 600;
    font-size: 1.05rem;
}

.post-list-date {
    color: var(--text-muted);
    font-size: 0.85rem;
    white-space: nowrap;
}

/* Blog post */
.post-page { max-width: 680px; margin: 0 auto; padding: 2rem 1.5rem; }

.post-meta {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.post-page h1 {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.25;
    margin-bottom: 2rem;
}

.post-content h2 { font-size: 1.4rem; font-weight: 700; margin: 2rem 0 0.75rem; }
.post-content h3 { font-size: 1.15rem; font-weight: 700; margin: 1.5rem 0 0.5rem; }
.post-content p { margin-bottom: 1.25rem; }
.post-content ul, .post-content ol { margin: 0 0 1.25rem 1.5rem; }
.post-content li { margin-bottom: 0.4rem; }
.post-content blockquote {
    border-left: 3px solid var(--accent);
    padding: 0.5rem 1rem;
    margin: 1.25rem 0;
    color: var(--text-muted);
    font-style: italic;
}
.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1rem 0;
}
.video-embed {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    margin: 1.5rem 0;
    border-radius: 8px;
}
.video-embed iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}
.post-content a { color: var(--accent); }
.post-content a:hover { text-decoration: underline; }
.post-content figure { margin: 1.5rem 0; }
.post-content figcaption { font-size: 0.85rem; color: var(--text-muted); text-align: center; margin-top: 0.5rem; }

.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.tag {
    background: #f0f0f0;
    padding: 0.25rem 0.75rem;
    border-radius: 100px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.post-nav {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.post-nav a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}

.post-nav a:hover { text-decoration: underline; }

/* Footer */
footer {
    border-top: 1px solid var(--border);
    text-align: center;
    padding: 1.5rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: auto;
}

/* Visually hidden but accessible */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Post figure (cleaned from WordPress) */
.post-figure {
    margin: 1.5rem 0;
}

/* Responsive - tablet */
@media (max-width: 768px) {
    .tile-grid { grid-template-columns: repeat(2, 1fr); }
    .lab-list { grid-template-columns: repeat(2, 1fr); }
    .era-filters .era-arrow { width: 20px; }
}

/* Responsive - mobile */
@media (max-width: 600px) {
    .tile-grid { grid-template-columns: 1fr; }
    .lab-list { grid-template-columns: 1fr; }
    .post-list a { flex-direction: column; gap: 0.25rem; }
    .post-page h1 { font-size: 1.5rem; }
    .era-filters { flex-wrap: wrap; justify-content: center; gap: 0.5rem; }
    .era-filters .era-arrow { display: none; }
    .nav-links { gap: 1rem; }
    .nav-links a { font-size: 0.85rem; }
}
