/* ═══════════════════════════════════════════════════════════════
 * mogodik.com — styles
 * Dark beach · liquid glass · Galmuri pixel
 * ═══════════════════════════════════════════════════════════════ */

:root {
  /* Surfaces */
  --bg:        #0a1622;
  --bg-soft:   #142433;
  --bg-card:   #1a2c3d;
  --bg-card-hi:#22384d;

  /* Glass — tints + edges */
  --glass-tint-a:   rgba(244, 227, 196, 0.05);
  --glass-tint-b:   rgba(95, 201, 201, 0.05);
  --glass-fill:     rgba(20, 36, 51, 0.58);
  --glass-border:   rgba(244, 227, 196, 0.18);
  --glass-border-d: rgba(244, 227, 196, 0.30);
  --glass-hi:       rgba(255, 255, 255, 0.10);

  /* Type */
  --ink:       #f4e3c4;
  --ink-soft:  #c4b294;
  --muted:     #7c8a9b;
  --line:      #283b4f;

  /* Accents — sunset + sea */
  --accent:    #f4a261;
  --accent-2:  #e76f51;
  --gold:      #ffd76e;
  --mint:      #5fc9c9;
  --sea:       #2d8d9c;
  --deep:      #1a4d5e;

  /* Radii */
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 22px;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
*, *::before, *::after { user-select: none; -webkit-user-select: none; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Galmuri11', 'Galmuri14', monospace;
  font-size: 14px;
  line-height: 1.8;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: none;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "liga" 0;
  text-rendering: geometricPrecision;
  animation: boot-fade .8s ease both;
}
@keyframes boot-fade { from { opacity: 0; } to { opacity: 1; } }

/* ── Living scene canvas (pixel ocean + particles) ── */
#scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  image-rendering: pixelated;
}

.svg-defs { position: absolute; overflow: hidden; }

/* ───────────────────────────────────────────────────────────────
 * 1. Background ambience
 * ─────────────────────────────────────────────────────────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 80% 0%,   rgba(244,162,97,.08), transparent 50%),
    radial-gradient(ellipse at 10% 100%, rgba(95,201,201,.06), transparent 55%),
    radial-gradient(ellipse at 50% 50%,  rgba(26,77,94,.15),   transparent 70%);
}
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: repeating-linear-gradient(
    180deg,
    rgba(95,201,201,.012) 0px,
    rgba(95,201,201,.012) 1px,
    transparent 1px,
    transparent 4px
  );
}

/* ───────────────────────────────────────────────────────────────
 * 2. Wave sweep — applied to page-wrap on load
 * ─────────────────────────────────────────────────────────────── */
.page-wrap {
  position: relative;
  z-index: 1;
}
.page-wrap.wave-active {
  filter: url(#liquid-sweep);
}
/* During the wave sweep, drop card materials so the wave reads cleanly
   (also lighter to render) */
.page-wrap.wave-active .glass {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

/* ───────────────────────────────────────────────────────────────
 * 3. Glass — used on every UI surface
 *    (distortion + chromatic aberration via #glass filter,
 *     no blur, pixel-step hard shadow)
 * ─────────────────────────────────────────────────────────────── */
.glass {
  position: relative;
  isolation: isolate;
  border: 1.2px solid transparent;
  border-radius: var(--r-lg);
  /* Translucent body (padding-box) + bright specular rim (border-box) */
  background:
    linear-gradient(150deg,
      rgba(255,255,255,.045),
      rgba(255,255,255,.012) 42%,
      rgba(255,255,255,.035)) padding-box,
    linear-gradient(140deg,
      rgba(255,255,255,.38) 0%,
      rgba(255,255,255,.10) 16%,
      rgba(255,255,255,0)   40%,
      rgba(255,255,255,0)   62%,
      rgba(255,255,255,.14) 100%) border-box;
  /* Liquid glass material — lensy translucency, no heavy frost */
  -webkit-backdrop-filter: blur(2px) saturate(150%) brightness(1.05);
  backdrop-filter: blur(2px) saturate(150%) brightness(1.05);
  box-shadow:
    /* soft floating shadow */
    0 16px 36px -16px rgba(0,0,0,.6),
    0 5px 12px -7px rgba(0,0,0,.45),
    /* gentle top specular + soft bottom inner glow */
    inset 0 1px 1px rgba(255,255,255,.26),
    inset 0 -16px 32px -22px rgba(255,255,255,.07);
  transition:
    transform .3s cubic-bezier(.2,.8,.2,1),
    box-shadow .3s ease;
}

/* Mouse-tracked specular gloss (sits above body, below text via z-index:-1) */
.glass::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(160px circle at var(--gx, 50%) var(--gy, 0%),
    rgba(255,255,255,.15),
    rgba(255,255,255,.04) 38%,
    transparent 64%);
  opacity: var(--gloss, .2);
  transition: opacity .35s ease;
  mix-blend-mode: screen;
}

/* Thin moving top sheen line */
.glass::after {
  content: '';
  position: absolute;
  z-index: -1;
  left: 12%;
  right: 12%;
  top: 0;
  height: 1px;
  border-radius: inherit;
  background: linear-gradient(90deg,
    transparent,
    rgba(255,255,255,.32),
    transparent);
  pointer-events: none;
}

.glass:hover { transform: translateY(-3px); }

/* draggable affordance */
.glass:not(.peek) {
  cursor: grab;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
}
.glass.dragging { cursor: grabbing; z-index: 250; transition: none !important; }

/* ───────────────────────────────────────────────────────────────
 * 4. Banner (main.jpg)
 * ─────────────────────────────────────────────────────────────── */
.banner {
  position: relative;
  width: 100%;
  height: clamp(280px, 50vh, 480px);
  overflow: hidden;
}
.banner-img {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  image-rendering: pixelated;
  will-change: opacity, transform, filter;
}
.banner-fade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg,
    transparent 0%,
    transparent 35%,
    rgba(10,22,34,.35) 65%,
    rgba(10,22,34,.85) 88%,
    var(--bg) 100%);
}

/* ───────────────────────────────────────────────────────────────
 * 5. Layout
 * ─────────────────────────────────────────────────────────────── */
.container {
  position: relative;
  max-width: 760px;
  margin: -80px auto 0;
  padding: 40px clamp(20px, 5vw, 40px) 80px;
}

/* ───────────────────────────────────────────────────────────────
 * 6. Hero
 * ─────────────────────────────────────────────────────────────── */
.hero { margin-bottom: clamp(60px, 10vh, 110px); }

.hi {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  font-family: 'Galmuri9', monospace;
  font-size: 11px;
  color: var(--ink-soft);
  margin-bottom: 24px;
  border-radius: 99px;
  letter-spacing: 1px;
}

.hero h1 {
  font-family: 'Galmuri14', monospace;
  font-size: clamp(28px, 6vw, 56px);
  line-height: 1.3;
  letter-spacing: 0;
  margin-bottom: 22px;
  color: var(--ink);
  font-weight: normal;
}
.hero h1 .highlight {
  background: linear-gradient(120deg, transparent 55%, rgba(244,162,97,.32) 55%);
  padding: 0 4px;
}
.hero h1 .scribble {
  color: var(--accent);
  text-shadow:
    1px 1px 0 rgba(231,111,81,.5),
    2px 2px 0 rgba(0,0,0,.4);
}
.hero-sub {
  font-family: 'Galmuri11', monospace;
  font-size: 13px;
  color: var(--ink-soft);
  max-width: 520px;
  line-height: 2;
}

/* ───────────────────────────────────────────────────────────────
 * 7. Section
 * ─────────────────────────────────────────────────────────────── */
section { margin-bottom: clamp(40px, 7vh, 70px); }

.sec-label {
  font-family: 'Galmuri9', monospace;
  font-size: 11px;
  color: var(--accent);
  margin-bottom: 8px;
  letter-spacing: 3px;
  text-transform: uppercase;
}
.sec-title {
  font-family: 'Galmuri14', monospace;
  font-size: clamp(20px, 3vw, 28px);
  margin-bottom: 22px;
  color: var(--ink);
  font-weight: normal;
  letter-spacing: 0;
  line-height: 1.4;
}

/* ───────────────────────────────────────────────────────────────
 * 8. About
 * ─────────────────────────────────────────────────────────────── */
.about-text {
  font-family: 'Galmuri11', monospace;
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 2.1;
}
.about-text strong {
  color: var(--ink);
  font-weight: normal;
}

/* ───────────────────────────────────────────────────────────────
 * 9. Hobbies
 * ─────────────────────────────────────────────────────────────── */
.hobby-intro {
  font-family: 'Galmuri9', monospace;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 22px;
  letter-spacing: 1px;
  line-height: 1.9;
}
.hobbies {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
}
.hobby-card {
  padding: 18px 18px;
  overflow: hidden;
}
.hobby-card:hover,
.contact-btn:hover {
  transform: translateY(-4px);
  box-shadow:
    0 24px 48px -18px rgba(0,0,0,.65),
    0 8px 16px -10px rgba(0,0,0,.5),
    inset 0 1px 1.5px rgba(255,255,255,.5),
    inset 0 -16px 32px -20px rgba(255,255,255,.14);
}
.hobby-name {
  font-family: 'Galmuri14', monospace;
  font-size: 18px;
  color: var(--ink);
  margin-bottom: 4px;
  font-weight: normal;
}
.hobby-desc {
  font-family: 'Galmuri9', monospace;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.5px;
}

/* ───────────────────────────────────────────────────────────────
 * 10. Now
 * ─────────────────────────────────────────────────────────────── */
.now-card {
  padding: 22px 24px;
}
.now-card::after {
  /* override the thin edge-light so the dot stays clean */
  display: none;
}
.now-card .now-dot {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 8px;
  height: 8px;
  background: var(--mint);
  box-shadow: 0 0 0 4px rgba(95,201,201,.18);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%,100% { box-shadow: 0 0 0 4px rgba(95,201,201,.18); }
  50%     { box-shadow: 0 0 0 7px rgba(95,201,201,.06); }
}
.now-list { list-style: none; }
.now-list li {
  font-family: 'Galmuri11', monospace;
  font-size: 13px;
  color: var(--ink-soft);
  padding: 8px 0;
  display: flex;
  gap: 12px;
  align-items: baseline;
  line-height: 1.8;
}
.now-list li::before {
  content: '▸';
  color: var(--accent);
  font-size: 11px;
  line-height: 1;
}

/* Now-card dot (added via markup later, or use pseudo here) */
.now-card { }
.now-card::before {
  /* sheen sits behind the corner dot — already from .glass::before */
}

/* ───────────────────────────────────────────────────────────────
 * 11. Contact
 * ─────────────────────────────────────────────────────────────── */
.contact-links {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.contact-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 14px 18px;
  text-decoration: none;
  color: var(--ink);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}
.contact-label {
  font-family: 'Galmuri9', monospace;
  font-size: 9px;
  color: var(--muted);
  letter-spacing: 1.5px;
  text-transform: uppercase;
}
.contact-val {
  font-family: 'Galmuri14', monospace;
  font-size: 14px;
  color: var(--ink);
}

.contact-copy .copy-hint {
  position: absolute;
  top: 14px;
  right: 14px;
  font-family: 'Galmuri9', monospace;
  font-size: 9px;
  color: var(--muted);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  transition: color .2s;
}
.contact-copy.copied {
  box-shadow:
    inset 0 0 0 1.5px var(--mint),
    0 16px 36px -16px rgba(0,0,0,.6),
    inset 0 1px 1.5px rgba(255,255,255,.42);
}
.contact-copy.copied .copy-hint { color: var(--mint); }

/* ───────────────────────────────────────────────────────────────
 * 12. Footer
 * ─────────────────────────────────────────────────────────────── */
footer {
  margin-top: 60px;
  padding-top: 30px;
  border-top: 1px dashed var(--line);
  text-align: center;
  font-family: 'Galmuri9', monospace;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 1.5px;
}
footer .heart {
  color: var(--accent-2);
  display: inline-block;
  animation: beat 1.4s ease-in-out infinite;
}
@keyframes beat {
  0%,100% { transform: scale(1); }
  50%     { transform: scale(1.18); }
}

/* ───────────────────────────────────────────────────────────────
 * 13. Handwriting reveal
 * ─────────────────────────────────────────────────────────────── */
.hw-char {
  display: inline-block;
  opacity: 0;
  transform: translateY(8px) rotate(-5deg) scale(0.86);
  transition:
    opacity .35s cubic-bezier(0.30, 0.00, 0.50, 1.00),
    transform .55s cubic-bezier(0.34, 1.56, 0.64, 1.00);
  will-change: opacity, transform;
}
[data-handwrite].show .hw-char {
  opacity: 1;
  transform: translateY(0) rotate(0) scale(1);
}

/* ───────────────────────────────────────────────────────────────
 * 14. Click ripples
 * ─────────────────────────────────────────────────────────────── */
.ripple-layer {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  overflow: hidden;
}
.ripple {
  position: absolute;
  width: 10px;
  height: 10px;
  border: 1.5px solid rgba(244,162,97,.55);
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(1);
  animation: ripple-expand .9s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes ripple-expand {
  0% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    border-width: 1.5px;
  }
  100% {
    transform: translate(-50%, -50%) scale(28);
    opacity: 0;
    border-width: 0.5px;
  }
}

/* ───────────────────────────────────────────────────────────────
 * 15. Peek
 * ─────────────────────────────────────────────────────────────── */
.peek {
  position: fixed;
  width: clamp(200px, 25vw, 320px);
  height: clamp(260px, 33vw, 420px);
  z-index: 200;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-family: 'Galmuri9', monospace;
  font-size: 11px;
  letter-spacing: 1px;
  opacity: 0;
  /* Override glass transition to support entry positions */
  transition:
    transform .55s cubic-bezier(0.34, 1.56, 0.64, 1),
    opacity .45s ease,
    right .55s cubic-bezier(0.34, 1.56, 0.64, 1),
    bottom .55s cubic-bezier(0.34, 1.56, 0.64, 1),
    left .55s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.peek img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}
.peek.peek-hasimg .peek-label { display: none; }

#peek-right {
  top: 24%;
  right: -380px;
  transform: rotate(-20deg);
}
#peek-right.show {
  right: -66px;
  transform: rotate(-12deg);
  opacity: 1;
}

#peek-bl {
  bottom: -440px;
  left: -160px;
  transform: rotate(18deg);
}
#peek-bl.show {
  bottom: -80px;
  left: -34px;
  transform: rotate(10deg);
  opacity: 1;
}

@media (max-width: 600px) {
  .peek { width: 150px; height: 200px; }
  #peek-right.show { right: -54px; }
  #peek-bl.show { bottom: -64px; left: -28px; }
}

/* ───────────────────────────────────────────────────────────────
 * 16. Tide hint (faint Konami easter egg surface)
 * ─────────────────────────────────────────────────────────────── */
.tide-hint {
  position: fixed;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Galmuri9', monospace;
  font-size: 10px;
  color: var(--muted);
  opacity: 0;
  pointer-events: none;
  z-index: 30;
  letter-spacing: 2px;
  transition: opacity .8s ease;
}
.tide-hint.show { opacity: .35; }

/* ───────────────────────────────────────────────────────────────
 * 17. Local time HUD (top-right)
 * ─────────────────────────────────────────────────────────────── */
.time-hud {
  position: fixed;
  top: 16px;
  right: 18px;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  font-family: 'Galmuri9', monospace;
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--ink-soft);
  background: rgba(20, 36, 51, 0.5);
  border: 1px solid var(--glass-border);
  border-radius: 99px;
  box-shadow:
    2px 2px 0 rgba(0,0,0,.3),
    inset 0 1px 0 rgba(255,255,255,.08);
  pointer-events: none;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity .6s ease .4s, transform .6s ease .4s;
}
.time-hud.show { opacity: 1; transform: translateY(0); }
.time-hud .time-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent);
  animation: blink 2.4s ease-in-out infinite;
}
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: .25; } }
.time-hud .time-tz {
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}
@media (max-width: 600px) { .time-hud { top: 10px; right: 10px; font-size: 10px; padding: 6px 10px; } }

/* ───────────────────────────────────────────────────────────────
 * 18. Screen-edge refraction (liquid-glass rim)
 * ─────────────────────────────────────────────────────────────── */
.edge-lens {
  position: fixed;
  inset: 0;
  z-index: 47;
  pointer-events: none;
  -webkit-backdrop-filter: url(#edge-distort);
          backdrop-filter: url(#edge-distort);
  /* only the outer ring is distorted; center stays clear */
  -webkit-mask: radial-gradient(125% 125% at 50% 50%, transparent 56%, #000 90%);
          mask: radial-gradient(125% 125% at 50% 50%, transparent 56%, #000 90%);
}
.edge-lens::after {
  content: '';
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 140px rgba(0, 0, 0, 0.4);
}

/* ───────────────────────────────────────────────────────────────
 * 19. Gooey liquid layer (behind cards, visible while dragging)
 * ─────────────────────────────────────────────────────────────── */
.goo-layer {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity .35s ease;
}
.goo-layer.active { opacity: .9; }
/* neutral glass tone — the #goo filter renders this as a faint body + bright rim */
.goo-layer rect { fill: rgba(240, 236, 226, 0.5); }

/* ───────────────────────────────────────────────────────────────
 * 20. Wide-monitor dashboard layout
 * ─────────────────────────────────────────────────────────────── */
@media (min-width: 1240px) {
  .container {
    max-width: 1280px;
    margin: -64px auto 0;
    padding: 56px clamp(24px, 4vw, 56px) 110px;
    display: grid;
    gap: 18px;
    align-items: start;
    grid-template-columns: 1.25fr 1fr 1fr;
    grid-template-areas:
      "hero    hero    now"
      "about   hobby   hobby"
      "contact contact contact"
      "foot    foot    foot";
  }
  .container > section { margin-bottom: 0; }
  .hero    { grid-area: hero; margin-bottom: 0; }
  #about   { grid-area: about; }
  #hobbies { grid-area: hobby; }
  #now     { grid-area: now; }
  #contact { grid-area: contact; }
  .container > footer { grid-area: foot; margin-top: 20px; }

  .hobbies { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .contact-links { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 1600px) {
  .container { max-width: 1440px; }
}

/* ───────────────────────────────────────────────────────────────
 * 21. Reduced motion
 * ─────────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .hw-char {
    transition-duration: .15s !important;
    transition-delay: 0s !important;
  }
  .ripple { animation: none; display: none; }
  .page-wrap.wave-active { filter: none; }
  .edge-lens { display: none; }
}
