/* styles.css */
:root {
  --text: #111;
  --muted: #555;
  --line: #e6e6e6;
  --bg: #fff;

  --panel-bg: #fff;
  --panel-border: #d0d0d0;
  --shadow: 0 12px 35px rgba(0,0,0,0.08);

  --hover: rgba(0,0,0,0.05);

  --link: #6d28d9;
  --link-hover: #5b21b6;
}

:root[data-theme="dark"] {
  --text: #f2f2f2;
  --muted: #b7b7b7;
  --line: rgba(255,255,255,0.10);
  --bg: #0b0b0c;

  --panel-bg: #0f0f12;
  --panel-border: #2b2b2f;
  --shadow: 0 12px 35px rgba(0,0,0,0.45);

  --hover: rgba(255,255,255,0.06);

  --link: #c4b5fd;
  --link-hover: #ddd6fe;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  transition: background 0.15s ease, color 0.15s ease;
}

/* Global content links */
a {
  color: var(--link);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
a:hover {
  color: var(--link-hover);
  border-bottom-color: currentColor;
}

/* =======================
   HEADER
======================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 2000;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.site-header-inner {
  max-width: 1040px;
  margin: 0 auto;
  padding: 14px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

/* Brand must NOT look like a link */
.site-brand,
.site-brand:visited,
.site-brand:hover,
.site-brand:active {
  color: var(--text) !important;
  text-decoration: none !important;
  border-bottom: 0 !important;
  font-weight: 600;
  font-size: 18px;
  letter-spacing: -0.01em;
}
.site-brand:hover { opacity: 0.85; }

/* Top right buttons */
.top-nav {
  position: relative;
  z-index: 5000;
  display: flex;
  align-items: center;
  gap: 18px;
}

.icon-btn {
    position: relative;
  z-index: 5001;          /* makes the actual buttons clickable even if a panel overlaps */
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--muted);
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease, transform 0.15s ease;
}
.icon-btn:hover {
  color: var(--text);
  transform: translateY(-1px);
}
.icon-btn svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Panels */
.menu-panel {
  position: absolute;
  top: calc(100% + 12px);   /* always below the header icon row */
  right: 0;
  width: 300px;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 10px;
  z-index: 3000;
}

.theme-panel {
  position: absolute;
  top: calc(100% + 12px);   /* always below the header icon row */
  right: 40px;
  width: 190px;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 8px;
  z-index: 3000;
}

.search-panel {
  position: absolute;
  top: calc(100% + 12px);
  right: 80px;
  width: 420px;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 12px;
  z-index: 3000;
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  transition: border-color 0.15s ease;
}

.search-input-wrapper:focus-within {
  border-color: var(--link);
}

.search-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  fill: none;
  stroke: var(--muted);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.search-input {
  flex: 1;
  border: none;
  background: none;
  color: var(--text);
  font-size: 15px;
  outline: none;
  font-family: inherit;
}

.search-input::placeholder {
  color: var(--muted);
  opacity: 0.7;
}

.search-clear {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--muted);
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease;
  flex-shrink: 0;
}

.search-clear:hover {
  color: var(--text);
}

.search-clear svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.search-hint {
  margin-top: 10px;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  line-height: 1.4;
}

.menu-tabs {
  display: flex;
  gap: 8px;
  padding: 6px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 8px;
}

.tab {
  border: 0;
  background: none;
  cursor: pointer;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 14px;
  color: var(--muted);
  transition: background 0.15s ease, color 0.15s ease;
}
.tab:hover { background: var(--hover); color: var(--text); }
.tab.is-active { background: rgba(0,0,0,0.06); color: var(--text); font-weight: 600; }

.menu-content { padding: 4px 6px 8px; }
.panel { display: none; }
.panel.is-active { display: grid; gap: 6px; }

.menu-item {
  display: block;
  padding: 10px 10px;
  border-radius: 10px;
  color: var(--text);
  text-decoration: none;
  transition: background 0.15s ease;
  border-bottom: 0;
}
.menu-item:hover { background: var(--hover); }

.menu-section-title {
  margin-top: 8px;
  padding: 8px 10px 6px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  border-top: 1px solid var(--line);
}
.menu-section-title:first-child {
  margin-top: 0;
  border-top: 0;
  padding-top: 6px;
}

.theme-item {
  width: 100%;
  border: 0;
  background: none;
  cursor: pointer;
  padding: 10px 10px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 14px;
  text-align: left;
  transition: background 0.15s ease;
}
.theme-item:hover { background: var(--hover); }
.theme-item svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* =======================
   MAIN WRAP
======================= */
.wrap {
  max-width: 860px;
  margin: 58px auto 0;
  padding: 0 22px;
  min-height: calc(100vh - 120px);
  display: flex;
  flex-direction: column;
}

@media (min-width: 900px) {
  .wrap { max-width: 1040px; }
}

/* =======================
   HERO
======================= */

/* =======================
   HERO (Ran-style layout + rhythm)
======================= */
.hero {
  display: flex;
  flex-direction: column;
  gap: 26px;
  width: 100%;
  align-items: center;
}

/* Photo */
.profile-photo {
  display: block;
  width: 380px;
  height: 380px;
  object-fit: cover;
  border-radius: 18px;
  margin: 0 auto;
}

@media (min-width: 900px) {
  .profile-photo {
    width: 400px;
    height: 400px;
    margin: 0;                 /* IMPORTANT: no negative offset */
  }
}

/* Text column: keep lines short like Ran */
.hero-copy {
  max-width: 680px;
}

/* Headline */
.greeting {
  font-size: 46px;
  font-weight: 800;
  margin: 0 0 10px;
  letter-spacing: -0.02em;
}

/* Subheadline feels more “editorial” (not overly muted) */
.tagline {
  font-size: 20px;
  margin: 0 0 18px;
  color: var(--text);
  opacity: 0.85;
  line-height: 1.6;
}

/* Divider under subheadline */
.long-divider {
  border: none;
  border-top: 1px solid var(--line);
  width: 100%;
  margin: 18px 0 22px;
}

/* Body text rhythm */
.focus,
.intro,
.outside {
  font-size: 18px;
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.95;          /* this is a major part of the Ran feel */
}

#decode-focus,
#decode-intro,
#decode-outside {
  display: block;
}

/* Alien glyph styling */
.word-glyph {
  opacity: 0.6;
  letter-spacing: 0.06em;
}

/* =======================
   FOOTER
======================= */
/* =======================
   FOOTER (Ran-style full-bleed divider + clean spacing)
======================= */
.footer {
  margin-top: auto;
  padding-top: 22px;
  margin-bottom: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  border-top: 0; /* we draw a full-bleed divider ourselves */
}

/* Divider within the wrap */
.footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  border-top: 1px solid var(--line);
}

/* Icons row */
.footer-icons {
  display: flex;
  justify-content: center;
  gap: 30px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.footer-icons a {
  width: 24px;
  height: 24px;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease, transform 0.15s ease, opacity 0.15s ease;
  border-bottom: 0;
}

.footer-icons a:hover {
  color: var(--text);
  transform: translateY(-2px);
  opacity: 1;
}

/* Footer icons are filled */
.footer-icons svg {
  width: 100%;
  height: 100%;
  display: block;
  fill: currentColor;
  stroke: none;
}

/* Threads icon uses the standard filled style */
.footer-icons svg.threads-icon {
  transform: scale(2.5);
  transform-origin: center;
}

/* Footer meta row */
.footer-meta {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: nowrap;
  gap: 12px;
  margin-top: 16px;
  font-size: 14px;
  color: var(--muted);
  text-align: center;
  line-height: 1.2;
  width: 100%;
}

.footer-item {
  white-space: nowrap;
}

/* Dot is a real element, not clickable */
.footer-sep {
  opacity: 0.6;
  pointer-events: none;
  user-select: none;
  margin: 0 6px;
}

.footer-link {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.footer-link:hover {
  border-bottom-color: var(--muted);
}

/* Smaller gap on mobile to keep on same line */
@media (max-width: 480px) {
  .footer-meta {
    gap: 4px;
    font-size: 10px;
  }

  .footer-sep {
    margin: 0 2px;
  }
}

/* =======================
   Ran-style scale override (SAFE)
   (integrated: paste at END)
======================= */

/* Slightly calmer headline */
.greeting {
  font-size: 40px;      /* was 46px */
  margin-bottom: 8px;
}

/* Subheadline a touch smaller */
.tagline {
  font-size: 18px;      /* was 20px */
  margin-bottom: 16px;
  line-height: 1.6;
}

/* Body paragraphs: main change */
.focus,
.intro,
.outside {
  font-size: 15.75px;   /* was 18px */
  line-height: 1.85;    /* Ran-ish rhythm */
  margin-bottom: 16px;
}

/* Divider spacing slightly tighter */
.long-divider {
  margin: 16px 0 20px;
}

/* Mobile: keep it readable, not huge */
@media (max-width: 600px) {
  .greeting { font-size: 32px; }
  .tagline { font-size: 16px; }

  .focus,
  .intro,
  .outside {
    font-size: 14px;
    line-height: 1.7;
  }

  .profile-photo {
    width: 180px;
    height: 180px;
  }

  .site-header-inner {
    padding: 10px 16px;
  }

  .wrap {
    margin-top: 50px;
    padding: 0 16px;
  }

  .menu-panel {
    width: calc(100vw - 32px);
    right: -16px;
  }

  .theme-panel {
    width: 160px;
    right: -16px;
  }

  .footer-icons {
    gap: 20px;
  }

  .footer-meta {
    gap: 4px;
    font-size: 10px;
  }

  .search-panel {
    width: calc(100vw - 32px);
    right: -16px;
  }
}

/* =======================
   EDUCATION SECTION
======================= */
.edu-degree {
  font-weight: 700;
}

.edu-meta {
  font-style: italic;
}

/* =======================
   GOOGLE LOGO COLORS
======================= */
.google-text .g { color: #4285f4; }  /* Blue */
.google-text .o1 { color: #ea4335; } /* Red */
.google-text .o2 { color: #fbbc04; } /* Yellow */
.google-text .g2 { color: #4285f4; } /* Blue */
.google-text .l { color: #34a853; }  /* Green */
.google-text .e { color: #ea4335; }  /* Red */
