/* tanemura.dev top page — neo-brutalism
   Layout: lime hero band (name / tilted photo / link buttons), then a single 900px column of
   plain lists under yellow label headings, blue contact band at the bottom.
   Loaded after bootstrap.min.css; replaces style.css on index.html only. */

:root {
    --page: #ffffff;
    --surface: #ffffff;
    --text: #000000;
    --muted: #4a4a45;
    --line: #000000;          /* borders and hard shadows */
    --on-accent: #000000;     /* ink on coloured fills, same in both themes */
    --sticker: #ffffff;       /* white fill inside coloured bands, same in both themes */
    --lime: #c8e63c;          /* hero band, "数学" */
    --yellow: #ffd93b;        /* headings, table head, hover */
    --red: #ff5c4d;           /* primary action, markers */
    --blue: #5b9dff;          /* contact band, "プログラミング", link underline */

    --display: "Dela Gothic One", "Hiragino Kaku Gothic StdN", "Noto Sans JP", "Yu Gothic", sans-serif;
    --body: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;

    --bw: 3px;
    --gutter-l: max(20px, env(safe-area-inset-left, 0px));
    --gutter-r: max(20px, env(safe-area-inset-right, 0px));
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --page: #141416;
        --surface: #202024;
        --text: #f5f5ee;
        --muted: #b9b9b0;
        --line: #f5f5ee;
        color-scheme: dark;
    }
}

:root[data-theme="dark"] {
    --page: #141416;
    --surface: #202024;
    --text: #f5f5ee;
    --muted: #b9b9b0;
    --line: #f5f5ee;
    color-scheme: dark;
}

/* ---------- base ---------- */

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    font-family: var(--body);
    font-weight: 500;
    font-size: 1rem;
    line-height: 1.75;
    background: var(--page);
    color: var(--text);
}

::selection {
    background: var(--text);
    color: var(--page);
}

p {
    color: var(--text);
}

small {
    color: var(--muted);
}

strong,
b {
    font-weight: 900;
}

a {
    color: var(--text);
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
    text-decoration-color: var(--blue);
    overflow-wrap: anywhere;
}

a:hover {
    color: var(--on-accent);
    background: var(--yellow);
    text-decoration-color: var(--on-accent);
}

:focus-visible {
    outline: 3px solid var(--blue);
    outline-offset: 2px;
}

h3 {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    font-size: 1.05rem;
    font-weight: 900;
    line-height: 1.5;
    margin: 1.75rem 0 0.5rem;
}

h3::before {
    content: "";
    flex: none;
    width: 0.7em;
    height: 0.7em;
    background: var(--red);
    border: 2px solid var(--line);
}

.container {
    max-width: 900px;
    padding-left: var(--gutter-l);
    padding-right: var(--gutter-r);
}

/* ---------- nav ---------- */

.nav-custom {
    position: sticky;
    top: env(safe-area-inset-top, 0px);
    z-index: 1000;
    background: var(--surface);
    border-bottom: var(--bw) solid var(--line);
    padding-block: 0.6rem;
    padding-left: var(--gutter-l);
    padding-right: var(--gutter-r);
}

.nav-custom .navbar-brand,
.nav-custom .navbar-brand:hover,
.nav-custom .navbar-brand:focus {
    font-family: var(--display);
    font-size: 1.05rem;
    color: var(--text);
    background: none;
    text-decoration: none;
}

.nav-custom .nav-item.nav-link {
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 700;
    padding: 0.25rem 0.5rem;
    text-decoration: none;
}

.nav-custom .nav-item.nav-link:hover,
.nav-custom .nav-item.nav-link:focus {
    color: var(--on-accent);
    background: var(--yellow);
}

.nav-custom .btn-primary {
    align-self: flex-start;
    background: var(--red) !important;
    color: var(--on-accent) !important;
    border: var(--bw) solid var(--line) !important;
    border-radius: 0;
    box-shadow: 3px 3px 0 var(--line) !important;
    padding: 0.25rem 0.9rem;
    transition: transform 0.08s, box-shadow 0.08s;
}

.nav-custom .btn-primary:hover,
.nav-custom .btn-primary:active {
    transform: translate(3px, 3px);
    box-shadow: 0 0 0 var(--line) !important;
}

.nav-custom .navbar-toggler {
    border: var(--bw) solid var(--line);
    border-radius: 0;
    padding: 0.35rem 0.5rem;
}

.nav-custom .navbar-toggler-icon {
    width: 1.5rem;
    height: 1.25rem;
    background: linear-gradient(var(--line), var(--line)) 0 0 / 100% 3px no-repeat,
        linear-gradient(var(--line), var(--line)) 0 50% / 100% 3px no-repeat,
        linear-gradient(var(--line), var(--line)) 0 100% / 100% 3px no-repeat;
}

@media (max-width: 767.98px) {
    .nav-custom .navbar-nav {
        gap: 0.25rem;
        padding-block: 0.75rem 0.5rem;
    }
}

/* ---------- hero ---------- */

.hero-section {
    background-color: var(--lime);
    background-image: radial-gradient(rgba(0, 0, 0, 0.2) 1.5px, transparent 1.7px);
    background-size: 22px 22px;
    border-bottom: 4px solid var(--line);
    overflow: hidden;
}

.hero-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding-block: clamp(2rem, 6vw, 4.5rem);
    padding-left: var(--gutter-l);
    padding-right: var(--gutter-r);
    display: grid;
    gap: clamp(1.5rem, 4vw, 2.5rem);
    grid-template-areas: "name" "photo" "links";
}

.name {
    grid-area: name;
    margin: 0;
    font-family: var(--display);
    font-size: clamp(2.75rem, 14.5vw, 6.5rem);
    line-height: 1;
    color: var(--on-accent);
    text-shadow: 0.045em 0.045em 0 var(--sticker);
}

.hero-photo {
    grid-area: photo;
    position: relative;
    justify-self: center;
    width: min(100%, 440px);
    padding: 0 12px 12px 0;
}

.hero-photo img {
    display: block;
    width: 100%;
    height: auto;
    border: 4px solid var(--on-accent);
    box-shadow: 12px 12px 0 var(--on-accent);
    transform: rotate(2deg);
}

.hero-tag {
    position: absolute;
    left: -8px;
    bottom: 28px;
    background: var(--red);
    color: var(--on-accent);
    border: var(--bw) solid var(--on-accent);
    box-shadow: 4px 4px 0 var(--on-accent);
    font-weight: 900;
    font-size: clamp(1rem, 3.5vw, 1.35rem);
    line-height: 1.4;
    padding: 0.15em 0.7em;
    transform: rotate(-5deg);
}

.hero-links {
    grid-area: links;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.hero-links a {
    background: var(--sticker);
    color: var(--on-accent);
    border: var(--bw) solid var(--on-accent);
    box-shadow: 4px 4px 0 var(--on-accent);
    font-weight: 900;
    padding: 0.4em 1em;
    text-decoration: none;
    transition: transform 0.08s, box-shadow 0.08s;
}

.hero-links a:hover {
    background: var(--yellow);
    transform: translate(4px, 4px);
    box-shadow: 0 0 0 var(--on-accent);
}

@media (min-width: 768px) {
    .hero-inner {
        grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
        grid-template-areas: "name photo" "links photo";
        align-items: center;
    }

    .name {
        align-self: end;
        font-size: clamp(3rem, 7.4vw, 6rem);
    }

    .hero-links {
        align-self: start;
    }
}

/* ---------- section headings ---------- */

.name_title {
    display: inline-block;
    max-width: 100%;
    font-family: var(--display);
    font-size: clamp(1.1rem, 4.4vw, 1.55rem);
    line-height: 1.4;
    text-wrap: balance;
    word-break: auto-phrase;
    background: var(--yellow);
    color: var(--on-accent);
    border: var(--bw) solid var(--line);
    box-shadow: 5px 5px 0 var(--line);
    padding: 0.3em 0.7em;
}

#aboutme {
    margin-top: 3rem;
}

/* ---------- about ---------- */

.about_description p:first-child {
    font-size: clamp(1.1rem, 4.2vw, 1.35rem);
    font-weight: 900;
    line-height: 1.6;
}

.about_description p {
    color: var(--muted);
    font-size: 0.85rem;
}

.about_description p:first-child {
    color: var(--text);
}

.contact-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 0;
    list-style: none;
}

.contact-links a {
    display: inline-block;
    background: var(--surface);
    border: var(--bw) solid var(--line);
    box-shadow: 4px 4px 0 var(--line);
    font-size: 0.85rem;
    font-weight: 700;
    padding: 0.35em 0.9em;
    text-decoration: none;
    transition: transform 0.08s, box-shadow 0.08s;
}

.contact-links a:hover {
    background: var(--lime);
    transform: translate(4px, 4px);
    box-shadow: 0 0 0 var(--line);
}

/* ---------- profile / experience / certified lists ---------- */

.main_profile ul,
.main_profile2 ul {
    list-style: none;
    padding: 0;
    margin: 0;
    border-top: 2px solid var(--line);
}

.main_profile li,
.main_profile2 li {
    position: relative;
    padding: 0.7rem 0 0.7rem 1.5rem;
    border-bottom: 2px solid var(--line);
}

.main_profile li::before,
.main_profile2 li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 1.25rem;
    width: 10px;
    height: 10px;
    background: var(--line);
}

.main_profile li p,
.main_profile2 li p {
    margin: 0;
    font-weight: 700;
}

.main_profile li p small {
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 500;
    line-height: 1.6;
    margin-top: 0.2rem;
}

/* ---------- papers / awards / media lists ---------- */

section ol {
    padding-left: 2.2rem;
}

section ol li {
    margin-bottom: 0.9rem;
    padding-left: 0.25rem;
    font-size: 0.95rem;
}

section ol li::marker {
    font-family: var(--display);
}

section ol li p,
section > p {
    margin: 0;
}

section ol li u {
    text-decoration: none;
    background: var(--yellow);
    color: var(--on-accent);
    font-weight: 700;
    padding: 0 0.2em;
}

/* ---------- badges ---------- */

.badge {
    border: 2px solid var(--line);
    border-radius: 0;
    color: var(--on-accent);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 8px;
    vertical-align: middle;
}

.badge-primary {
    background: var(--blue);
}

.badge-success {
    background: var(--lime);
}

.badge-secondary,
.badge-light {
    background: var(--surface);
    color: var(--text);
}

.badge-pill {
    border-radius: 999px;
}

/* ---------- skills ---------- */

#skills + section ul {
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

#skills + section h3 {
    width: 100%;
    margin-bottom: 0;
}

#skills + section ul li p {
    display: inline-block;
    margin: 0;
    background: var(--surface);
    border: 2px solid var(--line);
    box-shadow: 3px 3px 0 var(--line);
    font-size: 0.9rem;
    font-weight: 700;
    padding: 2px 12px;
}

/* ---------- products table (DataTables) ----------
   DataTables' own stylesheets load after this file, hence the !important. */

.dataTables_wrapper {
    background: var(--surface);
    border: var(--bw) solid var(--line);
    box-shadow: 8px 8px 0 var(--line);
    padding: 12px;
    margin: 1.25rem 8px 1.5rem 0;
}

.dataTables_wrapper .dataTables_filter {
    color: var(--text) !important;
    font-weight: 700;
    margin-bottom: 12px;
}

.dataTables_wrapper .dataTables_filter input {
    background: var(--page) !important;
    color: var(--text) !important;
    border: var(--bw) solid var(--line) !important;
    border-radius: 0 !important;
    font: inherit;
    padding: 4px 10px !important;
}

.dataTables_wrapper .dataTables_filter input:focus {
    outline: none;
    box-shadow: 4px 4px 0 var(--blue);
}

table.dataTable {
    border-collapse: collapse !important;
}

table.dataTable.no-footer {
    border-bottom: 0 !important;
}

table.dataTable thead th {
    background: var(--yellow) !important;
    color: var(--on-accent) !important;
    border-bottom: var(--bw) solid var(--line) !important;
    font-size: 0.85rem;
    font-weight: 900;
    padding: 10px 12px !important;
}

table.dataTable tbody td {
    background: var(--surface) !important;
    color: var(--text) !important;
    border-bottom: 2px solid var(--line) !important;
    font-size: 0.9rem;
    padding: 10px 12px !important;
}

/* the table is "nowrap"; let the title column wrap so long titles fit a phone */
table.dataTable.nowrap tbody td:first-child {
    white-space: normal;
}

table.dataTable tbody tr:last-child td {
    border-bottom: 0 !important;
}

table.dataTable tbody tr:hover td,
table.dataTable tbody tr:hover td a {
    background: var(--lime) !important;
    color: var(--on-accent) !important;
}

table.dataTable.dtr-inline.collapsed > tbody > tr > td:first-child {
    padding-left: 36px !important;
}

table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control::before {
    left: 8px;
    background: var(--red) !important;
    color: var(--on-accent) !important;
    border: 2px solid var(--line) !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    font-weight: 900;
}

/* ---------- contact band ---------- */

.original-footer {
    background: var(--blue);
    color: var(--on-accent);
    border-top: 4px solid var(--line);
    margin-top: 4rem;
    padding: 3rem 20px !important;
}

.original-footer p {
    font-family: var(--display);
    font-size: clamp(1.15rem, 4.6vw, 1.8rem);
    line-height: 1.7;
    color: var(--on-accent);
    margin-bottom: 0;
    text-wrap: balance;
    word-break: auto-phrase;
}

.original-footer span {
    display: inline-block;
    background: var(--yellow);
    border: var(--bw) solid var(--on-accent);
    line-height: 1.3;
    padding: 0 0.35em;
    transform: rotate(-3deg);
}

.original-footer a {
    display: inline-block;
    background: var(--sticker);
    color: var(--on-accent);
    border: var(--bw) solid var(--on-accent);
    box-shadow: 5px 5px 0 var(--on-accent);
    font-family: var(--body);
    font-size: clamp(1rem, 4vw, 1.25rem);
    font-weight: 900;
    padding: 0.35em 1em;
    margin-top: 1rem;
    text-decoration: none;
    transition: transform 0.08s, box-shadow 0.08s;
}

.original-footer a:hover {
    background: var(--yellow);
    transform: translate(5px, 5px);
    box-shadow: 0 0 0 var(--on-accent);
}

.original-footer p:last-child {
    font-family: var(--body);
    font-size: 12px !important;
    opacity: 1 !important;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    * {
        transition: none !important;
    }
}
