/*
Theme Name: ikuneko
Theme URI: https://ikuneko.com
Author: ikuneko
Author URI: https://ikuneko.com
Description: 開発者ポートフォリオ＆技術ブログ用カスタムテーマ。ダークモダン×猫モチーフ。
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: ikuneko
Tags: portfolio, blog, dark, custom-colors, custom-menu, featured-images, responsive-layout
*/

/* =============================================
   CSS VARIABLES
   ============================================= */
:root {
  --bg:        #0d0d0f;
  --bg2:       #13131a;
  --bg3:       #1a1a24;
  --border:    #252535;
  --accent:    #f0c060;   /* warm amber - cat eye color */
  --accent2:   #60c0a0;   /* teal - secondary */
  --accent3:   #e06080;   /* rose - tertiary */
  --text:      #e8e4dc;
  --muted:     #6a6a82;
  --muted2:    #4a4a60;
  --radius:    10px;
  --font-head: 'Playfair Display', Georgia, serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --font-body: 'Noto Sans JP', 'Hiragino Sans', sans-serif;
}

/* =============================================
   RESET & BASE
   ============================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.75;
  overflow-x: hidden;
}

/* Noise texture overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
  opacity: 0.4;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: #fff; }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-head);
  line-height: 1.25;
  color: var(--text);
}

p { margin-bottom: 1.2em; }
ul, ol { padding-left: 1.5em; margin-bottom: 1em; }

/* =============================================
   LAYOUT
   ============================================= */
.site-wrapper {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100vh;
}

.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
}

.content-area {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 48px;
  padding: 60px 0;
}

@media (max-width: 900px) {
  .content-area { grid-template-columns: 1fr; }
}

/* =============================================
   HEADER
   ============================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13,13,15,0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 24px;
}

/* Logo */
.site-branding {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.site-logo-mark {
  width: 36px;
  height: 36px;
  position: relative;
  flex-shrink: 0;
}

.site-logo-mark svg { width: 100%; height: 100%; }

.site-title {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.5px;
}

.site-title span { color: var(--accent); }

/* Nav */
.main-navigation ul {
  display: flex;
  list-style: none;
  gap: 2px;
  padding: 0;
  margin: 0;
}

.main-navigation a {
  display: block;
  padding: 6px 14px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
  border-radius: 6px;
  transition: all 0.2s;
  letter-spacing: 0.5px;
}

.main-navigation a:hover,
.main-navigation .current-menu-item a {
  color: var(--accent);
  background: rgba(240,192,96,0.08);
}

/* Mobile nav toggle */
.menu-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: 6px 10px;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

@media (max-width: 768px) {
  .menu-toggle { display: block; }
  .main-navigation {
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--bg2);
    border-bottom: 1px solid var(--border);
    padding: 16px;
    display: none;
  }
  .main-navigation.open { display: block; }
  .main-navigation ul { flex-direction: column; gap: 4px; }
  .main-navigation a { font-size: 15px; padding: 10px 16px; }
}

/* =============================================
   HERO (Front Page)
   ============================================= */
.hero {
  min-height: 92vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  padding: 80px 0;
}

/* Animated grid lines */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(240,192,96,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(240,192,96,0.04) 1px, transparent 1px);
  background-size: 60px 60px;
  animation: gridScroll 20s linear infinite;
}

@keyframes gridScroll {
  0% { background-position: 0 0; }
  100% { background-position: 60px 60px; }
}

/* Glowing orbs */
.hero::after {
  content: '';
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(240,192,96,0.06) 0%, transparent 70%);
  top: -100px;
  right: -100px;
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.hero-eyebrow::before {
  content: '';
  width: 40px;
  height: 1px;
  background: var(--accent);
  display: block;
}

.hero-title {
  font-size: clamp(48px, 8vw, 96px);
  font-weight: 900;
  line-height: 1.0;
  letter-spacing: -3px;
  margin-bottom: 28px;
  color: var(--text);
}

.hero-title .highlight {
  color: var(--accent);
  font-style: italic;
}

.hero-title .cat-paw {
  display: inline-block;
  animation: pawWiggle 3s ease-in-out infinite;
}

@keyframes pawWiggle {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-8deg); }
  75% { transform: rotate(8deg); }
}

.hero-desc {
  font-size: 18px;
  color: var(--muted);
  max-width: 560px;
  line-height: 1.7;
  margin-bottom: 40px;
}

.hero-desc strong { color: var(--text); font-weight: 500; }

.hero-cta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: var(--bg);
}

.btn-primary:hover {
  background: #fff;
  color: var(--bg);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(240,192,96,0.3);
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

/* Tech stack pills */
.hero-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 48px;
}

.stack-pill {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 4px 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  transition: all 0.2s;
}

.stack-pill:hover {
  border-color: var(--accent2);
  color: var(--accent2);
}

/* =============================================
   SECTION HEADERS
   ============================================= */
.section-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
  max-width: 60px;
}

.section-title {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 700;
  letter-spacing: -1px;
  margin-bottom: 40px;
}

/* =============================================
   WORKS / PORTFOLIO GRID
   ============================================= */
.works-section { padding: 100px 0; }

.works-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.work-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  transition: all 0.3s;
  display: flex;
  flex-direction: column;
}

.work-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 16px 48px rgba(0,0,0,0.4), 0 0 0 1px rgba(240,192,96,0.1);
}

.work-card-thumb {
  aspect-ratio: 16/9;
  background: var(--bg3);
  overflow: hidden;
  position: relative;
}

.work-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s;
}

.work-card:hover .work-card-thumb img { transform: scale(1.04); }

.work-card-thumb-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  background: linear-gradient(135deg, var(--bg3) 0%, #1e1e2e 100%);
}

.work-card-body { padding: 24px; flex: 1; display: flex; flex-direction: column; }

.work-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.tag {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 3px 10px;
  border-radius: 100px;
  letter-spacing: 0.5px;
}

.tag-tech  { background: rgba(96,192,160,0.12); color: var(--accent2); border: 1px solid rgba(96,192,160,0.2); }
.tag-app   { background: rgba(240,192,96,0.12); color: var(--accent);  border: 1px solid rgba(240,192,96,0.2); }
.tag-tool  { background: rgba(224,96,128,0.12); color: var(--accent3); border: 1px solid rgba(224,96,128,0.2); }

.work-card-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.3px;
}

.work-card-desc {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
  flex: 1;
  margin-bottom: 20px;
}

.work-card-links {
  display: flex;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.work-card-links a {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s;
}

.work-card-links a:hover { color: var(--accent); }

/* =============================================
   BLOG POSTS
   ============================================= */
.blog-section { padding: 100px 0; background: var(--bg2); }

/* Archive / blog list */
.posts-list { display: flex; flex-direction: column; gap: 0; }

.post-item {
  padding: 32px 0;
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: start;
  transition: all 0.2s;
}

.post-item:first-child { border-top: 1px solid var(--border); }
.post-item:hover { padding-left: 8px; }

.post-date {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted2);
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.post-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
  line-height: 1.3;
}

.post-title a { color: var(--text); }
.post-title a:hover { color: var(--accent); }

.post-excerpt {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.65;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-thumb {
  width: 120px;
  height: 80px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid var(--border);
}

.post-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* =============================================
   SINGLE POST
   ============================================= */
.single-header {
  padding: 80px 0 60px;
  border-bottom: 1px solid var(--border);
}

.single-header .post-date { margin-bottom: 16px; }

.single-title {
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 900;
  letter-spacing: -2px;
  line-height: 1.1;
  margin-bottom: 20px;
}

.single-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}

.single-content {
  padding: 60px 0;
  max-width: 720px;
}

/* Article typography */
.entry-content h2 {
  font-size: 28px;
  margin: 2.5em 0 0.8em;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.entry-content h3 {
  font-size: 22px;
  margin: 2em 0 0.6em;
  color: var(--accent);
}

.entry-content p { margin-bottom: 1.5em; font-size: 16px; line-height: 1.85; }

.entry-content a { color: var(--accent); border-bottom: 1px dashed rgba(240,192,96,0.4); }
.entry-content a:hover { border-bottom-style: solid; }

/* Code blocks */
.entry-content pre,
.entry-content code {
  font-family: var(--font-mono);
}

.entry-content code {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 7px;
  font-size: 0.875em;
  color: var(--accent2);
}

.entry-content pre {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px;
  overflow-x: auto;
  margin: 2em 0;
  font-size: 14px;
  line-height: 1.7;
}

.entry-content pre code {
  background: none;
  border: none;
  padding: 0;
  color: var(--text);
}

/* Blockquote */
.entry-content blockquote {
  border-left: 3px solid var(--accent);
  margin: 2em 0;
  padding: 16px 24px;
  background: rgba(240,192,96,0.05);
  border-radius: 0 8px 8px 0;
  font-style: italic;
  color: var(--muted);
}

/* =============================================
   SIDEBAR
   ============================================= */
.sidebar { padding-top: 0; }

.widget {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
}

.widget-title {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.widget ul { list-style: none; padding: 0; }
.widget ul li { padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.widget ul li:last-child { border-bottom: none; }
.widget ul li a { color: var(--muted); }
.widget ul li a:hover { color: var(--accent); }

/* Profile widget */
.profile-widget { text-align: center; }
.profile-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  margin: 0 auto 12px;
  border: 2px solid var(--accent);
  overflow: hidden;
  background: var(--bg3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
}
.profile-name { font-weight: 700; font-size: 16px; margin-bottom: 4px; }
.profile-bio { font-size: 13px; color: var(--muted); line-height: 1.5; }

/* =============================================
   ABOUT PAGE
   ============================================= */
.about-hero { padding: 100px 0 60px; }

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: start;
  padding: 60px 0;
}

@media (max-width: 768px) { .about-grid { grid-template-columns: 1fr; } }

.skill-list { list-style: none; padding: 0; }
.skill-item { margin-bottom: 16px; }
.skill-name {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 13px;
  margin-bottom: 6px;
}
.skill-bar { height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; }
.skill-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 2px;
  transition: width 1s ease;
}

/* Timeline */
.timeline { position: relative; padding-left: 24px; }
.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: var(--border);
}
.timeline-item { position: relative; margin-bottom: 32px; }
.timeline-item::before {
  content: '';
  position: absolute;
  left: -28px;
  top: 8px;
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
}
.timeline-year {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 1px;
  margin-bottom: 4px;
}
.timeline-role { font-weight: 700; margin-bottom: 4px; }
.timeline-desc { font-size: 14px; color: var(--muted); line-height: 1.6; }

/* =============================================
   FOOTER
   ============================================= */
.site-footer {
  background: var(--bg2);
  border-top: 1px solid var(--border);
  padding: 60px 0 32px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 48px;
}

@media (max-width: 768px) { .footer-grid { grid-template-columns: 1fr; gap: 32px; } }

.footer-brand .site-title { font-size: 20px; margin-bottom: 12px; display: block; }
.footer-desc { font-size: 14px; color: var(--muted); line-height: 1.6; max-width: 280px; }

.footer-heading {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted2);
  margin-bottom: 16px;
}

.footer-links { list-style: none; padding: 0; }
.footer-links li { margin-bottom: 8px; }
.footer-links a { font-size: 14px; color: var(--muted); }
.footer-links a:hover { color: var(--accent); }

.footer-bottom {
  padding-top: 32px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-copy {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted2);
}

.footer-copy .cat { display: inline-block; animation: pawWiggle 3s ease-in-out infinite; }

.social-links { display: flex; gap: 12px; }
.social-links a {
  width: 36px;
  height: 36px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 16px;
  transition: all 0.2s;
}
.social-links a:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(240,192,96,0.08);
}

/* =============================================
   UTILITIES
   ============================================= */
.text-accent  { color: var(--accent); }
.text-muted   { color: var(--muted); }
.text-mono    { font-family: var(--font-mono); }
.mb-0 { margin-bottom: 0; }

/* Pagination */
.pagination {
  display: flex;
  gap: 8px;
  justify-content: center;
  padding: 48px 0;
}

.page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 13px;
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--muted);
  transition: all 0.2s;
}

.page-numbers:hover, .page-numbers.current {
  background: rgba(240,192,96,0.1);
  border-color: var(--accent);
  color: var(--accent);
}

/* =============================================
   ANIMATIONS
   ============================================= */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted2); }
