/* Layout: single dark column, fixed pill nav, portrait hero, staggered skill cards, expertise table with level bars. Dark-first, one committed look. */
@view-transition {
  navigation: auto;
}

:root {
  /* Reusable colors: change a value here to update every rule that uses that variable. */
  --bg: #101010;
  --panel: #121514;
  --panel-2: #171a18;
  --line: #202422;
  --ink: #dfe8e2;
  --sage: #a9c5b6;
  --mute: #868e8a;
  --dim: #4d5551;
  --green: #8dffbb;
  --green-deep: #2f8f66;
  --pill: #4e7d61;
  --bar: #3f8fd0;
  --track: #2a2e2c;
  /* Reusable font families, with backup fonts in case the preferred font is unavailable. */
  --f-display: "Space Grotesk", "Helvetica Neue", Arial, sans-serif;
  --f-mono: "Space Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --f-jp: "Noto Sans JP", "Hiragino Sans", "Yu Gothic", sans-serif;
  /* Shared page gutter: at least 20px, grows with the screen, and stops at 64px. */
  --gut: clamp(20px, 6vw, 64px);
  /* Ask the browser to use dark-themed built-in controls and scrollbars. */
  color-scheme: dark;
}
/* Include padding and borders inside an element's declared width and height. */
* { box-sizing: border-box; }
/* Remove the browser's default outer spacing from the page. */
body { margin: 0; }
/* Prevent images from overflowing their containing elements. */
img { max-width: 100%; }
/* Keep elements marked hidden (including browser-hidden menu content) out of layout. */
[hidden] { display: none !important; }
/* Stack the two views so they can crossfade without changing the page layout. */
main { display: grid; }
#infoPage, #workPage {
  grid-area: 1 / 1;
  opacity: 0;
  transition: opacity 320ms ease;
}
#infoPage.is-visible, #workPage.is-visible {
  opacity: 1;
}
/* Animate jumps to in-page links; a reduced-motion rule below disables this when requested. */
html { scroll-behavior: smooth; }
body {
  /* Set the page's default background, text color, font, and text sizing. */
  background: var(--bg);
  color: var(--mute);
  font-family: var(--f-display);
  font-size: 14px;
  line-height: 1.6;
  /* Hide sideways overflow and smooth text edges on supported browsers. */
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
/* Links inherit their surrounding text color and have no underline by default. */
a { color: inherit; text-decoration: none; }
/* Make keyboard-focused links and buttons visible without relying on color alone. */
a:focus-visible, button:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; border-radius: 4px; }
/* Remove default margins and padding so spacing can be controlled by the page styles. */
h1, h2, h3, p, ul { margin: 0; padding: 0; }
/* Remove the browser's default bullet points from lists. */
ul { list-style: none; }


/* ---------- This is for right side and left side space entire website ---------- */

.wrap {
  width: 100%; /* Use the full available width when the screen is narrow. */
  max-width: 1180px; /* Stop the content from becoming too wide on large screens. */
  margin-inline: auto; /* Center the container horizontally when it is narrower than the screen. */
  padding-left: max(var(--gut), env(safe-area-inset-left, 0px)); /* Keep content away from the left edge and phone safe area. */
  padding-right: max(var(--gut), env(safe-area-inset-right, 0px)); /* Keep content away from the right edge and phone safe area. */
  position: relative; /* Let absolutely positioned children use this container as their positioning reference. */
}

/* ---------- Fixed header and navigation ---------- */
.top {
  /* Keep the header at the top while scrolling; z-index places it above page content. */
  position: fixed; top: env(safe-area-inset-top, 0px); left: 0; right: 0; z-index: 110;
  /* Add space inside the header and animate its appearance when its scrolled class is added. */
  padding-block: 18px;
  transition: background .3s, backdrop-filter .3s;
}
/* Add a translucent blurred background after scrolling for header readability. */
.top.scrolled { background: rgba(11,13,12,.78); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
body.project-modal-open .top { visibility: hidden; }
/* Divide header into logo, centered navigation, and right-aligned tools. */
.top .wrap { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
.logo {
  /* Style the logo text and place it at the left of its grid column. */
  font-family: var(--f-mono); font-size: clamp(13px, 2.6vw, 17px); letter-spacing: .05em;
  color: var(--green-deep); text-shadow: 0 0 10px rgba(47,143,102,.45); justify-self: start;
}

.logo img {
  /* Display the logo image at a fixed desktop width and nudge it slightly left. */
  display: block;
  width: 150px;
  height: auto;
  transform: translateX(-18px);
}

.pill {
  /* Make the navigation links a centered rounded row with space and a dark pill background. */
  position: relative; display: inline-flex; gap: 4px; padding: 5px; border-radius: 999px;
  background: #181715; box-shadow: 0 0 0 1px #1e2220, 0 8px 26px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.03);
}
.pill::before {
  content: ""; position: absolute; z-index: 0; top: 5px; bottom: 5px;
  left: var(--indicator-left, 5px); width: var(--indicator-width, 0);
  border-radius: 999px; background: var(--pill);
  box-shadow: 0 0 10px rgba(47, 232, 159, 0.55);
  pointer-events: none;
}
.pill[data-indicator-ready="true"]::before {
  transition: left .35s cubic-bezier(.2,.8,.2,1), width .35s cubic-bezier(.2,.8,.2,1);
}
.pill a {
  /* Give each navigation link comfortable click space and a smooth hover/active transition. */
  position: relative; z-index: 1;
  font-size: 14px; font-weight: 500; color: #d3d2c9; padding: 7px 24px; border-radius: 999px;
  transition: color .25s;
}
.pill a:hover { color: var(--green); }
/* Highlight the currently active navigation link. */
.pill a.on { color: #e7f5ec; }
/* Align language and menu buttons in a row at the right side of the header. */
.tools { justify-self: end; display: flex; align-items: center; gap: 14px; position: relative; }
.lang-btn {
  /* Make the language switch look like a compact outlined pill button. */
  font-family: var(--f-jp); font-size: 12px; color: #b5beb9; background: none; border: 1px solid #262b28; border-radius: 999px;
  padding: 4px 12px; cursor: pointer; line-height: 1.4; transition: color .2s, border-color .2s, background .2s;
}
.lang-btn:hover { color: var(--green); border-color: var(--green-deep); background: rgba(63,224,143,.06); }
.dots-btn {
  /* Center the menu dots inside a 28px button while removing default button styling. */
  width: 28px; height: 28px; display: grid; place-items: center; background: none; border: 0; cursor: pointer; color: #b5beb9;
}
.dots-btn svg { width: 12px; height: 12px; fill: currentColor; }
.dots-btn:hover { color: var(--green); }
.drawer-backdrop {
  position: fixed;
  z-index: 1999;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms ease;
}
.drawer-backdrop.open { opacity: 1; pointer-events: auto; }
.nav-drawer {
  position: fixed;
  z-index: 2000;
  top: 0;
  right: 0;
  display: flex;
  width: min(100%, 380px);
  height: 100vh;
  height: 100dvh;
  flex-direction: column;
  justify-content: space-between;
  padding: 40px 32px;
  transform: translateX(100%);
  background: #0f1311;
  border-left: 1px solid var(--line);
  box-shadow: -20px 0 50px rgba(0, 0, 0, 0.8);
  transition: transform 400ms cubic-bezier(.16, 1, .3, 1);
}
.nav-drawer.open { transform: translateX(0); }
.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}
.drawer-title {
  color: var(--green);
  font-family: var(--f-display);
  font-size: 14px;
  letter-spacing: .2em;
  text-transform: uppercase;
}
.drawer-close {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--mute);
  cursor: pointer;
  font-size: 24px;
  transition: color 150ms ease, background 150ms ease;
}
.drawer-close:hover { color: #fff; background: rgba(255, 255, 255, .05); }
.drawer-links { display: flex; flex-direction: column; gap: 20px; margin: 40px 0; }
.drawer-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #c3cdc7;
  font-family: var(--f-display);
  font-size: 22px;
  font-weight: 600;
  transition: color 150ms ease, transform 150ms ease;
}
.drawer-link .number {
  color: var(--green);
  font-family: var(--f-display);
  font-size: 12px;
  opacity: .6;
}
.drawer-link:hover { color: var(--green); transform: translateX(6px); }
.drawer-footer {
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--dim);
  font-family: var(--f-mono);
  font-size: 11px;
}
.drawer-footer p:first-child { color: var(--green); }
.drawer-footer p + p { margin-top: 4px; color: var(--dim); }




/* =========================================
   GLITCH IMAGE LAYERS
========================================= */

.glitch-image {
    /* Stack the duplicate images over the hero, cropped to fill it without blocking clicks. */
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    object-position: var(--hero-image-position);
    z-index: 3;
    pointer-events: none;
    opacity: 0;
}


/* =========================================
   RED GLITCH
========================================= */

.glitch-red {
    /* Blend the red-tinted duplicate with the image and run its repeating glitch animation. */
    mix-blend-mode: screen;

    animation:
        glitch-red 4s infinite;
}


@keyframes glitch-red {

    /* Keep this layer hidden at the start, end, and most of each animation cycle. */
    0%,
    80%,
    100% {

        opacity: 0;

        transform: translateX(0);

        clip-path:
            inset(0 0 0 0);
    }


    /* Briefly reveal and shift cropped image strips to create the red glitch effect. */
    81% {

        opacity: 0.8;

        transform:
            translateX(-12px);

        clip-path:
            inset(15% 0 70% 0);
    }


    82% {

        opacity: 0.6;

        transform:
            translateX(10px);

        clip-path:
            inset(50% 0 30% 0);
    }


    83% {

        opacity: 0.8;

        transform:
            translateX(-7px);

        clip-path:
            inset(70% 0 15% 0);
    }


    84% {

        opacity: 0;

        transform:
            translateX(0);
    }
}


/* =========================================
   BLUE GLITCH
========================================= */

.glitch-blue {

    mix-blend-mode: screen;

    animation:
        glitch-blue 4s infinite;

}


@keyframes glitch-blue {

    /* Keep this layer hidden at the start, end, and most of each animation cycle. */
    0%,
    84%,
    100% {

        opacity: 0;

        transform:
            translateX(0);

        clip-path:
            inset(0 0 0 0);
    }


    /* Briefly reveal and shift cropped image strips to create the blue glitch effect. */
    85% {

        opacity: 0.8;

        transform:
            translateX(12px);

        clip-path:
            inset(30% 0 50% 0);
    }


    86% {

        opacity: 0.6;

        transform:
            translateX(-15px);

        clip-path:
            inset(65% 0 20% 0);
    }


    87% {

        opacity: 0.8;

        transform:
            translateX(7px);

        clip-path:
            inset(10% 0 75% 0);
    }


    88% {

        opacity: 0;

        transform:
            translateX(0);
    }
}


/* =========================================
   GLITCH BARS
========================================= */

.glitch-bars {
    /* Place the decorative glitch-line layer over the hero without intercepting clicks. */
    position: absolute;
    inset: 0;
    z-index: 4;
    pointer-events: none;
}


/* Create two initially invisible horizontal lines; their animations make them flicker. */

.glitch-bars::before,
.glitch-bars::after {

    /* Pseudo-elements draw decorative lines without adding extra HTML elements. */
    content: "";

    position: absolute;

    left: 0;
    width: 100%;
    height: 0px;
    background: rgb(20, 81, 49);
    opacity: 0;
}

.glitch-bars::before {
    /* Place the first animated line one quarter down the hero. */
    top: 25%;
    animation: glitch-bar-before 4s infinite;
}

.glitch-bars::after {
    /* Place the second animated line lower in the hero. */
    top: 68%;
    animation: glitch-bar-after 4s infinite;
}

@keyframes glitch-bar-before {
    /* Briefly flash and shift the first line, then return it to its hidden state. */
    0%, 80%, 100% { opacity: 0; transform: translateX(0); }
    81% { opacity: .99; transform: translateX(-8px); }
    82% { opacity: .35; transform: translateX(12px); }
    83% { opacity: 0; transform: translateX(0); }
}

@keyframes glitch-bar-after {
    /* Briefly flash and shift the second line at a different time from the first. */
    0%, 84%, 100% { opacity: 0; transform: translateX(0); }
    85% { opacity: .99; transform: translateX(10px); }
    86% { opacity: .25; transform: translateX(-12px); }
    87% { opacity: 0; transform: translateX(0); }
}

/* ---------- Hero ---------- */
/* Make the hero a fixed-height positioning area and clip layers that extend beyond it. */
.hero { --hero-image-position: center; position: relative; height: clamp(310px, 52vw, 500px); overflow: hidden; }
.hero::before {
  /* Add a soft radial glow behind the hero image without blocking mouse or touch input. */
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(ellipse 46% 70% at 28% 34%, rgba(92,96,74,.34), transparent 70%);
  pointer-events: none;
  z-index: 0;
}
.hero::after {
  /* Fade the bottom of the hero into the page background. */
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 30%; z-index: 2;
  background: linear-gradient(to bottom, transparent, var(--bg));
  pointer-events: none;
}
/* Let the hero's wrap fill its height; static positioning allows hero items to align to the hero. */
.hero .wrap { height: 100%; position: static; }
.portrait {
  /* Stretch the portrait across the hero and crop it to fill the area. */
  position: absolute; inset: 0; height: 100%; width: 100%; max-width: none;
  object-fit: cover; object-position: var(--hero-image-position);
  z-index: 1;
}
/* Place the small role/caption block near the lower-left content edge. */
.hero-cap { position: absolute; left: max(0px, calc((100% - 1180px) / 2)); box-sizing: border-box; width: min(100%, 1180px); padding-inline: max(var(--gut), env(safe-area-inset-left, 0px)); bottom: 38px; z-index: 5; display: flex; flex-direction: column; align-items: flex-start; text-align: left; font-family: var(--f-mono); }
/* Display the main hero caption as a separate line. */
.hero-cap b { display: block; font-weight: 400; font-size: clamp(11px, 1.7vw, 14px); color: #c7d0cb; letter-spacing: .06em; }
/* Style the smaller supporting line below the hero caption. */
.hero-cap span { display: block; font-size: clamp(8.5px, 1.4vw, 11px); color: var(--green-deep); letter-spacing: .05em; margin-top: 4px; }
.hero-links {
  /* Anchor the social/expertise links to the lower-right content edge. */
  position: absolute; 
  right: calc(max(0px, (100vw - 1180px) / 2) + max(var(--gut), env(safe-area-inset-right, 0px)));; 
  bottom: clamp(26px, 5vw, 56px);
  width: clamp(96px, 16vw, 160px); 
  z-index: 5; 
  font-family: var(--f-mono); 
  text-align: center;
 
}
.hero-links a { display: block; padding: 5px 0; font-size: clamp(14px, 1.9vw, 20px); letter-spacing: .08em; color: #b9d4c5; transition: color .2s, text-shadow .2s; }
/* Give the first hero link extra emphasis. */
.hero-links a:first-child { color: var(--green); text-shadow: 0 0 12px rgba(63,224,143,.45); }
/* Brighten links on hover. */
.hero-links a:hover { color: #fff; text-shadow: 0 0 12px rgba(130, 255, 201, 0.999); }
.hero-links i {
  /* Draw the glowing slanted bar below the hero links. */
  display: block; height: 8px; margin-top: 12px; border-radius: 0px; background: var(--green);
  box-shadow: 0 0 14px rgba(255, 255, 255, 0.7);
  transform: skewX(-20deg);  /* edges narrow */
}
.chev { display: flex; justify-content: space-evenly; padding-block: 6px 4px; color: var(--green); z-index: 100; }
.chev a { padding: 8px 14px; display: block; animation: bob 2s ease-in-out infinite; }
.chev svg { width: 20px; height: 20px; stroke: currentColor; fill: var(--green); stroke-width: 1.8; }
.chev p { margin-left: 4px; font-size: clamp(10px, 1.6vw, 13px); color: #565e5a; letter-spacing: .05em; text-align: center; }
.hero-controls { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; }
.hero-controls .chev { grid-column: 2; grid-row: 1; justify-self: center; }
.hero-controls .StarXAbutton { grid-column: 3; grid-row: 1; width: auto; max-width: none; margin: 0; padding: 0; justify-self: end; justify-content: flex-start; }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(5px); } }


.Musichint {
  margin: 0;
  color: var(--green);
  font-family: var(--f-mono);
  font-size: clamp(9px, 1.6vw, 13px);
  letter-spacing: 1px;
  white-space: nowrap;
  text-shadow: 0 0 8px rgba(141, 255, 187, 0.65);
  transition: opacity 3500ms ease, visibility 0s linear 3500ms;
}
.Musichint.is-hidden { opacity: 0; visibility: hidden; }
.music-hint-arrow { display: inline-block; margin-left: 4px; color: var(--green); font-family: var(--f-mono); text-shadow: 0 0 8px rgba(141, 255, 187, 0.65); }



/* ---------- Shared section and decoration styles ---------- */
/* Leave room above sections when navigating to them from the fixed header. */
section { scroll-margin-top: 74px; }
/* Align a short green rule and long gray rule in one row below section headings. */
.rule { display: flex; align-items: center; margin-bottom: clamp(26px, 5vw, 44px); }
/* Short glowing green part of the shared heading rule. */
.rule::before { content: ""; width: clamp(26px, 4.6vw, 40px); height: 2px; background: var(--green); box-shadow: 0 0 10px rgba(63,224,143,.65); flex: none; }
/* Long gray part fills the remaining heading-rule space. */
.rule::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.big {
  /* Large, bold, uppercase heading that scales between phone and desktop sizes. */
  font-weight: 700; font-size: clamp(34px, 6.6vw, 78px); line-height: 1; letter-spacing: -.01em;
  color: var(--sage); text-transform: uppercase; text-wrap: balance;
}
/* Place the small decorative X against the right side of its positioned section. */
.x { position: absolute; right: max(var(--gut), env(safe-area-inset-right, 0px)); width: 20px; height: 20px; color: #2b302d; }
/* Size and style the X's SVG drawing to match the surrounding text color. */
.x svg { width: 100%; height: 100%; stroke: currentColor; stroke-width: 2; }
/* Shared positioning and visibility for non-interactive decorative graphics. */    
.deco { position: absolute; pointer-events: none; opacity: .5; }
.deco path, .deco line { stroke: #1f6b49; fill: none; stroke-width: 1; }
.deco rect { fill: #1f6b49; }

/* ---------- About ---------- */
/* Add responsive vertical spacing and establish a positioning context for decorations. */
.about { padding-block: clamp(10px, 2vw, 60px) clamp(10px, 2vw, 64px); position: relative; z-index: 10; }
/* Style the About heading. */
.about h2 { font-size: clamp(17px, 2.7vw, 26px); font-weight: 700; color: var(--sage); letter-spacing: .01em; margin-bottom: 22px; text-transform: uppercase; }
.about-heading { display: flex; align-items: baseline; gap: 14px; margin-bottom: 24px; }
.about-heading h2 { margin: 0; }
.about-index { color: var(--green-deep); font-family: var(--f-mono); font-size: 10px; letter-spacing: .12em; }
.about-layout { display: grid; gap: clamp(16px, 2vw, 24px); }
.about-more-toggle { display: none; }
.about-more-toggle svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.5; transition: transform 180ms ease; }
.about-expanded .about-more-toggle svg { transform: rotate(180deg); }
@keyframes about-more-glow {
  0%, 100% { text-shadow: 0 0 0 rgba(141, 255, 187, 0); }
  50% { text-shadow: 0 0 8px rgba(141, 255, 187, .6); }
}
@keyframes about-more-move {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -3px; }
}
.about h2,
.what .big,
.skills .big,
.exp .big { transition: color 700ms ease, text-shadow 700ms ease; }
.about h2:hover,
.what .big:hover,
.skills .big:hover,
.exp .big:hover {
  color: var(--green);
  text-shadow: 0 0 8px rgba(63, 224, 143, 0.45);
  transition-duration: 180ms;
}
/* Set readable paragraph width, size, spacing, alignment, and color. */
.about p { font-size: clamp(10px, 1.05vw, 11px); line-height: 1.7; text-align: left; hyphens: auto; color: #828282; }
/* Separate each paragraph after the first. */
.about-details { max-width: 100%; }
/* Highlight the introductory paragraph. */
.about p.lead { align-self: center; color: #828282; font-size: clamp(11px, 1.2vw, 13px); line-height: 1.7; }
/* Put the decorative X at the bottom of the About section. */
.about .x { bottom: 0; }

/* ---------- Hero background video ---------- */
.background-videoAboutMe {
  /* Fill the hero independently of the centered content wrapper. */
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  padding: 0;
  object-fit: cover;
  z-index: 2; /* Ensure the video is behind the content */
  mix-blend-mode: screen; /* Optional: blend the video with the background */
  filter: brightness(30%); /* Optional: adjust brightness for better text visibility */
  opacity: 0.20; /* Optional: adjust opacity for a more subtle effect */

}



/* ---------- audio play/pause button ---------- */
.StarXAbutton {
  /* Align the audio control to the right side of its .wrap container. */

  display: flex; /* Lay out the button using Flexbox. */
  justify-content: flex-end; /* Push the button to the right edge of its .wrap container. */
  align-items: center;
  gap: 8px;
  z-index: 100; /* Ensure the button appears above other content. */


}

#StarXAudio-button {
 /* Style the audio control as a small outlined pill and show a pointer when it can be clicked. */
 width: auto; height: auto;
 font-family: var(--f-jp); font-size: 12px; color: #b5beb9; background: none; border: 0px solid #262b28; border-radius: 999px;
  padding: 0px 0px; cursor: pointer; line-height: 1.4; transition: color .2s, border-color .2s, background .2s;
  display: inline-flex; align-items: center; gap: 6px;}

#StarXAudio-button svg {
  width: 60px; /* change this value */
  height: auto;
  transition: filter .25s ease;
}
#StarXAudio-button:hover svg {
  filter: drop-shadow(0 0 10px #ffffff);
}


/* ---------- What I do ---------- */
/* Create room after the section while keeping positioned details anchored to it. */
.what { position: relative; padding-bottom: clamp(48px, 7vw, 80px); z-index: 10; }
/* Align this section's large heading to the right. */
.what .big { text-align: right; margin-bottom: clamp(26px, 4vw, 40px); }
/* Allow absolutely positioned details to use the content area as their reference. */
.what-body { position: relative; }
/* Display service items as a spaced vertical list with a responsive maximum width. */
.what-list { display: grid; gap: clamp(22px, 3.4vw, 34px); max-width: min(660px, 74%); z-index: 10; }
/* Set up each item so its decorative marker can be positioned inside it. */
.what-list li { position: relative; padding-left: 14px; }
/* Draw a short glowing vertical marker beside each service item. */
.what-list li::before { content: ""; position: absolute; left: 0; top: 4px; width: 3px; height: 15px; border-radius: 2px; background: var(--green); box-shadow: 0 0 9px rgba(63,224,143,.7); }
/* Style service-item headings and leave a small gap below them. */
.what-list h3 { font-size: clamp(13px, 1.7vw, 17px); font-weight: 600; letter-spacing: .02em; color: #e1e9e4; text-transform: uppercase; margin-bottom: 3px; padding-left: 0; transition: color 700ms ease, text-shadow 700ms ease; }
/* Keep service descriptions smaller and softer than their headings. */
.what-list p { font-size: clamp(11.5px, 1.45vw, 14px); line-height: 1.55; color: #7e8682; transition: color 700ms ease, text-shadow 700ms ease; }
.what-list li:hover h3,
.what-list li:hover p { transition-duration: 180ms; }
.what-list li:hover h3 { color: var(--green); text-shadow: 0 0 8px rgba(63, 224, 143, 0.45); }
.what-list li:hover p { color: #a9c5b6; text-shadow: 0 0 8px rgba(63, 224, 143, 0.25); }
.jp {
  /* Place Japanese text vertically along the right side of its containing area. */
  position: absolute; right: 0; top: 0; writing-mode: vertical-rl; font-family: var(--f-mono), var(--f-jp);
  font-size: clamp(12px, 1.9vw, 17px); font-weight: 700; -webkit-text-stroke: .35px currentColor; letter-spacing: .38em; color: #35d98b; text-shadow: 0 0 10px #35d98b;
}
.text-glitch::before,
.text-glitch::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0;
  text-shadow: none;
}
.text-glitch-backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  color: #ff477e;
  opacity: .35;
  text-shadow: 0 0 10px rgba(255, 71, 126, .7);
  animation: text-glitch-backdrop 4s steps(1, end) infinite;
}
.text-glitch-base {
  position: relative;
  z-index: 1;
}
.text-glitch::before {
  color: #ff477e;
  animation: text-glitch-red 4s steps(1, end) infinite;
}
.text-glitch::after {
  color: #63d9ff;
  animation: text-glitch-blue 4s steps(1, end) infinite;
}
@keyframes text-glitch-red {
  0%, 80%, 100% { opacity: 0; transform: translateX(0); clip-path: inset(0); }
  81% { opacity: .8; transform: translateX(-3px); clip-path: inset(12% 0 72%); }
  82% { opacity: .65; transform: translateX(2px); clip-path: inset(58% 0 20%); }
  83% { opacity: 0; transform: translateX(0); }
}
@keyframes text-glitch-blue {
  0%, 84%, 100% { opacity: 0; transform: translateX(0); clip-path: inset(0); }
  85% { opacity: .8; transform: translateX(3px); clip-path: inset(30% 0 48%); }
  86% { opacity: .65; transform: translateX(-2px); clip-path: inset(68% 0 10%); }
  87% { opacity: 0; transform: translateX(0); }
}
@keyframes text-glitch-backdrop {
  0%, 78%, 100% { opacity: .35; transform: translate(2px, 1px); clip-path: inset(0); }
  79% { opacity: .8; transform: translate(-4px, 2px) scale(1.12); clip-path: inset(18% 0 62%); }
  80% { opacity: .55; transform: translate(5px, -1px) scale(1.12); clip-path: inset(60% 0 15%); }
  81% { opacity: .35; transform: translate(2px, 1px); clip-path: inset(0); }
}

/* ---------- Skills ---------- */
/* Add space below the Skills section and anchor its decorative marks. */
.skills { position: relative; padding-bottom: clamp(48px, 7vw, 80px); z-index: 10; }
/* Add space below the Skills heading. */
.skills .big { margin-bottom: clamp(30px, 5vw, 56px); }
/* Place section decorations near the top edge of Skills and Expertise. */
.skills .x, .exp .x { top: clamp(0px, .5vw, 6px); }
/* Stack skill cards vertically. */
.cards { display: flex; flex-direction: column; }
.card {
  /* Size and pad each card; Grid separates text content from its icon. */
  width: 88%; max-width: 560px; padding: clamp(14px, 2.2vw, 22px) clamp(16px, 2.6vw, 26px);
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px;
  background: linear-gradient(145deg, #181b19, #111413); border: 1px solid #1c201e; border-radius: 12px;
  box-shadow: 0 16px 34px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.025);
  transition: transform .3s, border-color .3s;
  cursor: crosshair;

}
/* Alternate cards between the left and right sides. */
.card:nth-child(odd) { align-self: flex-start; }
.card:nth-child(even) { align-self: flex-end; }
/* Slightly overlap consecutive cards to create a staggered stack. */
.card + .card { margin-top: -6px; }
/* Lift a card and tint its border when hovered. */
.card:hover { transform: translateY(-3px); border-color: #1d2f22; }
/* Style each skill-card heading. */
.card h3 { font-size: clamp(13px, 1.8vw, 17px); font-weight: 700; color: #e3ebe6; letter-spacing: .02em; text-transform: uppercase; margin-bottom: 8px; }
.card h3 span { transition: color 700ms ease, text-shadow 700ms ease; }
/* Highlight the emphasized part of a card heading without italic styling. */
.card h3 em { font-style: normal; color: var(--green); margin-right: 5px; font-weight: 400; }
/* Style the list of skills inside each card. */
.card li { font-size: clamp(11px, 1.35vw, 13px); line-height: 1.5; color: #7d8581; transition: color 700ms ease, text-shadow 700ms ease; }
.card:hover h3 span,
.card:hover li { transition-duration: 180ms; }
.card:hover h3 span { color: var(--green); text-shadow: 0 0 3px rgba(63, 224, 143, 0.45); }
.card:hover li { color: #a9c5b6; text-shadow: 0 0 0px rgba(63, 224, 143, 0.25); }
/* Keep card SVG icons proportional and on their own line. */
.card svg { width: clamp(76px, 11vw, 120px); height: auto; display: block; }



/* Set the SVG icon width on larger screens; the phone rule below makes it smaller. */
.gradient-rotating {
  width: 200px;
  height: auto;
}

/* Reduce the SVG icon width on screens no wider than 600px. */
@media (max-width: 600px) {
  .gradient-rotating {
    width: 90px;
  }
}


/* ---------- Expertise ---------- */
/* Add space below Expertise and position decorations relative to the section. */
.exp { position: relative; padding-bottom: clamp(48px, 7vw, 80px); }
/* Add space below the Expertise heading. */
.exp .big { margin-bottom: clamp(26px, 4.4vw, 48px); }
/* Stack expertise rows in a grid with a small gap. */
.table { display: grid; gap: 8px; }
.row {
  /* Divide each row into a category column and a flexible tools column. */
  display: grid; grid-template-columns: clamp(104px, 31%, 330px) minmax(0, 1fr); align-items: center;
  background: var(--panel); border-radius: 4px; padding: 14px clamp(10px, 2vw, 20px) 14px 0; position: relative;
}
/* Draw a short green marker on the left side of each expertise row. */
.row::before { content: ""; position: absolute; left: clamp(10px, 2vw, 18px); top: 50%; width: 3px; height: 15px; transform: translateY(-50%); border-radius: 2px; background: var(--green); box-shadow: 0 0 9px rgba(63,224,143,.7); }
/* Indent and style the category label inside each row. */
.cat { padding-left: clamp(26px, 5vw, 52px); font-size: clamp(12px, 1.8vw, 17px); font-weight: 400; letter-spacing: .03em; color: #aab3ae; text-transform: uppercase; line-height: 1.25; transition: color 1000ms ease, text-shadow 1000ms ease; }
.cat:hover { color: var(--green); text-shadow: 0 0 8px rgba(63, 224, 143, 0.45); transition-duration: 180ms; }
/* Arrange each tool's icon, name, and skill meter in three columns. */
.tool { display: grid; grid-template-columns: 24px minmax(0, 1fr) clamp(70px, 38%, 260px); align-items: center; gap: 8px; padding-block: 4px; }
/* Keep tool names on one line and truncate long names with an ellipsis. */
.tool b { font-weight: 400; font-size: clamp(11px, 1.5vw, 14px); color: #9aa39e; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color 1000ms ease, text-shadow 1000ms ease; }
.tool b:hover { color: var(--green); text-shadow: 0 0 8px rgba(63, 224, 143, 0.45); transition-duration: 180ms; }
/* Size the SVG placeholders used for software icons. */
.tool-icon { width: 18px; height: 18px; display: block; fill: #000; }
.tool-icon--js { width: 18px; height: 18px; display: grid; place-items: end; padding: 1px 2px; border-radius: 3px; background: #c5b02a; color: #1b1b1b; font-family: var(--f-mono); font-size: 9px; font-weight: 700; line-height: 1; }
/* Draw the empty background track behind each skill meter. */
.meter { height: 6px; background: var(--track); border-radius: 0px; overflow: hidden; }
/* Fill the meter by the percentage in --lv and animate changes to its width. */
.meter i { display: block; height: 100%; width: var(--lv); background: #4494c6; border-radius: 0px; transition: width 5s cubic-bezier(.2,.7,.2,1); }

/* ---------- Contact ---------- */
#contact {
  /* Separate Contact from the previous section and add vertical breathing room. */
  padding-top: 80px;
  padding-bottom: 60px;
  border-top: 1px solid var(--border-subtle);
  
  
}

.wrap h2 {
  /* Display headings inside the shared wrap in uppercase letters. */
  text-transform: uppercase;
}

.contact-grid {
  /* Create three contact columns with consistent gaps and vertically centered content. */
  display: grid; 
  grid-template-columns: 1fr 1.2fr 1fr;
  gap: 40px;
  align-items: center;
  margin-top: 40px;
  
}

/* Social Icons */
.contact-socials {
  /* Lay social buttons out in a row and align them vertically. */
  display: flex;
  align-items: center;
  gap: 16px;
}

.social-icon-btn {
  /* Make each social link a centered 40px square with a subtle outline and hover transition. */
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--sage);
  transition: border-color .2s, color .2s, transform .2s, box-shadow .2s;
}

.social-icon-btn:hover {
  /* Highlight and lift a social button when the pointer is over it. */
  border-color: var(--green);
  color: var(--green);
  transform: translateY(-8px);
  box-shadow: 0 0 14px rgba(63, 224, 143, 0.3);
}

.social-icon-btn svg {
  /* Size social icons and use the button's text color for the SVG fill. */
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* Contact Details */
.contact-detail-box {
  /* Place the contact icon next to its text and align the content to the top. */
  display: flex;
  align-items: flex-start;
  gap: 14px;
  cursor: pointer;
}

.contact-detail-icon {
  /* Draw a fixed-size square behind the contact-detail icon. */
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--track);
  border: 1px solid var(--dim);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--green);
  flex-shrink: 0;
}

.contact-detail-icon svg {
  /* Keep the icon artwork smaller than its surrounding square. */
  width: 16px;
  height: 16px;
}

.contact-detail-label {
  /* Show a compact uppercase label above the contact information. */
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 2px;
}

.contact-detail-value {
  /* Style the main contact value and allow its text and copy badge to align in a row. */
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
  transition: color var(--transition-fast);
}

.contact-detail-value:hover {
  /* Change the contact value color when hovered. */
  color: var(--accent-green);
}

.copy-badge {
  /* Style the small visual badge shown beside contact details. */
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 2px 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  color: var(--mute);
  transition: background .2s ease, color .2s ease, text-shadow .2s ease;
}

.contact-detail-box:hover .copy-badge,
.contact-detail-box:focus-visible .copy-badge {
  /* Highlight the badge when its surrounding contact-detail box is hovered. */
  background: rgba(141, 255, 187, 0.12);
  color: var(--green);
  text-shadow: 0 0 8px var(--green);
}

/* Bottom Footer Bar */
.footer-bottom {
  /* Separate the footer row from contact details and distribute items to opposite ends. */
  margin-top: 60px;
  padding-top: 24px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
}

.footer-copy {
  /* Add a little spacing between footer-copy letters. */
  letter-spacing: 0.05em;
}
.footer-copy-brand { color: var(--green); }

.footer-back-to-top {
  /* Align the back-to-top label and icon in a row. */
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  transition: color var(--transition-fast);
}

.footer-back-to-top:hover {
  /* Highlight the back-to-top link on hover. */
  color: var(--accent-green);
}

/* ---------- Japanese mode ---------- */
/* Use Japanese-friendly fonts and spacing when the document language is Japanese. */
html[lang="ja"] body { font-family: var(--f-jp), var(--f-display); }
html[lang="ja"] .hero-cap, html[lang="ja"] .hero-links, html[lang="ja"] .drawer-link { font-family: var(--f-jp), var(--f-mono); letter-spacing: .04em; }
html[lang="ja"] .about p, html[lang="ja"] .what-list p, html[lang="ja"] .card li { line-height: 1.8; }
html[lang="ja"] .big { letter-spacing: 0; }
html[lang="ja"] .lang-btn { font-family: var(--f-display); }
html[lang="ja"] .work-page .section-title { font-size: clamp(22px, 7vw, 34px); letter-spacing: 0; }

/* ---------- Tablet / phone ---------- */
/* On wider screens, make cards narrower and keep the service list at a readable width. */
@media (min-width: 900px) {
  .card { width: 54%; }
  .what-list { max-width: 640px; }
}
/* Apply compact spacing and a single-column contact layout on phones. */
@media (max-width: 600px) {
  .top { padding-block: 14px; }
  .top .wrap { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 6px; }
  .logo { min-width: 0; }
  .logo img { width: clamp(62px, 20vw, 90px); max-width: 100%; }
  .tools { gap: 2px; }
  .pill a { padding: 7px 14px; font-size: 13px; }
  .hero { --hero-image-position: 40% 50%; }
  .hero-cap { bottom: 22px; }
  .hero-links { bottom: 22px; }
  .what-list { max-width: calc(100% - 38px); }
  .about-layout { gap: 16px; padding: 18px 0; }
  .about-details { display: block; max-height: 0; overflow: hidden; opacity: 0; transition: max-height 480ms cubic-bezier(.22, 1, .36, 1), opacity 360ms ease; }
  .about p.about-details { font-size: clamp(11px, 1.2vw, 13px); }
  .about-expanded .about-details { opacity: 1; }
  .about-more-toggle { display: flex; width: 100%; align-items: center; justify-content: flex-end; gap: 8px; margin-top: -4px; padding: 8px 0; border: 0; background: none; color: var(--green); font-family: var(--f-mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; cursor: pointer; animation: about-more-glow 2.4s ease-in-out infinite; transition: text-shadow 180ms ease; }
  .about-more-toggle svg { animation: about-more-move 1.8s ease-in-out infinite; }
  .about-more-toggle:hover,
  .about-more-toggle:focus-visible { text-shadow: 0 0 9px rgba(141, 255, 187, .75); }
  .about-more-toggle:focus-visible { outline: 1px solid var(--sage); outline-offset: 3px; }
  .about-heading { gap: 10px; margin-bottom: 18px; }
  .about-index { font-size: 9px; }
  .card { width: 92%; }
  .contact-grid { grid-template-columns: minmax(0, 1fr); gap: 24px; align-items: start; margin-top: 28px; }
  .contact-detail-value { min-width: 0; flex-wrap: wrap; }
  .contact-detail-value > span:first-child { min-width: 0; overflow-wrap: anywhere; }
  .footer-bottom { flex-direction: column; align-items: flex-start; gap: 16px; margin-top: 40px; }
}
@media (min-width: 601px) {
  .about-details { max-height: none !important; overflow: visible; opacity: 1; }
}
/* Use smaller horizontal padding for navigation links on very narrow screens. */
@media (max-width: 380px) {
  .top .wrap {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "logo tools"
      "navigation navigation";
    row-gap: 6px;
  }
  .logo { grid-area: logo; }
  .pill { grid-area: navigation; justify-self: center; }
  .tools { grid-area: tools; }
}
/* Respect the operating system preference to reduce animation and smooth scrolling. */
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  html { scroll-behavior: auto; }
  .pill::before { transition: none; }
  .nav-drawer, .drawer-backdrop, .drawer-link, .drawer-close { transition: none; }
  .drawer-link:hover { transform: none; }
  .Musichint { transition: none; }
  #infoPage, #workPage { transition: none; }
  .about h2, .what .big, .skills .big, .exp .big { transition: none; }
  .about-more-toggle, .about-more-toggle svg { animation: none; transition: none; }
  .about-details { transition: none; }
  .cat { transition: none; }
  .what-list h3, .what-list p { transition: none; }
  .card h3 span, .card li { transition: none; }
  .chev a { animation: none; }
  .glitch-red, .glitch-blue, .glitch-bars::before, .glitch-bars::after { animation: none; opacity: 0; }
  .text-glitch::before, .text-glitch::after { animation: none; opacity: 0; }
  .text-glitch-backdrop { animation: none; opacity: .2; transform: translate(2px, 1px); }
  .meter i, .card, .top { transition: none; }
}
  /* Set responsive width, keep links above image layers, and center their text. */
  /* Use a subtle gradient, border, rounded corners, and shadow for the card surface. */
  /* Animate the card's lift and border color on hover; show the chosen cursor. */
  /* Give rows a panel background and internal space; relative positioning anchors the marker. */

/* ---------- Embedded Work page ---------- */
.work-page {
  --page-bg: #0c0f0d;
  --card-bg: #131815;
  --text-heading: #f2f5f3;
  --text-secondary: #c2cbc5;
  --text-muted: #8e9992;
  --accent-green: #2fe89f;
  --accent-green-bright: #00ff88;
  --accent-green-dim: rgba(47, 232, 159, 0.12);
  --accent-green-border: rgba(47, 232, 159, 0.3);
  --border-light: rgba(255, 255, 255, 0.08);
  --font-display: "Space Grotesk", -apple-system, sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "IBM Plex Mono", monospace;
  --radius-lg: 16px;
  width: 100%;
  min-width: 0;
  min-height: 100vh;
  position: relative;
  isolation: isolate;
  background:
    radial-gradient(ellipse at 50% 0, rgba(47, 232, 159, 0.055), transparent 55%),
    var(--page-bg);
  color: var(--text-secondary);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

.work-page button {
  font: inherit;
}

.work-section {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-width: 0;
  padding: clamp(112px, 13vw, 148px) 24px clamp(56px, 8vw, 100px);
}

.work-container {
  width: min(100%, 1200px);
  min-width: 0;
  margin: 0 auto;
}

.work-header {
  display: flex;
  justify-content: center;
  text-align: center;
}

.work-eyebrow {
  margin-bottom: 12px;
  color: var(--accent-green);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.section-accent-line {
  width: 54px;
  height: 2px;
  margin: 0 auto 18px;
  background: var(--accent-green);
  box-shadow: 0 0 14px var(--accent-green);
}

.section-title {
  max-width: 100%;
  margin: 0;
  color: var(--text-heading);
  font-family: var(--font-display);
  font-size: clamp(28px, 5vw, 42px);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.12;
  overflow-wrap: anywhere;
}

.section-intro {
  max-width: 620px;
  margin: 12px auto 0;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.7;
}

.work-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 38px 0 44px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-light);
}

.work-filter-btn {
  padding: 9px 15px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  transition: color 180ms ease, border-color 180ms ease, background 180ms ease;
}

.work-filter-btn:hover,
.work-filter-btn:focus-visible {
  border-color: rgba(255, 255, 255, 0.3);
  color: #fff;
}

.work-filter-btn.active {
  border-color: var(--accent-green);
  background: var(--accent-green-dim);
  color: var(--accent-green-bright);
  box-shadow: 0 0 12px rgba(47, 232, 159, 0.2);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: clamp(16px, 2.4vw, 30px);
}

.project-card {
  display: flex;
  overflow: hidden;
  flex-direction: column;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  background: var(--card-bg);
  cursor: pointer;
  transition: transform 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}

.project-card:hover,
.project-card:focus-visible {
  transform: translateY(-6px);
  border-color: var(--accent-green-border);
  outline: none;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6), 0 0 24px rgba(47, 232, 159, 0.2);
}

.project-thumb-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #000;
}

.project-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 600ms cubic-bezier(0.16, 1, 0.3, 1);
}

.project-card--top-thumbnail .project-thumb {
  object-position: top;
}

.project-card:hover .project-thumb,
.project-card:focus-visible .project-thumb {
  transform: scale(1.05);
}

.project-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  padding: 20px;
  background: linear-gradient(to top, rgba(12, 15, 13, 0.9), transparent 60%);
  opacity: 0;
  transition: opacity 180ms ease;
}

.project-card:hover .project-overlay,
.project-card:focus-visible .project-overlay {
  opacity: 1;
}

.project-view-badge {
  padding: 4px 12px;
  border: 1px solid var(--accent-green);
  border-radius: 999px;
  background: rgba(47, 232, 159, 0.3);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 11px;
  backdrop-filter: blur(4px);
}

.project-meta-box {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  padding: 20px;
}

.project-category-tag {
  color: var(--accent-green);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.project-card--logo .project-category-tag {
  text-transform: none;
}

.project-title {
  margin: 0;
  color: var(--text-heading);
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
}

.project-desc {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.5;
}

.project-hashtag {
  color: #2ea8a4;
  font-size: small;
}

.modal-overlay {
  position: fixed;
  z-index: 9999;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  padding: 24px;
  overscroll-behavior: contain;
  background: rgba(0, 0, 0, 0.85);
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
  backdrop-filter: blur(12px);
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-overlay.modal-overlay--zoom {
  background: rgba(0, 0, 0, 0.62);
}

.modal-card {
  position: relative;
  flex: 0 0 auto;
  width: min(100%, 1100px);
  max-height: 90vh;
  max-height: calc(100dvh - 48px);
  overflow-y: auto;
  overscroll-behavior: contain;
  transform: scale(0.96);
  border: 1px solid var(--accent-green-border);
  border-radius: var(--radius-lg);
  background: #111513;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.8), 0 0 40px rgba(47, 232, 159, 0.2);
  transition: transform 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-card--zoom {
  border-color: rgba(47, 232, 159, 0.35);
  background: rgba(17, 21, 19, 0.68);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.modal-overlay.open .modal-card {
  transform: scale(1);
}

.modal-close-btn {
  position: absolute;
  z-index: 1;
  top: 16px;
  right: 16px;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid var(--border-light);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

.modal-close-btn:hover,
.modal-close-btn:focus-visible {
  background: var(--accent-green);
  color: #000;
}

.modal-logo-nav {
  position: absolute;
  z-index: 10001;
  top: 50%;
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  transform: translateY(-50%);
  border: 1px solid var(--accent-green-border);
  border-radius: 50%;
  background: rgba(15, 19, 17, 0.94);
  color: var(--accent-green-bright);
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}

.modal-logo-nav--previous {
  left: 32px;
}

.modal-logo-nav--next {
  right: 32px;
}

.modal-logo-nav:hover,
.modal-logo-nav:focus-visible {
  transform: translateY(-50%) scale(1.08);
  background: var(--accent-green);
  color: #000;
  outline: none;
}

.modal-logo-nav svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.modal-image-wrap {
  position: relative;
  display: block;
  width: 100%;
  max-width: 100%;
}

.modal-image-wrap img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
}

.modal-image-wrap img.logo-preview-changing {
  animation: logo-preview-enter 260ms ease both;
}

@keyframes logo-preview-enter {
  from {
    opacity: 0.35;
    transform: scale(0.985);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.modal-body {
  padding: 30px;
}

.modal-cat {
  margin-bottom: 6px;
  color: var(--accent-green);
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
}

.modal-title {
  margin: 0 0 12px;
  color: #fff;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
}

.modal-desc {
  margin: 0;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.7;
}

.modal-card--zoom .modal-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  padding: clamp(16px, 1.5vw, 24px);
}

.modal-card--zoom .modal-cat {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.12em;
  line-height: 1.6;
}

.modal-card--zoom .modal-cat::after {
  display: block;
  width: 42px;
  height: 2px;
  margin-top: 8px;
  background: var(--accent-green);
  content: "";
}

.modal-card--zoom .modal-title {
  margin: 0;
  font-size: clamp(28px, 2.4vw, 36px);
  line-height: 1.12;
}

.modal-card--zoom .modal-desc {
  max-width: 42ch;
  font-size: 16px;
  line-height: 1.8;
}

.modal-card--zoom .modal-image-wrap {
  overflow: hidden;
}

.modal-card--zoom .modal-image-wrap img {
  transform-origin: center center;
  user-select: none;
  -webkit-user-drag: none;
}

.modal-image-wrap.is-zoomed {
  cursor: grab;
  touch-action: none;
}

.modal-image-wrap.is-zoomed img {
  cursor: grab;
}

.modal-image-wrap.is-dragging,
.modal-image-wrap.is-dragging img {
  cursor: grabbing;
}

.modal-zoom-controls {
  position: absolute;
  z-index: 2;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid rgba(47, 232, 159, 0.3);
  border-radius: 999px;
  background: rgba(8, 12, 10, 0.84);
  color: var(--text-heading);
  font-family: var(--font-mono);
  font-size: 11px;
  opacity: 0.55;
  transition: opacity 180ms ease;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.modal-zoom-controls:hover {
  opacity: 1;
}

.modal-zoom-controls:focus-within {
  opacity: 1;
}

.modal-zoom-controls[hidden] {
  display: none;
}

.modal-zoom-controls input {
  width: clamp(90px, 12vw, 160px);
  margin: 0;
  accent-color: var(--accent-green);
  cursor: ew-resize;
}

.modal-zoom-controls output {
  min-width: 38px;
  color: var(--accent-green-bright);
  text-align: right;
}

@media (min-width: 768px) {
  .modal-card--zoom {
    display: grid;
    width: min(100%, 1200px);
    grid-template-columns: minmax(0, 1.5fr) minmax(300px, 0.7fr);
    align-items: center;
  }

  .modal-card--zoom .modal-image-wrap {
    display: flex;
    min-height: min(85vh, 820px);
    min-height: min(85dvh, 820px);
    align-items: center;
    justify-content: center;
  }

  .modal-card--zoom .modal-image-wrap img {
    width: auto;
    max-width: 100%;
    max-height: calc(100dvh - 80px);
    object-fit: contain;
  }
}

.modal-scroll-hint {
  position: absolute;
  z-index: 10000;
  bottom: max(20px, env(safe-area-inset-bottom, 0px));
  left: 50%;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  transform: translateX(-50%);
  border: 1px solid var(--accent-green-border);
  border-radius: 999px;
  background: rgba(17, 21, 19, 0.94);
  color: var(--text-heading);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 12px;
  white-space: nowrap;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.modal-scroll-hint svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--accent-green);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  animation: modal-scroll-bounce 1.1s ease-in-out infinite;
}

@keyframes modal-scroll-bounce {
  0%, 100% { transform: translateY(-2px); }
  50% { transform: translateY(3px); }
}

@media (max-width: 600px) {
  .work-section {
    padding-right: 18px;
    padding-left: 18px;
  }

  .work-filter-bar {
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 8px;
    margin: 30px -18px 28px;
    padding: 0 18px 12px;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-green) transparent;
  }

  .work-filter-bar::-webkit-scrollbar { height: 3px; }
  .work-filter-bar::-webkit-scrollbar-thumb { background: var(--accent-green); border-radius: 999px; }
  .work-filter-btn {
    flex: 0 0 auto;
    padding: 8px 12px;
    font-size: 11px;
  }

  .projects-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .project-card {
    background: rgba(19, 24, 21, 0.6);
  }

  .project-meta-box {
    gap: 7px;
    padding: 14px;
  }

  .project-title {
    font-size: 14px;
    line-height: 1.3;
  }

  .project-desc {
    font-size: 11px;
    line-height: 1.4;
  }

  .project-card .project-desc,
  .project-card .project-title {
    display: none;
  }

  .project-card .project-category-tag {
    font-size: 8px;
    opacity: 0.6;
  }

  .project-overlay {
    opacity: 1;
  }

  .project-card .project-view-badge {
    display: none;
  }

  .modal-overlay {
    padding: 14px;
  }

  .modal-card {
    max-height: calc(100vh - 28px);
    max-height: calc(100dvh - 28px);
  }

  .modal-logo-nav {
    width: 40px;
    height: 40px;
  }

  .modal-logo-nav--previous { left: 8px; }
  .modal-logo-nav--next { right: 8px; }

  .modal-zoom-controls {
    top: 12px;
    left: 50%;
    gap: 8px;
    padding: 8px 10px;
  }

  .modal-body {
    padding: 22px;
  }

  .modal-image-wrap {
    display: flex;
    justify-content: center;
  }

  .modal-image-wrap img {
    width: auto;
    max-height: 60vh;
    max-height: 60dvh;
    object-fit: contain;
  }

}

@media (prefers-reduced-motion: reduce) {
  .modal-scroll-hint svg { animation: none; }
  .modal-image-wrap img.logo-preview-changing { animation: none; }
  .work-page *,
  .work-page *::before,
  .work-page *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- Background SVG Sci Fi---------- */
.my-svg-Background {
    position: absolute;
    top: 900px;
    left: 10%;
    transform: translateX(-40%);
    opacity: 0.4;
    width: 600px;
    aspect-ratio: 1 / 1;

    background: url("assets/Background/AnimateBackground.svg") center / contain no-repeat;

    z-index: 0;
    pointer-events: none;
}

/* ---------- Background SVG Sci Fi---------- */
.my-svg-Background-right {
    position: absolute;
    top: 2700px;
    left: auto;
    right: -25%;
    transform: translateX(-40%) scaleX(-1);
    opacity: 0.4;
    width: 600px;
    aspect-ratio: 1 / 1;

    background: url("assets/Background/AnimateBackground.svg") center / contain no-repeat;

    z-index: 0;
    pointer-events: none;
}
