/* ═══════════════════════════════════════════
   INK & SIGNAL — Desktop Stylesheet
   A refined editorial Japanese portfolio
   ═══════════════════════════════════════════ */

/* --- Reset & Base --- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg:       #f5f0e8;
  --surface:  #ffffff;
  --text:     #1a1a1a;
  --text-secondary: #5a5a5a;
  --accent:   #c84b31;
  --accent-hover: #a83a22;
  --teal:     #4a9e8e;
  --border:   rgba(0,0,0,0.08);
  --mono:     'IBM Plex Mono', 'Menlo', monospace;
  --serif:    'Cormorant Garamond', 'Georgia', serif;
  --sans:     'Zen Kaku Gothic New', 'Hiragino Kaku Gothic ProN', 'Yu Gothic', sans-serif;
  --ease:     cubic-bezier(0.22, 1, 0.36, 1);
}

.dark {
  --bg:       #0d0d0d;
  --surface:  #161616;
  --text:     #e8e4de;
  --text-secondary: #9a9590;
  --accent:   #e8654a;
  --accent-hover: #ff7a5c;
  --teal:     #5bbfad;
  --border:   rgba(255,255,255,0.06);
}

html { height: 100%; scroll-behavior: smooth; }

body {
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.8;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background 0.5s var(--ease), color 0.4s var(--ease);
}

/* --- Noise Texture Overlay --- */
.noise {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' 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)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}
.dark .noise { opacity: 0.04; }

/* --- Theme Toggle --- */
#theme-toggle {
  position: fixed;
  top: 28px;
  right: 28px;
  z-index: 1000;
  width: 44px;
  height: 44px;
  border: 1.5px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.3s, background 0.3s, transform 0.15s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

#theme-toggle:hover {
  border-color: var(--accent);
  transform: scale(1.08);
}

#theme-toggle:active { transform: scale(0.96); }

.toggle-icon {
  display: block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--text);
  transition: background 0.3s, clip-path 0.4s var(--ease);
  clip-path: circle(50% at 50% 50%);
}

.dark .toggle-icon {
  clip-path: polygon(50% 0%, 65% 35%, 100% 50%, 65% 65%, 50% 100%, 35% 65%, 0% 50%, 35% 35%);
  background: #fbbf24;
}

/* --- Page Container --- */
.page {
  max-width: 740px;
  margin: 0 auto;
  padding: 80px 40px 60px;
}

/* --- Hero Section --- */
.hero {
  position: relative;
  margin-bottom: 64px;
  padding-bottom: 48px;
  border-bottom: 1px solid var(--border);
}

.hero__stamp {
  position: absolute;
  top: -10px;
  right: 0;
  font-family: var(--serif);
  font-size: 72px;
  font-weight: 300;
  color: var(--accent);
  opacity: 0.08;
  line-height: 1;
  pointer-events: none;
  user-select: none;
  letter-spacing: 8px;
}

.hero__name {
  font-family: var(--serif);
  font-size: 64px;
  font-weight: 300;
  line-height: 1.1;
  letter-spacing: -0.5px;
  margin-bottom: 16px;
}

.hero__name-first {
  font-weight: 600;
}

.hero__name-last {
  font-weight: 300;
  margin-left: 12px;
}

.hero__title {
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 3px;
  margin-bottom: 24px;
}

.hero__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
}

.link {
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 400;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 6px 0;
  position: relative;
  transition: color 0.25s var(--ease);
}

.link:not(:last-child)::after {
  content: '/';
  margin: 0 14px;
  color: var(--border);
  pointer-events: none;
}

.link:hover {
  color: var(--accent);
}

/* --- Content Sections --- */
.content { display: flex; flex-direction: column; gap: 56px; }

.section__heading {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
}

.section__heading-jp {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--accent);
  white-space: nowrap;
}

.section__heading-line {
  flex: 1;
  height: 1px;
  background: var(--border);
}

.section__subtitle {
  font-size: 13.5px;
  color: var(--text-secondary);
  margin-bottom: 24px;
  font-style: italic;
}

/* --- About --- */
.about__text {
  font-size: 15px;
  line-height: 2;
  color: var(--text);
  margin-bottom: 24px;
}

.about__contact {
  font-size: 14px;
  color: var(--text-secondary);
  padding: 20px 24px;
  background: var(--surface);
  border-left: 3px solid var(--accent);
  border-radius: 0 6px 6px 0;
  transition: background 0.4s var(--ease);
}

.dark .about__contact {
  background: rgba(255,255,255,0.03);
}

.about__contact a {
  color: var(--accent);
  text-decoration: none;
  font-family: var(--mono);
  font-size: 13px;
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s;
}

.about__contact a:hover {
  border-bottom-color: var(--accent);
}

/* --- Timeline --- */
.timeline { display: flex; flex-direction: column; gap: 0; }

.timeline__item {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 24px;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
  transition: background 0.3s var(--ease);
}

.timeline__item:last-child { border-bottom: none; }

.timeline__item:hover {
  background: rgba(200,75,49,0.03);
  padding-left: 8px;
  padding-right: 8px;
  margin-left: -8px;
  margin-right: -8px;
  border-radius: 6px;
}

.dark .timeline__item:hover {
  background: rgba(232,101,74,0.05);
}

.timeline__date {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 400;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
  padding-top: 3px;
}

.timeline__company {
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 2px;
}

.timeline__role {
  font-size: 13.5px;
  color: var(--text-secondary);
}

/* --- Education --- */
.edu__school {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 6px;
}

.edu__degree {
  font-size: 14px;
  color: var(--text);
  margin-bottom: 2px;
}

.edu__location {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.edu__details {
  display: flex;
  gap: 24px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-secondary);
}

/* --- Skills --- */
.skills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.skill-tag {
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 400;
  padding: 8px 18px;
  border: 1px solid var(--border);
  border-radius: 100px;
  color: var(--text);
  transition: all 0.3s var(--ease);
  cursor: default;
}

.skill-tag:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(200,75,49,0.1);
}

.dark .skill-tag:hover {
  box-shadow: 0 4px 12px rgba(232,101,74,0.15);
}

/* --- Tools Grid --- */
.tools {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.tool-card {
  display: flex;
  flex-direction: column;
  padding: 28px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  text-decoration: none;
  color: var(--text);
  transition: all 0.35s var(--ease);
  position: relative;
  overflow: hidden;
}

.tool-card::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s var(--ease);
}

.tool-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 40px rgba(0,0,0,0.08);
  border-color: var(--accent);
}

.dark .tool-card {
  background: rgba(255,255,255,0.03);
}

.dark .tool-card:hover {
  box-shadow: 0 16px 40px rgba(0,0,0,0.3);
}

.tool-card:hover::before {
  transform: scaleX(1);
}

.tool-card__name {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 8px;
}

.tool-card__desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.7;
  flex: 1;
}

.tool-card__arrow {
  font-size: 18px;
  color: var(--accent);
  margin-top: 16px;
  transition: transform 0.3s var(--ease);
  align-self: flex-end;
}

.tool-card:hover .tool-card__arrow {
  transform: translateX(6px);
}

/* --- Interests --- */
.interests {
  font-size: 14px;
  color: var(--text-secondary);
}

.interests a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s;
}

.interests a:hover {
  border-bottom-color: var(--accent);
}

/* --- Footer --- */
.footer {
  margin-top: 72px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
  text-align: center;
}

.footer__mark {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 300;
  color: var(--text-secondary);
  letter-spacing: 4px;
  opacity: 0.4;
}

/* --- Reveal Animations --- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-section {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}

.reveal-section.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Selection Color --- */
::selection {
  background: var(--accent);
  color: #fff;
}

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