/* ═══════════════════════════════════════════════════════════
   Jem Teraoka — Resume
   Inspired by julioferracini.vercel.app
═══════════════════════════════════════════════════════════ */

:root {
    --bg-outer: #e8e8e8;
    --bg-outer-card: #f3f3f3;
    --bg-card: #ffffff;
    --text: #121212;
    --text-soft: #4a4a4a;
    --text-muted: #787878;
    --text-faded: #c4c4c4;
    --border: rgba(18, 18, 18, 0.08);
    --pill-bg: rgba(18, 18, 18, 0.05);
    --pill-bg-hover: rgba(18, 18, 18, 0.10);
    --logo-bg: #f1f1f1;
    --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.04);
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

html[data-theme="dark"] {
    --bg-outer: #0a0a0a;
    --bg-outer-card: #1a1a1a;
    --bg-card: #272727;
    --text: #f1f1ef;
    --text-soft: #dcdcda;
    --text-muted: #8a8a8a;
    --text-faded: #3a3a3a;
    --border: rgba(241, 241, 239, 0.08);
    --pill-bg: rgba(241, 241, 239, 0.10);
    --pill-bg-hover: rgba(241, 241, 239, 0.20);
    --logo-bg: #1a1a1a;
    --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.40);
}

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

html, body {
    background: var(--bg-outer);
    color: var(--text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.5s var(--ease), color 0.5s var(--ease);
}

img { max-width: 100%; display: block; }

/* ─── Split-flap (letreiro de aeroporto) ─── */
.flip-text {
    display: inline-block;
    vertical-align: baseline;
    line-height: 1.25;
    white-space: nowrap;
}
.flip-char {
    display: inline-block;
    overflow: hidden;
    position: relative;
    height: 1.25em;
    line-height: 1.25em;
    vertical-align: middle;
}
.flip-char > span {
    display: block;
    transition: transform 0.35s cubic-bezier(0.76, 0, 0.24, 1);
}
.flip-char > span:nth-child(2) { position: absolute; left: 0; top: 100%; }
a:hover .flip-text .flip-char > span,
button:hover .flip-text .flip-char > span,
.flip-text:hover .flip-char > span { transform: translateY(-100%); }
.flip-space { display: inline-block; width: 0.28em; }

/* ─── App shell ─── */
.app {
    min-height: 100vh;
    padding: 5rem 1.5rem 3rem;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    max-width: 1060px;
    margin: 0 auto;
    transition: background-color 0.5s var(--ease);
}

/* ─── Top bar (fixed) ─── */
.topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 0.85rem 1.5rem;
    background: rgba(232, 232, 232, 0.75);
    backdrop-filter: blur(14px) saturate(1.4);
    -webkit-backdrop-filter: blur(14px) saturate(1.4);
    transition: background-color 0.5s var(--ease);
}

html[data-theme="dark"] .topbar {
    background: rgba(10, 10, 10, 0.75);
}

.topbar-inner {
    max-width: 1060px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.pill-group {
    display: flex;
    gap: 8px;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.95rem;
    border-radius: 9999px;
    background: var(--pill-bg);
    color: var(--text);
    font-size: 0.9375rem;
    font-weight: 500;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: background-color 0.25s var(--ease), color 0.25s var(--ease);
    font-family: inherit;
    backdrop-filter: blur(8px);
}

.pill:hover { background: var(--pill-bg-hover); }

.theme-toggle .icon-sun { display: none; }
html[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
html[data-theme="dark"] .theme-toggle .icon-sun { display: inline-block; }

/* ─── Outer card (wraps everything) ─── */
.outer-card {
    background: var(--bg-outer-card);
    border-radius: 24px;
    padding: 32px;
    box-shadow: none;
    border: none;
    transition: background-color 0.5s var(--ease);
}

/* ─── Stack of inner cards ─── */
.stack {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* ─── Inner card (summary / experience / etc.) ─── */
.card {
    background: var(--bg-card);
    border-radius: 18px;
    padding: 2rem 2.25rem;
    transition: background-color 0.5s var(--ease);
    position: relative;
}

.hero-card {
    padding: 2.25rem 2.25rem 1.75rem;
}

/* ─── Hero ─── */
.hero {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 2rem 3rem;
    align-items: start;
}

.hero-identity .name-line {
    font-size: 2.75rem;
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: -0.03em;
    color: var(--text);
    margin-bottom: 0.4rem;
}

.hero-identity .role {
    font-size: 1.375rem;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: -0.01em;
}

.hero-contacts {
    text-align: right;
    padding-top: 0.4rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.hero-contacts p {
    display: inline-flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    color: var(--text);
}

.hero-contacts a {
    color: var(--text);
    text-decoration: underline;
    text-decoration-color: var(--text-faded);
    text-underline-offset: 3px;
    transition: text-decoration-color 0.2s var(--ease);
}

.hero-contacts a:hover { text-decoration-color: var(--text); }

.hero-contacts svg {
    color: var(--text-muted);
    flex-shrink: 0;
}

/* ─── Rows inside cards (summary, experience, etc.) ─── */
.row {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 0.75rem 1.25rem;
    align-items: start;
}

.row-label {
    font-size: 1.0625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0;
    color: var(--text);
}

.row-content p {
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--text-soft);
}

/* ─── Job/Education block (no logos) ─── */
.job {
    display: block;
    margin-bottom: 1.75rem;
}

.job:last-child { margin-bottom: 0; }

.job-logo { display: none; }

.job-body { min-width: 0; }

.job-head {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    margin-bottom: 0.625rem;
}

.job-company {
    font-size: 1.1875rem !important;
    font-weight: 500;
    color: var(--text) !important;
    line-height: 1.3 !important;
}

.job-role {
    font-size: 1rem !important;
    color: var(--text-muted) !important;
    line-height: 1.4 !important;
}

.job-dates {
    font-size: 1rem !important;
    color: var(--text-muted) !important;
    line-height: 1.4 !important;
}

.job-desc {
    font-size: 0.9375rem !important;
    line-height: 1.6 !important;
    color: var(--text-soft) !important;
}

/* ─── Skills ─── */
.skills-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.skill-col p {
    font-size: 0.9375rem;
    line-height: 1.85;
    color: var(--text-muted);
}

.skill-col .skill-head {
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text);
    font-size: 1rem;
}

/* ─── Actions ─── */
.actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.1rem;
    border-radius: 9999px;
    background: var(--pill-bg);
    color: var(--text);
    font-size: 0.9375rem;
    font-weight: 500;
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    transition: background-color 0.25s var(--ease);
}

.action-btn:hover { background: var(--pill-bg-hover); }

/* ─── Responsive ─── */
@media (max-width: 900px) {
    .row {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    .row-label { margin-bottom: 0.25rem; }
}

@media (max-width: 720px) {
    .app { padding: 1rem 1rem 2rem; }

    .card { padding: 2rem 1.5rem 1.75rem; border-radius: 20px; }

    .hero {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .hero-identity .name-line { font-size: 2rem; line-height: 1.2; }
    .hero-identity .role { font-size: 1.125rem; }

    .hero-contacts {
        text-align: left;
        padding-top: 0.75rem;
    }

    .hero-contacts p {
        justify-content: flex-start;
    }

    .divider { margin: 1.75rem 0 1.5rem; }

    .skills-grid { grid-template-columns: 1fr; gap: 1.25rem; }

    .actions { flex-direction: column; align-items: stretch; }
    .action-btn { justify-content: center; }
}

/* ─── Print ─── */
@media print {
    html, body { background: #fff; }
    .topbar, .actions { display: none; }
    .card { box-shadow: none; padding: 1rem; border-radius: 0; }
    .app { padding: 0; max-width: none; }
    .job-logo img { filter: grayscale(1); }
}

/* ─── Subtle entrance ─── */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.card, .topbar {
    animation: fadeUp 0.6s var(--ease) both;
}

.topbar { animation-delay: 0.05s; }
.card { animation-delay: 0.12s; }
