@font-face {
    font-family: "Happiness-Sans-Regular";
    src: url("../fonts/Happiness-Sans-Regular.woff") format("woff");
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: "Tasan-Regular";
    src: url("../fonts/Tasan%20Regular.otf") format("opentype");
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

:root {
    --color-bg: #d5dedd;
    --color-accent: #ff7300;
    --color-basic: #aebab8;
    --color-text-dark: #222;
    --border: var(--border);
}

/* Full-viewport gradient: avoid 100vw (scrollbar), fix edges showing default bg */
html {
    min-height: 100%;
    background: #000000;
    border: none;
    outline: none;
}

body {
    font-family: "Tasan-Regular", sans-serif;
    font-weight: 100;
    font-style: normal;
    letter-spacing: -0.02em;
    margin: 0;
    padding: 0;
    border: none;
    outline: none;
    background: linear-gradient(to bottom, #0400ff 0%, #87CEEB 60%, #f0f8ff 70%, #ffffff 75%, #202020 90%, #000000 100%);
    background-attachment: fixed;
    background-repeat: no-repeat;
    background-size: 101% 101%;
    background-position: center;
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

canvas {
    display: block;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 0;
    pointer-events: auto;
}

#center-text {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--color-text-dark);
    pointer-events: auto;
    z-index: 10;
    user-select: none;
    transition: left 1.5s, top 1.5s, transform 1.5s;
}


/* .eye-outline {
    position: absolute;
    left: 0;
    top: 0;
    width: 320px;
    height: 260px;
    border-radius: 50% / 45%;
    border: 18px solid var(--color-accent);
    box-sizing: border-box;
} */

.eye-pupil {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 90px;
    height: 90px;
    background: none;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
}

.eye-dot {
    position: absolute;
    background: var(--color-accent);
    border-radius: 50%;
    opacity: 0.7;
}

.eye-left .dot1,
.eye-right .dot1 {
    width: 18px;
    height: 18px;
    left: 60px;
    top: 170px;
}

.eye-left .dot2,
.eye-right .dot2 {
    width: 12px;
    height: 12px;
    left: 180px;
    top: 200px;
    opacity: 1.5;
}

.eye-left .dot3,
.eye-right .dot3 {
    width: 8px;
    height: 8px;
    left: 220px;
    top: 60px;
    opacity: 1.5;
}

.clip-text-container {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.clip-text {
    position: absolute;
    top: 0;
    font-size: 10vw;
    line-height: 13vw;
    font-weight: bold;
    color: var(--color-accent);
    /* outer stroke effect using multi-direction text-shadow */
    text-shadow:
        -10px 0 0 black,
        10px 0 0 black,
        0 -10px 0 black,
        0 10px 0 black,
        -7px -7px 0 black,
        -7px 7px 0 black,
        7px -7px 0 black,
        7px 7px 0 black;
    text-align: left;
    word-break: keep-all;
    overflow-wrap: break-word;
    line-height: 1.3;
    max-width: 90vw;
    z-index: 2;
    font-family: "Tasan-Regular", sans-serif;
    white-space: normal !important;
    overflow-wrap: anywhere;
    /* CSS3 권장 */
}

.clip-pupil {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 90px;
    height: 90px;
    background: none;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    pointer-events: none;
    background-color: var(--color-text-dark);
    /* box-shadow: 0 0 30px #001AFF88; */
}

.clip-bg {
    position: fixed;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    background: none;
    z-index: 1;
    clip-path: circle(20vw at 50vw 50vh);
    -webkit-clip-path: circle(20vw at 50vw 50vh);
    transition: clip-path 1s;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

@media (max-width: 600px) {
    .clip-bg {
        clip-path: circle(40vw at 50vw 50vh);
        -webkit-clip-path: circle(40vw at 50vw 50vh);
    }
}

.article-list {
    position: fixed;
    right: 0;
    top: 0;
    width: 28vw;
    height: 100vh;
    overflow: visible;
    padding: 2rem;
    box-sizing: border-box;
    font-family: "Tasan-Regular", sans-serif;
    font-size: 14px;
    color: var(--color-basic);
    /* background: var(--color-bg); */
    line-height: 1.4;
    z-index: 5;
    /* box-shadow: -2px 0 4px rgba(0, 0, 0, 0.2); */
    pointer-events: auto;
}

.article-item {
    position: absolute;
    right: 0;
    width: 240px;
    background: var(--color-bg);
    border: var(--border);
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    padding: 26px 10px 10px 10px;
    /* leave space for window bar */
    pointer-events: auto;
    z-index: 6;
    opacity: 1;
    transition: opacity 1.5s ease;
}

/* macOS style traffic light buttons */
.window-bar {
    position: absolute;
    left: 8px;
    top: 8px;
    height: 12px;
    display: flex;
    gap: 6px;
}

.win-btn {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ff605c;
    /* default red, override individually */
    cursor: pointer;
    display: inline-block;
}

.win-btn.yellow {
    background: #ffbd44;
}

.win-btn.green {
    background: #00ca4e;
}

.article-item {
    word-break: break-all;
}

.article-item h4 {
    margin: 0 0 4px 0;
    font-size: 16px;
}

.article-item .summary {
    margin: 0 0 4px 0;
    font-size: 14px;
    white-space: pre-wrap;
    word-break: break-word;
}

.article-item .meta {
    font-size: 12px;
    color: var(--color-basic);
    display: flex;
    align-items: center;
    gap: 4px;
}

.article-link {
    font-size: 11px;
    font-style: italic;
    color: var(--color-basic);
    pointer-events: none;
    margin-left: 4px;
}

/* ------------------------------------------------------------------ */
/* Press overlay styles moved from index.html */
#press-overlay,
#keep-press-overlay {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: 4rem;
    font-weight: bold;
    font-family: "Tasan-Regular", sans-serif;
    color: var(--color-basic);
    z-index: 20;
    pointer-events: none;
    animation: press-blink 1s steps(2, start) infinite;
    text-shadow:
        -10px 0 0 black,
        10px 0 0 black,
        0 -10px 0 black,
        0 10px 0 black,
        -7px -7px 0 black,
        -7px 7px 0 black,
        7px -7px 0 black,
        7px 7px 0 black;
    text-align: center;
    line-height: 1.2;
}

@keyframes press-blink {

    0%,
    49% {
        opacity: 1;
    }

    50%,
    100% {
        opacity: 0;
    }
}

.fade-out {
    animation: press-fade 0.2s forwards;
}

@keyframes press-fade {
    to {
        opacity: 0;
    }
}

@keyframes flash-bright {
    0% {
        filter: brightness(4);
    }

    100% {
        filter: brightness(1);
    }
}

.flash-bright {
    animation: flash-bright 0.3s ease;
}

/* ------------------------------------------------------------------ */
/* NEW UI Elements */
#menu-bar {
    position: fixed;
    top: 0;
    left: 0;
    padding: 10px 20px;
    font-weight: bold;
    font-size: 16px;
    color: var(--color-accent);
    z-index: 15;
    user-select: none;
}

#menu-bar span {
    margin-right: 16px;
    cursor: pointer;
}

#menu-bar span:hover {
    text-decoration: underline;
    text-decoration-thickness: 1px;
}

#restart-overlay {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3rem;
    font-weight: bold;
    color: var(--color-accent);
    z-index: 30;
    display: none;
    cursor: pointer;
    animation: press-blink 1s steps(2, start) infinite;
}

.about-window {
    position: fixed;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    background: var(--color-bg);
    border: 1px solid var(--color-accent);
    z-index: 25;
    overflow: auto;
}

.about-content {
    padding: 60px 40px;
    color: var(--color-text-dark);
    font-size: 16px;
    line-height: 1.6;
}

/* ------------------------------------------------------------------ */
/* Title follow box */
#title-follow {
    position: fixed;
    z-index: 12;
    background: transparent;
    color: white;
    padding: 4px 6px;
    font: bold 22px "Tasan-Regular", sans-serif;
    max-width: 100px;
    word-break: break-all;
    pointer-events: none;
    transition: left 1.5s ease, top 1.5s ease;
    text-decoration: underline;
    text-decoration-color: black;
    text-decoration-thickness: 1px;
    text-underline-offset: -21px;
}

#link-circle {
    word-break: break-all;
}

/* Image shown 3 seconds after JS runs */
.delayed-image-wrap {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 8;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.8s ease;
  max-width: 90vw;
  max-height: 70vh;
}
.delayed-image-wrap.is-visible {
  opacity: 1;
}
.delayed-image-wrap img {
  display: block;
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
}

/* ------------------------------------------------------------------ */
/* Text Selection Styles */
::selection {
    background-color: #0066cc;
    color: white;
}

::-moz-selection {
    background-color: #0066cc;
    color: white;
}