/* =========================================================
   Buku Kenangan — scrapbook / pinboard theme
   ========================================================= */

:root {
    --paper: #efe6d2;
    --paper-deep: #e3d6b8;
    --paper-line: #d3c3a0;
    --ink: #2b2419;
    --ink-soft: #5c5344;
    --navy: #223b4d;
    --navy-soft: #35566d;
    --mustard: #d8a51d;
    --sage: #6f7d57;
    --berry: #7a2e3a;
    --photo: #fffdf6;
    --shadow-soft: 0 10px 25px rgba(43, 36, 25, 0.18);
}

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

html { scroll-behavior: smooth; }

body {
    font-family: 'Work Sans', sans-serif;
    background-color: var(--paper);
    color: var(--ink);
    overflow-x: hidden;
    background-image:
        radial-gradient(rgba(43, 36, 25, 0.05) 1px, transparent 1px);
    background-size: 22px 22px;
}

::selection { background: var(--mustard); color: var(--ink); }

h1, h2, h3, h4 {
    font-family: 'Fraunces', serif;
    font-weight: 600;
    line-height: 1.1;
}

a { color: inherit; }

/* ---------- reusable bits ---------- */

.eyebrow {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--navy-soft);
}

.scribble {
    display: block;
    width: 150px;
    height: 14px;
    margin-top: 0.35rem;
}

.tape {
    position: absolute;
    width: 70px;
    height: 26px;
    background: linear-gradient(180deg, rgba(216,165,29,0.85), rgba(216,165,29,0.65));
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
    opacity: 0.9;
}

/* ---------- Navbar (notebook tab strip) ---------- */

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 6%;
    background: var(--paper);
    border-bottom: 2px dashed var(--paper-line);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 100;
}

.logo {
    font-family: 'Caveat', cursive;
    font-size: 1.9rem;
    font-weight: 700;
    color: var(--ink);
}

.logo span { color: var(--berry); }

.nav-links {
    display: flex;
    list-style: none;
    gap: 0.4rem;
}

.nav-links a {
    display: inline-block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    text-decoration: none;
    color: var(--ink-soft);
    padding: 0.5rem 0.9rem;
    border: 1px solid transparent;
    border-radius: 6px 6px 0 0;
    transition: 0.25s;
}

.nav-links a:hover {
    color: var(--ink);
    background: var(--paper-deep);
    border-color: var(--paper-line);
}

/* ---------- Hero ---------- */

.hero {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    align-items: center;
    gap: 2rem;
    max-width: 1180px;
    margin: 0 auto;
    padding: 7rem 6% 4rem;
    background-image: repeating-linear-gradient(
        to bottom,
        transparent,
        transparent 38px,
        var(--paper-line) 39px
    );
    background-position: 0 8rem;
}

.hero-content { max-width: 560px; }

.hero h1 {
    font-size: clamp(2.4rem, 5vw, 3.4rem);
    color: var(--ink);
    margin-top: 0.6rem;
}

.hero h1 .gradient-text {
    font-family: 'Caveat', cursive;
    font-weight: 700;
    color: var(--berry);
    font-size: 1.15em;
}

.typewriter {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.05rem;
    color: var(--navy);
    margin: 1.4rem 0 2.2rem;
}

.typewriter::before { content: '// '; color: var(--sage); }

.cursor { animation: blink 0.9s step-end infinite; color: var(--berry); }
@keyframes blink { 50% { opacity: 0; } }

.hero-btns { display: flex; flex-wrap: wrap; gap: 0.9rem; }

/* polaroid photo in hero */
.hero-photo {
    position: relative;
    justify-self: center;
}

.profile-avatar {
    background: var(--photo);
    padding: 14px 14px 46px;
    box-shadow: var(--shadow-soft);
    transform: rotate(-5deg);
    width: 260px;
    position: relative;
}

.profile-avatar img {
    width: 100%;
    height: 260px;
    object-fit: cover;
    display: block;
    filter: sepia(0.12) contrast(1.02);
}

.profile-avatar figcaption {
    font-family: 'Caveat', cursive;
    font-size: 1.3rem;
    color: var(--ink-soft);
    text-align: center;
    margin-top: 0.6rem;
}

.hero-photo .tape {
    top: -14px;
    left: 50%;
    transform: translateX(-50%) rotate(-3deg);
}

/* ---------- Buttons ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.92rem;
    transition: 0.25s;
    cursor: pointer;
    border: 2px solid var(--ink);
}

.btn-primary {
    background: var(--navy);
    color: var(--photo);
    border-color: var(--navy);
    box-shadow: 3px 3px 0 var(--ink);
}

.btn-primary:hover {
    transform: translate(-2px, -2px);
    box-shadow: 5px 5px 0 var(--ink);
}

.btn-secondary {
    background: transparent;
    color: var(--ink);
    box-shadow: 3px 3px 0 var(--paper-line);
}

.btn-secondary:hover {
    transform: translate(-2px, -2px);
    box-shadow: 5px 5px 0 var(--paper-line);
    background: var(--paper-deep);
}

/* ---------- Containers & section titles ---------- */

.container {
    max-width: 1100px;
    margin: 4rem auto;
    padding: 0 6%;
}

.section-title {
    font-size: clamp(1.8rem, 3.4vw, 2.3rem);
    margin-bottom: 2.2rem;
    position: relative;
}

.section-title span {
    font-family: 'Caveat', cursive;
    color: var(--berry);
    font-weight: 700;
}

/* ---------- About: diary entry card ---------- */

.glass-card {
    background: var(--photo);
    border: 1px solid var(--paper-line);
    border-radius: 3px;
    padding: 2.4rem 2.2rem;
    box-shadow: var(--shadow-soft);
    position: relative;
}

.about-grid p {
    font-size: 1.02rem;
    line-height: 1.75;
    color: var(--ink-soft);
    max-width: 640px;
}

.info-tags {
    display: flex;
    gap: 0.7rem;
    flex-wrap: wrap;
    margin-top: 1.6rem;
}

.info-tags span {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    background: var(--paper-deep);
    border: 1px dashed var(--sage);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    color: var(--sage);
}

.info-tags i { margin-right: 0.35rem; }

/* ---------- Gallery: corkboard of polaroids ---------- */

#gallery.container {
    background: var(--paper-deep);
    border-radius: 6px;
    padding: 3rem 5% 3.5rem;
    box-shadow: inset 0 0 40px rgba(43,36,25,0.08);
}

.filter-buttons {
    display: flex;
    justify-content: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin-bottom: 2.6rem;
}

.filter-btn {
    background: var(--paper);
    border: 1px solid var(--ink);
    color: var(--ink);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    padding: 0.45rem 1.1rem;
    border-radius: 20px;
    cursor: pointer;
    transition: 0.25s;
}

.filter-btn.active, .filter-btn:hover {
    background: var(--navy);
    color: var(--photo);
    border-color: var(--navy);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 2.2rem 1.8rem;
}

.gallery-card {
    position: relative;
    background: var(--photo);
    padding: 10px 10px 38px;
    box-shadow: var(--shadow-soft);
    cursor: pointer;
    transition: transform 0.35s ease, box-shadow 0.35s ease;
    height: auto;
}

.gallery-card:nth-child(4n+1) { transform: rotate(-3deg); }
.gallery-card:nth-child(4n+2) { transform: rotate(2.5deg); }
.gallery-card:nth-child(4n+3) { transform: rotate(-1.5deg); }
.gallery-card:nth-child(4n+4) { transform: rotate(3deg); }

.gallery-card:hover {
    transform: rotate(0deg) translateY(-6px) scale(1.03);
    box-shadow: 0 18px 30px rgba(43,36,25,0.25);
    z-index: 5;
}

.gallery-card::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%) rotate(-2deg);
    width: 54px;
    height: 20px;
    background: rgba(216,165,29,0.8);
    box-shadow: 0 2px 3px rgba(0,0,0,0.15);
}

.gallery-card img {
    width: 100%;
    height: 190px;
    object-fit: cover;
    display: block;
    filter: sepia(0.1) contrast(1.02);
}

.gallery-card .overlay {
    position: static;
    background: none;
    opacity: 1;
    display: block;
    text-align: center;
    padding-top: 0.7rem;
    transition: none;
}

.overlay i { display: none; }

.overlay h4 {
    font-family: 'Caveat', cursive;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--ink);
}

.overlay p {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--sage);
    margin-top: 0.15rem;
}

/* ---------- Lightbox ---------- */

.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(43, 36, 25, 0.82);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 1.5rem;
}

.lightbox.active { display: flex; }

.lightbox-content {
    background: var(--photo);
    padding: 1.4rem 1.4rem 1.8rem;
    max-width: 460px;
    width: 100%;
    text-align: center;
    box-shadow: 0 25px 60px rgba(0,0,0,0.4);
    transform: rotate(-1.5deg);
}

.lightbox-content img {
    width: 100%;
    max-height: 320px;
    object-fit: cover;
    margin-bottom: 1.1rem;
}

.lightbox-content h3 {
    font-family: 'Caveat', cursive;
    font-size: 1.6rem;
    color: var(--ink);
}

.lightbox-content p {
    font-size: 0.92rem;
    color: var(--ink-soft);
    margin-top: 0.4rem;
    line-height: 1.5;
}

.close-lightbox {
    position: absolute;
    top: 22px;
    right: 32px;
    color: var(--photo);
    font-size: 2.2rem;
    cursor: pointer;
    line-height: 1;
}

/* ---------- Contact: postcard ---------- */

.contact-box {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 2rem;
    align-items: start;
}

.contact-box::after {
    content: '';
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    width: 70px;
    height: 84px;
    border: 2px dashed var(--berry);
    border-radius: 4px;
    background: repeating-linear-gradient(45deg, transparent, transparent 6px, rgba(122,46,58,0.08) 6px, rgba(122,46,58,0.08) 12px);
}

.contact-box form {
    grid-column: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.contact-box input, .contact-box textarea {
    font-family: 'Work Sans', sans-serif;
    background: transparent;
    border: none;
    border-bottom: 2px solid var(--paper-line);
    padding: 0.6rem 0.2rem;
    color: var(--ink);
    outline: none;
    font-size: 1rem;
    transition: 0.25s;
}

.contact-box textarea { resize: vertical; }

.contact-box input:focus, .contact-box textarea:focus {
    border-color: var(--navy);
}

.contact-box input::placeholder, .contact-box textarea::placeholder {
    color: var(--ink-soft);
    opacity: 0.6;
}

.contact-box .btn { align-self: flex-start; margin-top: 0.4rem; }

.toast {
    grid-column: 1 / -1;
    margin-top: 0.5rem;
    padding: 0.7rem 1rem;
    background: var(--sage);
    color: var(--photo);
    border-radius: 4px;
    text-align: center;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
}

.hidden { display: none; }

/* ---------- Footer ---------- */

footer {
    text-align: center;
    padding: 2.2rem;
    border-top: 2px dashed var(--paper-line);
    color: var(--ink-soft);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
}

/* ---------- Motion ---------- */

@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; }
}

.gallery-card, .profile-avatar {
    animation: settle 0.6s ease both;
}

.gallery-card:nth-child(1) { animation-delay: 0.05s; }
.gallery-card:nth-child(2) { animation-delay: 0.12s; }
.gallery-card:nth-child(3) { animation-delay: 0.19s; }
.gallery-card:nth-child(4) { animation-delay: 0.26s; }

@keyframes settle {
    from { opacity: 0; transform: translateY(14px) rotate(0deg); }
}

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
    .hero {
        grid-template-columns: 1fr;
        text-align: center;
        padding-top: 8rem;
    }
    .hero-content { margin: 0 auto; }
    .hero-btns { justify-content: center; }
    .hero-photo { order: -1; }
    .nav-links { gap: 0.1rem; }
    .nav-links a { padding: 0.4rem 0.5rem; font-size: 0.7rem; }
    .contact-box { grid-template-columns: 1fr; }
    .contact-box::after { display: none; }
}

@media (max-width: 480px) {
    .navbar { padding: 0.9rem 5%; }
    .logo { font-size: 1.5rem; }
}

/* focus visibility */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
    outline: 2px solid var(--navy);
    outline-offset: 2px;
}
